Reputation: 548
I want to use Nédélec's elements in FreeFem++ to solve Maxwell's equations in 3D. My problem is that I don't find a way to write the boundary condition which is E × N = F. I tested:
on(0, Ehy * N.z - Ehz * N.y = Fx, Ehz * N.x - Ehx * N.z = Fy, Ehx * N.y - Ehy * N.x = Fz)
but an error is displayed, and the only thing it says is that there is an error "before token =". If I change the boundary condition to a random one like on(0, Ehx = Fx, Ehy = Fy, Ehz = Fz)
it doesn't throw any error so I think the issue comes from the arithmetics operations in the condition.
Any idea?
Upvotes: 1
Views: 444
Reputation: 548
Writing on(0, Ehx = Fx, Ehy = Fy, Ehz = Fz)
won't produce a compilation error, but it won't produce the right solution neither.
There is a workaround to get the right solution, with the right boundary condition: having a function f such that f × n = E × n. That way, you can write on(0, Ehx = fx, Ehy = fy, Ehz = fz)
and it will work as expected.
If you only have F but you know exactly the boundary of the domain you can compute f = n × F. Basic operations will convince you that f × n = E × n.
Upvotes: 1