Segregated assembly of weak forms seems to be in trouble
Hello,
I have wanted to experiment with the assembly process, and the following gets actually done:
wf_a = -fr*(dot(Er, vr)+dot(Ei, vi))*dx + fi*(dot(Ei, vr) - dot(Er, vi))*dx + dot(curl(Er), curl(vr))*dx + dot(curl(Ei), curl(vi))*dx
ds = Measure(
n_v = FacetNormal(mesh)
d_exc = boundary_
r_v = Expression(
k_dir_c = Expression(
E0_c = Expression(
wf_a += dot(k0*cross(n_v, cross(n_v, Ei)), vr)*ds(d_exc)
wf_L = k0*dot(sin( k0*dot(k_dir_c, r_v) )*cross(n_v, cross(E0_c, k_dir_c-n_v)), vr)*ds(d_exc)
wf_a -= dot(k0*cross(n_v, cross(n_v, Er)), vi)*ds(d_exc)
wf_L += k0*dot(cos( k0*dot(k_dir_c, r_v) )*cross(n_v, cross(E0_c, k_dir_c-n_v)), vi)*ds(d_exc)
A_all, b_rhs = assemble_
whereas the following gets stuck in "Calling FFC just-in-time (JIT) compiler, this may take some time." while assembling the second matrix (it has been running for 10 minutes now and counting...):
wf_all = dot(curl(Er), curl(vr))*dx + dot(curl(Ei), curl(vi))*dx
wf_direc = -fr*(dot(Er, vr) + dot(Ei, vi))*dx
wf_cross = fi*(dot(Ei, vr) - dot(Er, vi))*dx
ds = Measure(
n_v = FacetNormal(mesh)
d_exc = boundary_
r_v = Expression(
k_dir_c = Expression(
E0_c = Expression(
wf_all += dot(k0*cross(n_v, cross(n_v, Ei)), vr)*ds(d_exc)
wf_rhs = k0*dot(sin( k0*dot(k_dir_c, r_v) )*cross(n_v, cross(E0_c, k_dir_c-n_v)), vr)*ds(d_exc)
wf_all -= dot(k0*cross(n_v, cross(n_v, Er)), vi)*ds(d_exc)
wf_rhs += k0*dot(cos( k0*dot(k_dir_c, r_v) )*cross(n_v, cross(E0_c, k_dir_c-n_v)), vi)*ds(d_exc)
A_all, b = assemble_
A_direc = assemble(wf_direc)
A_cross = assemble(wf_cross)
A_full = A_all + A_direc + A_cross
For context, I list the declaration of relevant entities:
element_type = "Nedelec 1st kind H(curl)"
element_order = 2
V_c = FunctionSpace(mesh, element_type, element_order)
V = MixedFunctionSp
Ef = TrialFunctions(V)
vf = TestFunctions(V)
Er, Ei = Ef[0], Ef[1]
vr, vi = vf[0], vf[1]
# Mark boundaries
boundaries = FacetFunction(
boundaries.
# Radiation boundaries
class RadiationBounda
def inside(self, x, on_boundary):
return on_boundary
radiation_bnd = RadiationBoundary()
radiation_
# Weak form Coefficient
fr = Function(
fi = Function(
Thank you!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was reopened
- by Luis Linares
Can you help with this problem?
Provide an answer of your own, or ask Luis Linares for more information if necessary.