> A question concerning the implementation of a problem involving multiple
> degrees of freedom per node. I'm solving a problem in nonlocal crystal
> plasticity
Very cool :-)
> My questions concerns the use of the FEValuesExtractor class. I set up
> the extractors as follows:
> const FEValuesExtractors::Vector displacements(0);
> const FEValuesExtractors::Vector slips(deal_II_dimension);
A note up front before I go into details: Mathematics has the bad habit of
calling two things "vectors":
- a linear collection of elements used in linear algebra, in deal.II
represented by the Vector class (and in C++ by std::vector)
- a tensor of rank 1; tensors are geometric objects that rotate with
the coordinate system. In deal.II, these are Tensor<1,dim> or Point
(for rank-1 tensors = vectors) or Tensor<2,dim> for rank-2.
The FEValuesExtractors::Vector is meant to be a tensor of rank-1. I.e., it
represents a set of exactly 'dim' components where 'dim' is the space
dimension of the FEValues object it accesses. It is meant to access
components of a finite element that logically represent a vector-values
quantity such as velocities or displacements.
What this means in your case is that even if you have 12 slip variables,
doing fe_values[slips] is going to give you only the first 3 of those.
That's probably not what you wanted. I suppose what comes closer to what
you need is something like this:
std::vector<FEValuesExtractors::Scalar> slips;
for (unsigned int i=0; i<n_slips; ++i)
// add an extractor for the i'th slip; note that the first dim
// components are the displacements
slips.push_back (FEValuesExtractors::Scalar(dim+i));
and then if you want the shape functions for the i-th slip you can do
fe_values[slips[i]].value (shape_function, q_point);
Does that explain things a bit better?
As a side note: the way I explained it above you'd access the slip
variables as if they were a collection of n_slips scalar fields. This is
done because they're definitely not a rank-1 tensor. But in your
application, what are these slips really? The FEValuesExtractors are a way
to put a semantic meaning to the individual components of a finite element
(for example, when you use FEValuesExtractors::Vector(s) you say "the dim
components of the finite element starting at component s logically form a
rank-1 tensor such as a velocity or a displacement). It it definitely
possible to write other extractors for other logical structures such as
tensors of rank 2, or symmetric tensors, etc.
Best
Wolfgang
--
-------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.tamu.edu/~bangerth/
_______________________________________________