Hi Wolfgang
The problem is that one can't assume that the data at the quadrature points has
the same structure as as the nodes. So in visco-elasticity we might store the
inelastic strain, while in plasticity we would store the accumulated plastic
strain. Both of these are second order tensors while the nodal variable is the
displacement (a first order tensor).
I've written two functions that take in a std::vector of first order or
symmetric second order tensor and then project them to the nodes using the
projection matrix obtained from
FETools::compute_projection_from_quadrature_points_matrix
This way you compute the projection_matrix once and can use it multiple times.
The size of the input vector of tensors at the quadrature points is the number
of quadrature points of the lhs.
The result is a std::vector of tensors where the size of the vector corresponds
to the number of nodes.
So you would use it as:
FETools::compute_projection_from_quadrature_points_matrix(fe_projection,
quadrature_formula_lhs,
quadrature_formula,
projection_matrix);
additional_fe_tools::
compute_projection_of_first_order_tensor_from_quadrature_points(projection_matrix,
test_first_order_tensor_qp,
// input vector of 1st order tensors
projected_first_order_tensors); // output vector of 1st order tensors
additional_fe_tools::
compute_projection_of_symmetric_second_order_tensor_from_quadrature_points(
projection_matrix,
test_second_order_tensor_qp, // input
vector of 2nd order tensors
projected_second_order_tensors); //
output vector of 2nd order tensors
I've written some test code that I'll send you.
Regards
Andrew
On 02 Jul 2010, at 2:27 PM, Wolfgang Bangerth wrote:
>
> Andrew,
>
>> I'm not sure this is worth considering adding to deal.ii, but i wrote two
>> functions (attached) that project first-order and symmetric second-order
>> tensors from quadrature points to the nodes of the cell. They are the
>> extension that is proposed in step-18 for dealing with problems where
>> history variables are stored at quadrature points.
>
> I haven't looked at your code yet since you said in a later mail that you
> weren't happy with it, but in general: I think the extension to vector valued
> functions would be a useful extension. I envision that one would modify the
> existing function in the following way, keeping the same interface:
>
> - if the finite element has, say, N vector components, then it is assumed
> that
> in each quadrature point of rhs_quadrature there are also N pieces of data
> arranged in the same order as the components of the finite element
>
> - when all the pieces of data are arranged in the long vector with which to
> multiply X, let's introduce the convention that first come all N values in
> quadrature point 0, then all N values in quadrature point 1, etc. (If you
> prefer the other ordering that's fine too, it just needs to be stated in the
> documentation.) The ordering in the output vector is already defined by the
> natural ordering within the finite element which can be queried by the
> FiniteElement::system_to_component function, for example.
>
> - to extend the existing function, you then just need to rewrite the
> computation of the matrices M and Q. M is obvious, and if you want you can
> take a look at the function MatrixTrools::create_mass_matrix, for example. Q
> will be similar to what it is already except that you have to repeat
> quadrature points N times each.
>
> - computing the matrix X remains unchanged.
>
> Let me know if this makes sense and/or if you need help with something.
>
> Best
> W.
>
> -------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> www: http://www.math.tamu.edu/~bangerth/
>
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii