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

How to set boundary conditions for Maxwell Equation in FEniCS ?

+2 votes

Hi, everybody. I am a newer to fenics.
I will appreciate your any help!!! Thanks.

The boundary condition of Maxwell equation is u x n = 0, i.e., curl u = 0.

Then how to implement the boundary condition in FEniCS?

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 Feb 10, 2017 by fanronghong FEniCS User (1,680 points)

1 Answer

+2 votes

If you are using H(curl) you mean Nédélec elements, right? In that case: Yes, the boundary condition has to set the boundary values to zero since they are tangential.

But maybe strip down your code to a minimal working example (MWE) and post it as a comment. It'll help understand your problem.

answered Feb 10, 2017 by cweickhmann FEniCS Novice (550 points)

Thank you very much for your answer!!!

Yes, I use Nédélec elements.
You mean that curl u = 0 on boundary is equal to bc = DirichletBC(V, Constant(0,0,0), boundary), right?
Then what's difference between curl u = 0 and u = 0 on boundary ?

...