Reference documentation for deal.II version 9.6.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
FEValuesViews::RenumberedView< ViewType > Class Template Reference

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

Public Types

using value_type = typename ViewType::value_type
 
using gradient_type = typename ViewType::gradient_type
 
template<typename Number >
using solution_value_type
 
template<typename Number >
using solution_gradient_type
 

Public Member Functions

 RenumberedView (const ViewType &view, const RenumberingData &data)
 
value_type value (const unsigned int shape_function, const unsigned int q_point) const
 
gradient_type gradient (const unsigned int shape_function, const unsigned int q_point) const
 
template<typename Number >
void get_function_values (const ReadVector< Number > &fe_function, std::vector< solution_value_type< Number > > &values) const
 
template<class InputVector >
void get_function_values_from_local_dof_values (const InputVector &dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
 
template<typename Number >
void get_function_gradients (const ReadVector< Number > &fe_function, std::vector< solution_gradient_type< Number > > &gradients) const
 
template<class InputVector >
void get_function_gradients_from_local_dof_values (const InputVector &dof_values, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
 

Private Member Functions

template<typename Number >
std::string get_unique_container_name (const std::string &prefix, const unsigned int size, const Number &exemplar_number) const
 
template<typename InputVector >
const InputVector & outer_to_inner_dofs (const InputVector &outer_vector) const
 
template<typename ValueType >
std::vector< ValueType > & outer_to_inner_values (std::vector< ValueType > &outer_values) const
 
template<typename ValueType >
void inner_to_outer_values (const std::vector< ValueType > &inner_values, std::vector< ValueType > &outer_values) const
 

Private Attributes

const RenumberingDatadata
 
const ViewType & view
 

Detailed Description

template<typename ViewType>
class FEValuesViews::RenumberedView< ViewType >

A class that provides a renumbered view to a given FEValuesViews object.

In general, the order of the degrees of freedom and quadrature points follows the one of the FEValues object, which itself uses the numbering provided by the FiniteElement and Quadrature objects it uses. However, in some cases, it is convenient to group together degrees of freedom and quadrature points in a different order, to select only a subset of the degrees of freedom, or to combine two different sets of degrees of freedom together. This class provides a view to a given FEValuesViews object, where the degrees of freedom and quadrature points are renumbered according to the given RenumberingData object (see there for a documentation of how the renumbering is interpreted).

Users will typically not use this class directly, but rather pass an extractor from the FEValuesExtractors namespace to the FECouplingValues class, which returns an object of this type. This is the same mechanism used in the FEValues classes, where passing an extractor returns an FEValuesViews object, and the user rarely instantiates an object of this type.

Definition at line 169 of file fe_coupling_values.h.

Member Typedef Documentation

◆ value_type

template<typename ViewType >
using FEValuesViews::RenumberedView< ViewType >::value_type = typename ViewType::value_type

An alias for the data type of values of the underlying view.

Definition at line 175 of file fe_coupling_values.h.

◆ gradient_type

template<typename ViewType >
using FEValuesViews::RenumberedView< ViewType >::gradient_type = typename ViewType::gradient_type

An alias for the data type of gradients of the underlying view.

Definition at line 180 of file fe_coupling_values.h.

◆ solution_value_type

template<typename ViewType >
template<typename Number >
using FEValuesViews::RenumberedView< ViewType >::solution_value_type
Initial value:
typename ViewType::template solution_value_type<Number>
typename ViewType::template solution_value_type< Number > solution_value_type

An alias for the data type of the product of a Number and the values of the underlying view type.

Definition at line 187 of file fe_coupling_values.h.

◆ solution_gradient_type

template<typename ViewType >
template<typename Number >
using FEValuesViews::RenumberedView< ViewType >::solution_gradient_type
Initial value:
typename ViewType::template solution_gradient_type<Number>
typename ViewType::template solution_gradient_type< Number > solution_gradient_type

An alias for the data type of the product of a Number and the gradients of the underlying view type.

Definition at line 195 of file fe_coupling_values.h.

Constructor & Destructor Documentation

◆ RenumberedView()

template<typename ViewType >
FEValuesViews::RenumberedView< ViewType >::RenumberedView ( const ViewType & view,
const RenumberingData & data )

Construct a new RenumberedView object.

The renumbering information is taken from the class RenumberingData (see there for a documentation of how the renumbering is interpreted).

Note
The renumbering information is stored as a reference in this object, so you have to make sure that the RenumberingData object lives longer than this object.
Parameters
viewThe underlying FEValuesViews object.
dataA RenumberingData object, containing renumbering information.

Member Function Documentation

◆ value()

template<typename ViewType >
value_type FEValuesViews::RenumberedView< ViewType >::value ( const unsigned int shape_function,
const unsigned int q_point ) const

Return the value of the underlying view, for the shape function and quadrature point selected by the arguments.

Parameters
shape_functionNumber of the shape function to be evaluated. Note that this number runs from zero to size of the renumbering vector provided at construction time, or to dofs_per_cell, if the renumbering vector is empty.
q_pointNumber of the quadrature point at which the function is to be evaluated. Note that this number runs from zero to the size of the renumbering vector provided at construction time, or to n_quadrature_points, if the renumbering vector is empty.
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.

◆ gradient()

template<typename ViewType >
gradient_type FEValuesViews::RenumberedView< ViewType >::gradient ( const unsigned int shape_function,
const unsigned int q_point ) const

Return the gradient of the underlying view, for the shape function and quadrature point selected by the arguments.

Parameters
shape_functionNumber of the shape function to be evaluated. This number runs from zero to size of the renumbering vector provided at construction time, or to dofs_per_cell, if the renumbering vector is empty.
q_pointNumber of the quadrature point at which the function is to be evaluated. This number runs from zero to the size of the renumbering vector provided at construction time, or to n_quadrature_points, if the renumbering vector is empty.
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.

◆ get_function_values()

template<typename ViewType >
template<typename Number >
void FEValuesViews::RenumberedView< ViewType >::get_function_values ( const ReadVector< Number > & fe_function,
std::vector< solution_value_type< Number > > & values ) const

Return the values of the underlying view characterized by fe_function at the renumbered quadrature points.

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

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.

◆ get_function_values_from_local_dof_values()

template<typename ViewType >
template<class InputVector >
void FEValuesViews::RenumberedView< ViewType >::get_function_values_from_local_dof_values ( const InputVector & dof_values,
std::vector< solution_value_type< typename InputVector::value_type > > & values ) const

Same as above, but using a vector of renumbered local degree-of-freedom values. In other words, instead of extracting the nodal values of the degrees of freedom located on the current cell from a global vector associated with a DoFHandler object (as the function above does), this function instead takes these local nodal values through its first argument.

Parameters
[in]dof_valuesA vector of local nodal values. This vector must have a length equal to the size of the dof renumbering vector.
[out]valuesA vector of values of the given finite element field, at the renumbered quadrature points on the current object.
Template Parameters
InputVectorThe InputVector type must allow creation of an ArrayView object from it; this is satisfied by the std::vector class, among others.
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.

◆ get_function_gradients()

template<typename ViewType >
template<typename Number >
void FEValuesViews::RenumberedView< ViewType >::get_function_gradients ( const ReadVector< Number > & fe_function,
std::vector< solution_gradient_type< Number > > & gradients ) const

Return the gradients of the underlying view characterized by fe_function at the renumbered quadrature points.

This function is the equivalent of the FEValuesBase::get_function_gradients function but it only works on the selected view.

The data type stored by the output vector must be what you get when you multiply the gradients of shape functions (i.e., value_type) times the type used to store the gradients 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.

◆ get_function_gradients_from_local_dof_values()

template<typename ViewType >
template<class InputVector >
void FEValuesViews::RenumberedView< ViewType >::get_function_gradients_from_local_dof_values ( const InputVector & dof_values,
std::vector< solution_gradient_type< typename InputVector::value_type > > & gradients ) const

Same as above, but using a vector of renumbered local degree-of-freedom gradients. In other words, instead of extracting the nodal values of the degrees of freedom located on the current cell from a global vector associated with a DoFHandler object (as the function above does), this function instead takes these local nodal values through its first argument.

Parameters
[in]dof_valuesA vector of local nodal values. This vector must have a length equal to the size of the dof renumbering vector.
[out]gradientsA vector of gradients of the given finite element field, at the renumbered quadrature points on the current object.
Template Parameters
InputVectorThe InputVector type must allow creation of an ArrayView object from it; this is satisfied by the std::vector class, among others.
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.

◆ get_unique_container_name()

template<typename ViewType >
template<typename Number >
std::string FEValuesViews::RenumberedView< ViewType >::get_unique_container_name ( const std::string & prefix,
const unsigned int size,
const Number & exemplar_number ) const
private

Helper function that constructs a unique name for a container, based on a string prefix, on its size, and on the type stored in the container.

When the renumbering vectors are non empty, this class may need to construct temporary vectors to store the values of the solution and/or of its gradients with the sizes given by the underlying view object. Unfortunately, we don't know before hand the Number types with which the vectors will be instantiated, so we cannot use a simple cache internally, and we use a GeneralDataStorage object to avoid allocating memory at each call.

This function constructs a unique name for temporary containers that will be stored upon the first request in the internal GeneralDataStorage object, to access the

◆ outer_to_inner_dofs()

template<typename ViewType >
template<typename InputVector >
const InputVector & FEValuesViews::RenumberedView< ViewType >::outer_to_inner_dofs ( const InputVector & outer_vector) const
private

Produce an inner vector compatible with the inner view, after copying the values with the correct numbering from the outer vector.

◆ outer_to_inner_values()

template<typename ViewType >
template<typename ValueType >
std::vector< ValueType > & FEValuesViews::RenumberedView< ViewType >::outer_to_inner_values ( std::vector< ValueType > & outer_values) const
private

Produce an inner vector compatible with the inner view, and zero out its entries if necessary.

◆ inner_to_outer_values()

template<typename ViewType >
template<typename ValueType >
void FEValuesViews::RenumberedView< ViewType >::inner_to_outer_values ( const std::vector< ValueType > & inner_values,
std::vector< ValueType > & outer_values ) const
private

Return the outer argument renumbered according to the quadrature renumbering. The values in the inner values are copied to the right position in the outer vector.

Member Data Documentation

◆ data

template<typename ViewType >
const RenumberingData& FEValuesViews::RenumberedView< ViewType >::data
private

The data structure that stores the renumbering of the degrees of freedom and of the quadrature points.

Definition at line 351 of file fe_coupling_values.h.

◆ view

template<typename ViewType >
const ViewType& FEValuesViews::RenumberedView< ViewType >::view
private

Store a reference to the underlying view.

Definition at line 405 of file fe_coupling_values.h.


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