 Reference documentation for deal.II version 9.3.0
FEValuesExtractors Namespace Reference

Classes

struct  Scalar

struct  SymmetricTensor

struct  Tensor

struct  Vector

Detailed Description

A namespace in which we declare "extractors", i.e. classes that when used as subscripts in operator[] expressions on FEValues, FEFaceValues, and FESubfaceValues objects extract certain components of a vector-valued element. The result of applying an extractor to these objects is an object with corresponding type from the namespace FEValuesViews. There are extractors for single scalar components, vector components consisting of dim elements, and second order symmetric tensors consisting of (dim*dim + dim)/2 components, as well as second order nonsymmetric tensors.

One can think of extractors as the equivalent of an index, or an index range. In the case of scalar extractors (i.e., the FEValuesExtractors::Scalar class), creating an object like (see step-20 for this use)

const FEValuesExtractors::Scalar pressure(dim);

can be thought of as creating a single index with value dim. By itself, an index does not know what it is an index to, so it takes the equivalent of an array to extract anything. Consequently, assume that there is a finite element with at least dim+1 vector components (as indeed there is in step-20), and an FEValues object that operates on it, then writing

fe_values[pressure]

results in an object that represents the shape functions of only the dimth component of the overall element. In the example, these would be the values of the pressure shape functions, or more precisely: the (scalar) pressure values of all shape functions (even for shape functions that are not associated with the pressure, but for example the velocity). In the example above, the result of using operator[] on the fe_values object as shown is of type FEValuesViews::Scalar.

Likewise, when using

const FEValuesExtractors::Vector velocities(0);

then the object so created can be thought of as an index range, starting at zero and extending exactly dim components on. In Matlab notation, one could write this as 0:dim-1. Then, writing

fe_values[velocities]

will result in an object that represents the values of a subset of exactly dim vector components of the overall finite element, in much the same way as writing array(3:7) in Matlab would return an array of length 5 that has been extracted from the original array by looking at indices 3 through 7 (inclusive).

See the description of the Handling vector valued problems module for examples how to use the features of this namespace.