Reference documentation for deal.II version 9.2.0
FEValuesViews::SymmetricTensor< 2, dim, spacedim > Class Template Reference

#include <deal.II/fe/fe_values.h>

Classes

struct  OutputType

struct  ShapeFunctionData

Public Types

using value_type = ::SymmetricTensor< 2, spacedim >

using divergence_type = ::Tensor< 1, spacedim >

Public Member Functions

SymmetricTensor ()

SymmetricTensor (const FEValuesBase< dim, spacedim > &fe_values_base, const unsigned int first_tensor_component)

SymmetricTensoroperator= (const SymmetricTensor< 2, dim, spacedim > &)=delete

value_type value (const unsigned int shape_function, const unsigned int q_point) const

divergence_type divergence (const unsigned int shape_function, const unsigned int q_point) const

template<class InputVector >
void get_function_values (const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const

template<class InputVector >
void get_function_values_from_local_dof_values (const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > &values) const

template<class InputVector >
void get_function_divergences (const InputVector &fe_function, std::vector< typename ProductType< divergence_type, typename InputVector::value_type >::type > &divergences) const

template<class InputVector >
void get_function_divergences_from_local_dof_values (const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::divergence_type > &divergences) const

Private Attributes

const SmartPointer< const FEValuesBase< dim, spacedim > > fe_values

const unsigned int first_tensor_component

std::vector< ShapeFunctionData > shape_function_data

Detailed Description

template<int dim, int spacedim> class FEValuesViews::SymmetricTensor< 2, dim, spacedim >

A class representing a view to a set of (dim*dim + dim)/2 components forming a symmetric second-order tensor from a vector-valued finite element. Views are discussed in the Handling vector valued problems module.

This class allows to query the value and divergence of (components of) shape functions and solutions representing symmetric tensors. The divergence of a symmetric tensor $$S_{ij}, 0\le i,j<\text{dim}$$ is defined as $$d_i = \sum_j \frac{\partial S_{ij}}{\partial x_j}, 0\le i<\text{dim}$$, which due to the symmetry of the tensor is also $$d_i = \sum_j \frac{\partial S_{ji}}{\partial x_j}$$. In other words, it due to the symmetry of $$S$$ it does not matter whether we apply the nabla operator by row or by column to get the divergence.

You get an object of this type if you apply a FEValuesExtractors::SymmetricTensor to an FEValues, FEFaceValues or FESubfaceValues object.

Definition at line 1260 of file fe_values.h.

◆ value_type

template<int dim, int spacedim>
 using FEValuesViews::SymmetricTensor< 2, dim, spacedim >::value_type = ::SymmetricTensor<2, spacedim>

An alias for the data type of values of the view this class represents. Since we deal with a set of (dim*dim + dim)/2 components (i.e. the unique components of a symmetric second-order tensor), the value type is a SymmetricTensor<2,spacedim>.

Definition at line 1269 of file fe_values.h.

◆ divergence_type

template<int dim, int spacedim>
 using FEValuesViews::SymmetricTensor< 2, dim, spacedim >::divergence_type = ::Tensor<1, spacedim>

An alias for the type of the divergence of the view this class represents. Here, for a set of (dim*dim + dim)/2 unique components of the finite element representing a symmetric second-order tensor, the divergence of course is a * Tensor<1,dim>.

See the general discussion of this class for a definition of the divergence.

Definition at line 1280 of file fe_values.h.

◆ SymmetricTensor() [1/2]

template<int dim, int spacedim>
 FEValuesViews::SymmetricTensor< 2, dim, spacedim >::SymmetricTensor ( )

Default constructor. Creates an invalid object.

Definition at line 348 of file fe_values.cc.

◆ SymmetricTensor() [2/2]

template<int dim, int spacedim>
 FEValuesViews::SymmetricTensor< 2, dim, spacedim >::SymmetricTensor ( const FEValuesBase< dim, spacedim > & fe_values_base, const unsigned int first_tensor_component )

Constructor for an object that represents (dim*dim + dim)/2 components of a FEValuesBase object (or of one of the classes derived from FEValuesBase), representing the unique components comprising a symmetric second- order tensor valued variable.

The second argument denotes the index of the first component of the selected symmetric second order tensor.

Definition at line 266 of file fe_values.cc.

◆ operator=()

template<int dim, int spacedim>
 SymmetricTensor& FEValuesViews::SymmetricTensor< 2, dim, spacedim >::operator= ( const SymmetricTensor< 2, dim, spacedim > & )
delete

Copy operator. This is not a lightweight object so we don't allow copying and generate a compile-time error if this function is called.

◆ value()

template<int dim, int spacedim>
 value_type FEValuesViews::SymmetricTensor< 2, dim, spacedim >::value ( const unsigned int shape_function, const unsigned int q_point ) const

Return the value of the vector components selected by this view, for the shape function and quadrature point selected by the arguments. Here, since the view represents a vector-valued part of the FEValues object with (dim*dim + dim)/2 components (the unique components of a symmetric second-order tensor), the return type is a symmetric tensor of rank 2.

Parameters
 shape_function Number of the shape function to be evaluated. Note that this number runs from zero to dofs_per_cell, even in the case of an FEFaceValues or FESubfaceValues object. q_point Number of the quadrature point at which function is to be evaluated.
Note
For this function to work properly, the underlying FEValues, FEFaceValues, or FESubfaceValues object on which you call it must have computed the information you are requesting. To do so, the update_values flag must be an element of the list of UpdateFlags that you passed to the constructor of this object. See The interplay of UpdateFlags, Mapping, and FiniteElement in FEValues for more information.

◆ divergence()

template<int dim, int spacedim>
 divergence_type FEValuesViews::SymmetricTensor< 2, dim, spacedim >::divergence ( const unsigned int shape_function, const unsigned int q_point ) const

Return the vector divergence of the vector components selected by this view, for the shape function and quadrature point selected by the arguments.

See the general discussion of this class for a definition of the divergence.

Note
The meaning of the arguments is as documented for the value() function.
For this function to work properly, the underlying FEValues, FEFaceValues, or FESubfaceValues object on which you call it must have computed the information you are requesting. To do so, the update_gradients flag must be an element of the list of UpdateFlags that you passed to the constructor of this object. See The interplay of UpdateFlags, Mapping, and FiniteElement in FEValues for more information.

◆ get_function_values()

template<int dim, int spacedim>
template<class InputVector >
 void FEValuesViews::SymmetricTensor< 2, dim, spacedim >::get_function_values ( const InputVector & fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > & values ) const

Return the values of the selected vector components of the finite element function characterized by fe_function at the quadrature points of the cell, face or subface selected the last time the reinit function of the FEValues object was called.

This function is the equivalent of the FEValuesBase::get_function_values function but it only works on the selected vector components.

The data type stored by the output vector must be what you get when you multiply the values of shape functions (i.e., value_type) times the type used to store the values of the unknowns $$U_j$$ of your finite element vector $$U$$ (represented by the fe_function argument).

Note
For this function to work properly, the underlying FEValues, FEFaceValues, or FESubfaceValues object on which you call it must have computed the information you are requesting. To do so, the update_values flag must be an element of the list of UpdateFlags that you passed to the constructor of this object. See The interplay of UpdateFlags, Mapping, and FiniteElement in FEValues for more information.

Definition at line 2304 of file fe_values.cc.

◆ get_function_values_from_local_dof_values()

template<int dim, int spacedim>
template<class InputVector >
 void FEValuesViews::SymmetricTensor< 2, dim, spacedim >::get_function_values_from_local_dof_values ( const InputVector & dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > & values ) const

Same as above, but using a vector of local degree-of-freedom values.

The dof_values vector must have a length equal to number of DoFs on a cell, and each entry dof_values[i] is the value of the local DoF i. The fundamental prerequisite for the InputVector is that it must be possible to create an ArrayView from it; this is satisfied by the std::vector class.

The DoF values typically would be obtained in the following way:

Vector<double> local_dof_values(cell->get_fe().dofs_per_cell);
cell->get_dof_values(solution, local_dof_values);

or, for a generic Number type,

std::vector<Number> local_dof_values(cell->get_fe().dofs_per_cell);
cell->get_dof_values(solution,
local_dof_values.begin(),
local_dof_values.end());

Definition at line 2335 of file fe_values.cc.

◆ get_function_divergences()

template<int dim, int spacedim>
template<class InputVector >
 void FEValuesViews::SymmetricTensor< 2, dim, spacedim >::get_function_divergences ( const InputVector & fe_function, std::vector< typename ProductType< divergence_type, typename InputVector::value_type >::type > & divergences ) const

Return the divergence of the selected vector components of the finite element function characterized by fe_function at the quadrature points of the cell, face or subface selected the last time the reinit function of the FEValues object was called.

There is no equivalent function such as FEValuesBase::get_function_divergences in the FEValues classes but the information can be obtained from FEValuesBase::get_function_gradients, of course.

See the general discussion of this class for a definition of the divergence.

The data type stored by the output vector must be what you get when you multiply the divergences of shape functions (i.e., divergence_type) times the type used to store the values of the unknowns $$U_j$$ of your finite element vector $$U$$ (represented by the fe_function argument).

Note
For this function to work properly, the underlying FEValues, FEFaceValues, or FESubfaceValues object on which you call it must have computed the information you are requesting. To do so, the update_gradients flag must be an element of the list of UpdateFlags that you passed to the constructor of this object. See The interplay of UpdateFlags, Mapping, and FiniteElement in FEValues for more information.

Definition at line 2360 of file fe_values.cc.

◆ get_function_divergences_from_local_dof_values()

template<int dim, int spacedim>
template<class InputVector >
 void FEValuesViews::SymmetricTensor< 2, dim, spacedim >::get_function_divergences_from_local_dof_values ( const InputVector & dof_values, std::vector< typename OutputType< typename InputVector::value_type >::divergence_type > & divergences ) const

Same as above, but using a vector of local degree-of-freedom values.

The dof_values vector must have a length equal to number of DoFs on a cell, and each entry dof_values[i] is the value of the local DoF i. The fundamental prerequisite for the InputVector is that it must be possible to create an ArrayView from it; this is satisfied by the std::vector class.

The DoF values typically would be obtained in the following way:

Vector<double> local_dof_values(cell->get_fe().dofs_per_cell);
cell->get_dof_values(solution, local_dof_values);

or, for a generic Number type,

std::vector<Number> local_dof_values(cell->get_fe().dofs_per_cell);
cell->get_dof_values(solution,
local_dof_values.begin(),
local_dof_values.end());

Definition at line 2393 of file fe_values.cc.

◆ fe_values

template<int dim, int spacedim>
 const SmartPointer > FEValuesViews::SymmetricTensor< 2, dim, spacedim >::fe_values
private

A pointer to the FEValuesBase object we operate on.

Definition at line 1510 of file fe_values.h.

◆ first_tensor_component

template<int dim, int spacedim>
 const unsigned int FEValuesViews::SymmetricTensor< 2, dim, spacedim >::first_tensor_component
private

The first component of the vector this view represents of the FEValuesBase object.

Definition at line 1516 of file fe_values.h.

◆ shape_function_data

template<int dim, int spacedim>
 std::vector FEValuesViews::SymmetricTensor< 2, dim, spacedim >::shape_function_data
private

Store the data about shape functions.

Definition at line 1521 of file fe_values.h.

The documentation for this class was generated from the following files: