Konrad,
> yes the mesh is quite coarse, but I want to investigate the functionality of
> how deal.ii outputs stresses and how these stresses are then displayed via for
> instance paraview. To really see the effects I intentionally use the coarse mesh.
> So far, I actually do create a (derived) DataPostprocessor-Object (see the
> thinned out and altered step-8 tutorial attached to this message) similar to
> the procedure in step-32. You wrote, that the gradients are computed at the
> vertices. How so? If I look at line 291 of my code or at step-32, there is a
> loop over all quadrature points (
> for(unsignedintq=0;q<n_quadrature_points;++q)Ā ) which gets called for every
> cell.
Well, there is a loop over all of the evaluation points for which DataOut
gives your function the solution. In that function, you *call* these
quadrature points, but they are just some evaluation points, unrelated to what
you use when you compute integrals.
> In the scope of this loop the shape function gradients at the quadrature
> points are used to compute the desired output variable by a special
> calculation rule. However, these are not the vertices. If the gradients are
> somehow again computed at the vertices, which might be an internal procedure
> of the DataPostprocessor-functionality of dealii, how would this procedure
> know what the special calculation rule of the desired output would look like?
Can you clarify this question? What are the "special rules"?
> Concerning your second note, thanks for pointing me in the direction ofĀ the
> Zienkiewicz-Zhu recovery procedure. The procedure is straightforward to me,
> however its implementation in deal.ii not (yet). There are some functions like
> the VectorTools::project()Ā function, which is supposed to give a L2-projections.
> However, I am not quite sure how to use them. Therefore I tried to implement
> the Ā Zienkiewicz-Zhu recovery procedure myself. But there is a fundamental
> problem I could not solve so far. In elasticity problems for 2D or 3D we have
> a vector-valued solution. Therefore, in 2D for a triangulation with n Nodes we
> have 2n DoFs. If I want to add the projected scalar function (e.g. the mises
> stress) in form of a command like
>
> data_out.add_data_vector(mises_stress_recovery,"mises_recovery");
>
> to the output, there is the problem that the mises_stress_recoveryĀ vector only
> has a dimension of n, where as data_out wants a vector of dimension 2n. How to
> deal with that issue?
The ZZ procedure creates a finite element field that represents the stress (or
one of its invariants). You need to say what finite element you want to use
for this, and create a DoFHandler to represent it. You do this here:
> I tried to generate a new dof_handler via
> DoFHandler<dim> dof_handler_recovery(this->triangulation);
> FESystem<dim> fe_recovery(FE_Q<dim>(this->fe_degree),1);// here dim=1 since we
> only have on dof per node
> MappingQ<dim> mapping_recovery(this->fe_degree);
> AffineConstraints<double> constraints_recovery;
> dof_handler_recovery.distribute_dofs(fe_recovery);
>
> and then assemble a mass matrix and a rhs to solve for the
> mises_stress_recoveryĀ vector. However, when looping over the cells, I am not
> sure how to reference to the cells. Should I use the cells of the newly
> created DoFHandler via
> for(constauto&cell :dof_handler_recovery.active_cell_iterators())
> or via the DoFHandler of the original problem solution via
> for(constauto&cell :dof_handler.active_cell_iterators()).
You have to have both. When you integrate over shape functions of the
recovered stress, you need to loop over the cells of dof_handler_recovery.
Where you need to evaluate the original solution, you need a cell of
dof_handler. There are functions that allow you to convert an iterator for a
cell to one DoFHandler to the corresponding iterator for a cell to another
DoFHandler.
> Do I really have to create a new DoFHandler? If not, how would one assemble
> the mass matrix, since for that we need the an local_dof_indices object like
> std::vector<types::global_dof_index>Ā that points only to every second dof
> index or so.
> I would be grateful for some tips or directions.
If you don't want to use a different DoFHandler, then you need to add another
scalar field to the finite element system you are already using for the
original DoFHandler. That of course has consequences for the size of the
linear systems you build, so that may or may not be simpler.