deal.II version GIT relicensing-1936-ge55124254b 2024-10-04 21:10:00+00:00
|
#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 = typename ViewType::template solution_value_type< Number > |
template<typename Number > | |
using | solution_gradient_type = typename ViewType::template solution_gradient_type< Number > |
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 RenumberingData & | data |
const ViewType & | view |
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.
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.
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.
using FEValuesViews::RenumberedView< ViewType >::solution_value_type = typename ViewType::template solution_value_type<Number> |
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.
using FEValuesViews::RenumberedView< ViewType >::solution_gradient_type = typename ViewType::template solution_gradient_type<Number> |
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.
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).
view | The underlying FEValuesViews object. |
data | A RenumberingData object, containing renumbering information. |
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.
shape_function | Number 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_point | Number 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. |
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_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.
shape_function | Number 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_point | Number 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. |
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. 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).
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. 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.
[in] | dof_values | A vector of local nodal values. This vector must have a length equal to the size of the dof renumbering vector. |
[out] | values | A vector of values of the given finite element field, at the renumbered quadrature points on the current object. |
InputVector | The InputVector type must allow creation of an ArrayView object from it; this is satisfied by the std::vector class, among others. |
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. 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).
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. 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.
[in] | dof_values | A vector of local nodal values. This vector must have a length equal to the size of the dof renumbering vector. |
[out] | gradients | A vector of gradients of the given finite element field, at the renumbered quadrature points on the current object. |
InputVector | The InputVector type must allow creation of an ArrayView object from it; this is satisfied by the std::vector class, among others. |
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.
|
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
|
private |
Produce an inner vector compatible with the inner view, after copying the values with the correct numbering from the outer vector.
|
private |
Produce an inner vector compatible with the inner view, and zero out its entries if necessary.
|
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.
|
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.
|
private |
Store a reference to the underlying view.
Definition at line 405 of file fe_coupling_values.h.