Skip to content

Neumann condition essential for Mixed Poisson equation #1083

Answered by kinnala
mhtber asked this question in Q&A
Discussion options

You must be logged in to vote

I made some small changes, hopefully it is correct. You can compare against your analytical solution:

import numpy as np
from skfem import *
from skfem.helpers import dot, div

mesh = MeshTri().refined(6)
element = {'sigma': ElementTriRT0(), 'u': ElementTriP0()}

basis = {variable: Basis(mesh, e, intorder=4) for variable, e in element.items()}

@BilinearForm
def a(sigma, tau, _):
    return dot(sigma, tau)
A = asm(a, basis['sigma'])

@BilinearForm
def b(sigma, v, _):
    return div(sigma) * v
B = asm(b, basis['sigma'], basis['u'])

@LinearForm
def f(v, _):
    return 6 * v
Fu = asm(f, basis['u'])

@LinearForm
def g_D(tau, w):
    x = w.x
    return (dot(tau, w.n) * (1 + x[0]*x[0] + 2*x[1]*x[

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@mhtber
Comment options

@kinnala
Comment options

@mhtber
Comment options

@kinnala
Comment options

Answer selected by mhtber
@mhtber
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants