Thanks for the quick response.
The approach you suggest makes complete sense. Slip denotes the amount of slip
on a slip system defined by a shear direction \bs and with normal \bm. Assuming
we have n_slip number slip systems then the plastic deformation \bvarepsilon^p
is assumed to be additively composed from the contribution from all active
slip systems as:
\bvarepsilon^p = \sum_alpha^n_slip \gamma^alpha \bs^alpha \otimes \bm^alpha
The slips should be treated as scalars as we will need to calculate gradients
and Laplacians thereof in the non-local theory.
I have implemented the solution you suggest whereby I construct a std::vector
of FEValuesExtractors::Scalar for treating the shape functions associated with
the slip systems.
const FEValuesExtractors::Vector displacements(0);
std::vector<FEValuesExtractors::Scalar> slips;
for (unsigned int alpha = 0; alpha < no_slips; alpha++) {
const unsigned int count = deal_II_dimension + alpha;
slips.push_back(FEValuesExtractors::Scalar(count));
}
The problem is I get the following error (associated with the line containing
the push_back)
/home/andrew/software/deal.II/deal.II/include/fe/fe_values.h: In member
function ‘dealii::FEValuesExtractors::Scalar&
dealii::FEValuesExtractors::Scalar::operator=(const
dealii::FEValuesExtractors::Scalar&)’:
/home/andrew/software/deal.II/deal.II/include/fe/fe_values.h:76:
instantiated from ‘void std::vector<_Tp,
_Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename
std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp,
_Alloc> >, const _Tp&) [with _Tp = dealii::FEValuesExtractors::Scalar, _Alloc
= std::allocator<dealii::FEValuesExtractors::Scalar>]’
/usr/include/c++/4.3/bits/stl_vector.h:694: instantiated from ‘void
std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp =
dealii::FEValuesExtractors::Scalar, _Alloc =
std::allocator<dealii::FEValuesExtractors::Scalar>]’
source/crystal_plasticity.cc:57: instantiated from here
/home/andrew/software/deal.II/deal.II/include/fe/fe_values.h:76: error: non-
static const member ‘const unsigned int
dealii::FEValuesExtractors::Scalar::component’, can't use default assignment
operator
/usr/include/c++/4.3/bits/vector.tcc: In member function ‘void
std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename
std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp,
_Alloc> >, const _Tp&) [with _Tp = dealii::FEValuesExtractors::Scalar, _Alloc
= std::allocator<dealii::FEValuesExtractors::Scalar>]’:
/usr/include/c++/4.3/bits/vector.tcc:299: note: synthesized method
‘dealii::FEValuesExtractors::Scalar&
dealii::FEValuesExtractors::Scalar::operator=(const
dealii::FEValuesExtractors::Scalar&)’ first required here
make[2]: *** [lib/3d/crystal_plasticity.g.o] Error 1
Any ideas?
Kind regards
Andrew
On Monday 15 December 2008 18:17:12 Wolfgang Bangerth wrote:
> > 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
_______________________________________________