preconditioners for complex-valued problems
When solving an ordinary real-valued curl-curl problem, some AMG preconditioners do an excellent job.
=======
from dolfin import *
parameters[
mesh = UnitCube(30, 30, 30)
W = FunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1)
bc = DirichletBC(W, (0, 0, 0), "on_boundary")
rhs = project(
T = Function(W)
v0 = TestFunction(W)
u0 = TrialFunction(W)
a = inner(curl(u0), curl(v0))*dx
L = -inner(rhs,v0)*dx
prm = parameters[
prm['absolute_
prm['relative_
prm['maximum_
set_log_
solve(a == L, T, bc,
solver_
=======
(Convergence results could be improved even further by setting the default parameters to 'Maxwell' instead of 'SA' in ./dolfin/
If the vector field A is complex-valued, it is advised to break up A into real and imaginary part and do the computation that way.
=======
from dolfin import *
parameters[
# Create mesh
mesh = UnitCube(3, 3, 3)
PN = FunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1)
W = PN * PN
bc = DirichletBC(W, (0, 0, 0, 0, 0, 0), "on_boundary")
fr = project(
fi = project(
T = Function(W)
vr, vi = TestFunctions(W)
ur, ui = TrialFunctions(W)
a = inner(curl(ur), curl(vr))*dx + inner(curl(ui), curl(vi))*dx \
+ inner(curl(ur), curl(vi))*dx - inner(curl(ui), curl(vr))*dx
L = -inner(fr,vr)*dx + inner(fi, vi)*dx \
-inner(
prm = parameters[
prm['absolute_
prm['relative_
prm['maximum_
set_log_
solve(a == L, T, bc,
solver_
=======
However, the preconditioner doesn't seem to work at all.
A possible reason for this is the fact that the aggregation step in AMG mixes up real and imaginary components since at the time of the matrix build it has no way of separating those. ML does provide an option for this particular case, namely
mlist.set( "PDE equations", 2 );
This one however only works if is the matrix is really a 2x2 block matrix of its real and imaginary parts.
At this point, it becomes important just how 'a' is assembled.
I anyone aware of other possible causes for this problem?
What is the order in which trial and test functions are called to build the matrix?
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Nico Schlömer for more information if necessary.