This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

how to implement the boundary condition of Maxwell equation?

0 votes

I appreciate your answer. And can I ask you another question?

The boundary condition of Maxwell equation is u x n = 0, i.e., curl u = 0. Then how to implement the boundary condition. In others example, like finite element function space V = H(curl, 0), somebody implements boundary condition by bc = DirichletBC(V, Constant(0,0,0), boundary).
But I think it's not right.
If u = 0 on boundary, bc = DirichletBC(V, Constant(0,0,0), boundary) is OK.
But here is curl u = 0, not u = 0 on boundary, bc = DirichletBC(V, Constant(0,0,0), boundary) is right???

asked Dec 13, 2016 by fanronghong FEniCS User (1,680 points)

1 Answer

+1 vote
 
Best answer

Referring to the curl-curl-example (dolfin-demos), Zero-Dirichlet-BC may be implemented via:

PN = FunctionSpace(mesh, "N1curl", 1)
zero = Expression(("0.0", "0.0", "0.0"), degree=2)

# Dirichlet boundary
class DirichletBoundary(SubDomain):
    def inside(self, x, on_boundary):
        return on_boundary

# Boundary condition
bc = DirichletBC(PN, zero, DirichletBoundary())

Nevertheless, I'm also not sure if the BC (!curl u =0!) are implemented correctly by this way on a Nedelec Space...

I'm dealing with scattered field problems and implicit BC are fine for me at the moment, maybe you can use implicit BC, too. What is your physical Problem?

answered Dec 13, 2016 by RR FEniCS User (3,330 points)
selected Mar 2, 2017 by fanronghong

Thanks for your answer very much! My mentor gave me the problem which I don't know the background of the problem. But I know I must set the H(curl, 0) boundary condition.
Thanks again.

I think I am wrong. The boundary condition of Maxwell Equation is u x n =0, not curl u = 0.

So bc = DirichletBC(V, Constant(0,0,0), boundary) for u x n = 0 is right ???

Please help me the question, and I need the answer very desperately. Thamks!!!

u x n = 0 is correct & the above mentioned implementation is correct!

Thank you very much !!!

...