dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #02683
Subfunctions
Hi,
I have some difficulties with the subfunction facility in Dolfin. I'm interested
in saving the normal and shear components of a stress function (in 3D) for post
processing purposes.
the stress function is initialised in this way:
stress.init(mesh, a_strain.trial());
and the trial element 'a_strain.trial()' is defined as:
elementB = FiniteElement("Discontinuous vector Lagrange", "tetrahedron", 0, 3)
elementC = FiniteElement("Discontinuous vector Lagrange", "tetrahedron", 0, 3)
strain_element = elementB + elementC
(wn,ws) = TrialFunctions(strain_element)
Now, when doing:
Function n_stress = stress[0];
Function s_stress = stress[1];
File file_normal_stress("normal_stress.pvd");
File file_shear_stress("shear_stress.pvd");
while( t < T)
{
nonlinear_solver.solve(nonlinear_problem, x);
n_stress = stress[0];
s_stress = stress[1];
file_normal_stress << n_stress;
file_shear_stress << s_stress;
}
the values of the two files are exactly the same as if only the first half of
stress.vector() is used as a basis for both subfunctions.
Funny thing is that a similar approach works fine in the elasticity demo. Only
difference is that in this case the strains are computed in FFC, where my
stresses are computed in the non-linear problem, on element level, and then
written into the stress.vector(). So, what am I doing wrong?
Regards,
Kristian
Follow ups