Reference documentation for deal.II version 9.4.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\}}\)
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType > Class Template Reference
Inheritance diagram for NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >:
[legend]

Public Types

using time_type = typename FunctionTime< typename numbers::NumberTraits< RangeNumberType >::real_type >::time_type
 

Public Member Functions

 RefSpaceFEFieldFunction (const DoFHandler< dim > &dof_handler, const VectorType &dof_values)
 
void set_active_cell (const typename Triangulation< dim >::active_cell_iterator &cell) override
 
double value (const Point< dim > &point, const unsigned int component=0) const override
 
Tensor< 1, dim > gradient (const Point< dim > &point, const unsigned int component=0) const override
 
SymmetricTensor< 2, dim > hessian (const Point< dim > &point, const unsigned int component=0) const override
 
virtual void vector_value (const Point< dim > &p, Vector< RangeNumberType > &values) const
 
virtual void value_list (const std::vector< Point< dim > > &points, std::vector< RangeNumberType > &values, const unsigned int component=0) const
 
virtual void vector_value_list (const std::vector< Point< dim > > &points, std::vector< Vector< RangeNumberType > > &values) const
 
virtual void vector_values (const std::vector< Point< dim > > &points, std::vector< std::vector< RangeNumberType > > &values) const
 
virtual void vector_gradient (const Point< dim > &p, std::vector< Tensor< 1, dim, RangeNumberType > > &gradients) const
 
virtual void gradient_list (const std::vector< Point< dim > > &points, std::vector< Tensor< 1, dim, RangeNumberType > > &gradients, const unsigned int component=0) const
 
virtual void vector_gradients (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim, RangeNumberType > > > &gradients) const
 
virtual void vector_gradient_list (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim, RangeNumberType > > > &gradients) const
 
virtual RangeNumberType laplacian (const Point< dim > &p, const unsigned int component=0) const
 
virtual void vector_laplacian (const Point< dim > &p, Vector< RangeNumberType > &values) const
 
virtual void laplacian_list (const std::vector< Point< dim > > &points, std::vector< RangeNumberType > &values, const unsigned int component=0) const
 
virtual void vector_laplacian_list (const std::vector< Point< dim > > &points, std::vector< Vector< RangeNumberType > > &values) const
 
virtual void vector_hessian (const Point< dim > &p, std::vector< SymmetricTensor< 2, dim, RangeNumberType > > &values) const
 
virtual void hessian_list (const std::vector< Point< dim > > &points, std::vector< SymmetricTensor< 2, dim, RangeNumberType > > &values, const unsigned int component=0) const
 
virtual void vector_hessian_list (const std::vector< Point< dim > > &points, std::vector< std::vector< SymmetricTensor< 2, dim, RangeNumberType > > > &values) const
 
virtual std::size_t memory_consumption () const
 
numbers::NumberTraits< double >::real_type get_time () const
 
virtual void set_time (const numbers::NumberTraits< double >::real_type new_time)
 
virtual void advance_time (const numbers::NumberTraits< double >::real_type delta_t)
 

Public Attributes

const unsigned int n_components
 

Static Public Attributes

static constexpr unsigned int dimension = dim
 

Private Member Functions

bool cell_is_set () const
 

Private Attributes

const SmartPointer< const DoFHandler< dim > > dof_handler
 
const SmartPointer< const VectorType > global_dof_values
 
SmartPointer< const FiniteElement< dim > > element
 
std::vector< types::global_dof_indexlocal_dof_indices
 
std::vector< typename VectorType::value_type > local_dof_values
 
std::vector< Polynomials::Polynomial< double > > poly
 
std::vector< unsigned intrenumber
 
bool polynomials_are_hat_functions
 
numbers::NumberTraits< double >::real_type time
 

Subscriptor functionality

Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class.

std::atomic< unsigned intcounter
 
std::map< std::string, unsigned intcounter_map
 
std::vector< std::atomic< bool > * > validity_pointers
 
const std::type_info * object_info
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
unsigned int n_subscriptions () const
 
template<typename StreamType >
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
void check_no_subscribers () const noexcept
 
using map_value_type = decltype(counter_map)::value_type
 
using map_iterator = decltype(counter_map)::iterator
 
static std::mutex mutex
 
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 

Detailed Description

template<int dim, class VectorType = Vector<double>>
class NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >

This class evaluates a function defined by a solution vector and a DoFHandler transformed to reference space. To be precise, if we let \(\hat{x}\) be a point on the reference cell, this class implements the function

\(\hat{f}(\hat{x}) = \sum_{j=0}^{n-1} f_j \hat{\phi}_j(\hat{x})\),

where \(f_j\) are the local solution values and \(\hat{\phi}_j(\hat(x))\) are the local reference space shape functions. The gradient and Hessian of this function are thus derivatives with respect to the reference space coordinates, \(\hat{x}_0, \hat{x}_1, \ldots\).

Note that this class is similar to FEFieldFunction, but that FEFieldFunction implements the following function on a given cell, \(K\),

\(f(x) = \sum_{j=0}^{n-1} f_j \hat{\phi}_j(F_K^{-1}(x))\),

which has the same coefficients but uses real space basis functions. Here, \(F_K\) is the mapping from the reference cell to the real cell.

Before calling the value/gradient/hessian function, the set_active_cell function must be called to specify which cell the function should be evaluated on.

Definition at line 1312 of file quadrature_generator.cc.

Member Typedef Documentation

◆ time_type

template<int dim, typename RangeNumberType = double>
using Function< dim, RangeNumberType >::time_type = typename FunctionTime< typename numbers::NumberTraits<RangeNumberType>::real_type>::time_type
inherited

The scalar-valued real type used for representing time.

Definition at line 169 of file function.h.

Constructor & Destructor Documentation

◆ RefSpaceFEFieldFunction()

template<int dim, class VectorType >
NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::RefSpaceFEFieldFunction ( const DoFHandler< dim > &  dof_handler,
const VectorType &  dof_values 
)

Constructor. Takes the solution vector and the associated DoFHandler.

Pointers to the input arguments are stored internally, so they must have a longer lifetime than the created RefSpaceFEFieldFunction object.

Definition at line 1421 of file quadrature_generator.cc.

Member Function Documentation

◆ set_active_cell()

template<int dim, class VectorType >
void NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::set_active_cell ( const typename Triangulation< dim >::active_cell_iterator &  cell)
overridevirtual

Set the cell that the function should be evaluated on.

Implements NonMatching::internal::DiscreteQuadratureGeneratorImplementation::CellWiseFunction< dim >.

Definition at line 1435 of file quadrature_generator.cc.

◆ value()

template<int dim, class VectorType >
double NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::value ( const Point< dim > &  point,
const unsigned int  component = 0 
) const
overridevirtual

Return the value of the function at the given point. Unless there is only one component (i.e. the function is scalar), you should state the component you want to have evaluated; it defaults to zero, i.e. the first component.

Note
The set_active_cell function must be called before this function. The incoming point should be on the reference cell, but this is not checked.

Reimplemented from Function< dim, RangeNumberType >.

Definition at line 1509 of file quadrature_generator.cc.

◆ gradient()

template<int dim, class VectorType >
Tensor< 1, dim > NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::gradient ( const Point< dim > &  point,
const unsigned int  component = 0 
) const
overridevirtual

Return the gradient of the specified component of the function at the given point.

Note
The set_active_cell function must be called before this function. The incoming point should be on the reference cell, but this is not checked.

Reimplemented from Function< dim, RangeNumberType >.

Definition at line 1542 of file quadrature_generator.cc.

◆ hessian()

template<int dim, class VectorType >
SymmetricTensor< 2, dim > NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::hessian ( const Point< dim > &  point,
const unsigned int  component = 0 
) const
overridevirtual

Compute the Hessian of a given component at point p, that is the gradient of the gradient of the function.

Note
The set_active_cell function must be called before this function. The incoming point should be on the reference cell, but this is not checked.

Reimplemented from Function< dim, RangeNumberType >.

Definition at line 1575 of file quadrature_generator.cc.

◆ cell_is_set()

template<int dim, class VectorType >
bool NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::cell_is_set
private

Return whether the set_active_cell function has been called.

Definition at line 1498 of file quadrature_generator.cc.

◆ vector_value()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_value ( const Point< dim > &  p,
Vector< RangeNumberType > &  values 
) const
virtualinherited

Return all components of a vector-valued function at a given point.

values shall have the right size beforehand, i.e. n_components.

The default implementation will call value() for each component.

Reimplemented in Functions::ConstantFunction< dim, double >, and Functions::FEFieldFunction< dim, VectorType, spacedim >.

◆ value_list()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::value_list ( const std::vector< Point< dim > > &  points,
std::vector< RangeNumberType > &  values,
const unsigned int  component = 0 
) const
virtualinherited

Set values to the point values of the specified component of the function at the points. It is assumed that values already has the right size, i.e. the same size as the points array.

By default, this function repeatedly calls value() for each point separately, to fill the output array.

Reimplemented in Functions::ConstantFunction< dim, double >, and Functions::FEFieldFunction< dim, VectorType, spacedim >.

◆ vector_value_list()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_value_list ( const std::vector< Point< dim > > &  points,
std::vector< Vector< RangeNumberType > > &  values 
) const
virtualinherited

Set values to the point values of the function at the points. It is assumed that values already has the right size, i.e. the same size as the points array, and that all elements be vectors with the same number of components as this function has.

By default, this function repeatedly calls vector_value() for each point separately, to fill the output array.

Reimplemented in Functions::ConstantFunction< dim, double >, and Functions::FEFieldFunction< dim, VectorType, spacedim >.

◆ vector_values()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_values ( const std::vector< Point< dim > > &  points,
std::vector< std::vector< RangeNumberType > > &  values 
) const
virtualinherited

For each component of the function, fill a vector of values, one for each point.

The default implementation of this function in Function calls value_list() for each component. In order to improve performance, this can be reimplemented in derived classes to speed up performance.

◆ vector_gradient()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_gradient ( const Point< dim > &  p,
std::vector< Tensor< 1, dim, RangeNumberType > > &  gradients 
) const
virtualinherited

Return the gradient of all components of the function at the given point.

Reimplemented in Functions::ConstantFunction< dim, double >, and Functions::FEFieldFunction< dim, VectorType, spacedim >.

◆ gradient_list()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::gradient_list ( const std::vector< Point< dim > > &  points,
std::vector< Tensor< 1, dim, RangeNumberType > > &  gradients,
const unsigned int  component = 0 
) const
virtualinherited

Set gradients to the gradients of the specified component of the function at the points. It is assumed that gradients already has the right size, i.e. the same size as the points array.

Reimplemented in Functions::FEFieldFunction< dim, VectorType, spacedim >, and Functions::ConstantFunction< dim, double >.

◆ vector_gradients()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_gradients ( const std::vector< Point< dim > > &  points,
std::vector< std::vector< Tensor< 1, dim, RangeNumberType > > > &  gradients 
) const
virtualinherited

For each component of the function, fill a vector of gradient values, one for each point.

The default implementation of this function in Function calls value_list() for each component. In order to improve performance, this can be reimplemented in derived classes to speed up performance.

◆ vector_gradient_list()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_gradient_list ( const std::vector< Point< dim > > &  points,
std::vector< std::vector< Tensor< 1, dim, RangeNumberType > > > &  gradients 
) const
virtualinherited

Set gradients to the gradients of the function at the points, for all components. It is assumed that gradients already has the right size, i.e. the same size as the points array.

The outer loop over gradients is over the points in the list, the inner loop over the different components of the function.

Reimplemented in Functions::FEFieldFunction< dim, VectorType, spacedim >, and Functions::ConstantFunction< dim, double >.

◆ laplacian()

template<int dim, typename RangeNumberType = double>
virtual RangeNumberType Function< dim, RangeNumberType >::laplacian ( const Point< dim > &  p,
const unsigned int  component = 0 
) const
virtualinherited

◆ vector_laplacian()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_laplacian ( const Point< dim > &  p,
Vector< RangeNumberType > &  values 
) const
virtualinherited

Compute the Laplacian of all components at point p and store them in values.

Reimplemented in Functions::FEFieldFunction< dim, VectorType, spacedim >.

◆ laplacian_list()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::laplacian_list ( const std::vector< Point< dim > > &  points,
std::vector< RangeNumberType > &  values,
const unsigned int  component = 0 
) const
virtualinherited

Compute the Laplacian of one component at a set of points.

Reimplemented in Functions::FEFieldFunction< dim, VectorType, spacedim >.

◆ vector_laplacian_list()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_laplacian_list ( const std::vector< Point< dim > > &  points,
std::vector< Vector< RangeNumberType > > &  values 
) const
virtualinherited

Compute the Laplacians of all components at a set of points.

Reimplemented in Functions::FEFieldFunction< dim, VectorType, spacedim >.

◆ vector_hessian()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_hessian ( const Point< dim > &  p,
std::vector< SymmetricTensor< 2, dim, RangeNumberType > > &  values 
) const
virtualinherited

Compute the Hessian of all components at point p and store them in values.

◆ hessian_list()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::hessian_list ( const std::vector< Point< dim > > &  points,
std::vector< SymmetricTensor< 2, dim, RangeNumberType > > &  values,
const unsigned int  component = 0 
) const
virtualinherited

Compute the Hessian of one component at a set of points.

◆ vector_hessian_list()

template<int dim, typename RangeNumberType = double>
virtual void Function< dim, RangeNumberType >::vector_hessian_list ( const std::vector< Point< dim > > &  points,
std::vector< std::vector< SymmetricTensor< 2, dim, RangeNumberType > > > &  values 
) const
virtualinherited

Compute the Hessians of all components at a set of points.

◆ memory_consumption()

template<int dim, typename RangeNumberType = double>
virtual std::size_t Function< dim, RangeNumberType >::memory_consumption ( ) const
virtualinherited

◆ get_time()

numbers::NumberTraits< double >::real_type FunctionTime< numbers::NumberTraits< double >::real_type >::get_time ( ) const
inherited

Return the value of the time variable.

◆ set_time()

virtual void FunctionTime< numbers::NumberTraits< double >::real_type >::set_time ( const numbers::NumberTraits< double >::real_type  new_time)
virtualinherited

Set the time to new_time, overwriting the old value.

◆ advance_time()

virtual void FunctionTime< numbers::NumberTraits< double >::real_type >::advance_time ( const numbers::NumberTraits< double >::real_type  delta_t)
virtualinherited

Advance the time by the given time step delta_t.

Member Data Documentation

◆ dof_handler

template<int dim, class VectorType = Vector<double>>
const SmartPointer<const DoFHandler<dim> > NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::dof_handler
private

Pointer to the DoFHandler passed to the constructor.

Definition at line 1375 of file quadrature_generator.cc.

◆ global_dof_values

template<int dim, class VectorType = Vector<double>>
const SmartPointer<const VectorType> NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::global_dof_values
private

Pointer to the vector of solution coefficients passed to the constructor.

Definition at line 1381 of file quadrature_generator.cc.

◆ element

template<int dim, class VectorType = Vector<double>>
SmartPointer<const FiniteElement<dim> > NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::element
private

Pointer to the element associated with the cell in the last call to set_active_cell().

Definition at line 1387 of file quadrature_generator.cc.

◆ local_dof_indices

template<int dim, class VectorType = Vector<double>>
std::vector<types::global_dof_index> NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::local_dof_indices
private

DOF-indices of the cell in the last call to set_active_cell()

Definition at line 1392 of file quadrature_generator.cc.

◆ local_dof_values

template<int dim, class VectorType = Vector<double>>
std::vector<typename VectorType::value_type> NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::local_dof_values
private

Local solution values of the cell in the last call to set_active_cell()

Definition at line 1398 of file quadrature_generator.cc.

◆ poly

template<int dim, class VectorType = Vector<double>>
std::vector<Polynomials::Polynomial<double> > NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::poly
private

Description of the 1D polynomial basis for tensor product elements used for the fast path of this class using tensor product evaluators.

Definition at line 1405 of file quadrature_generator.cc.

◆ renumber

template<int dim, class VectorType = Vector<double>>
std::vector<unsigned int> NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::renumber
private

Renumbering for the tensor-product evaluator in the fast path.

Definition at line 1410 of file quadrature_generator.cc.

◆ polynomials_are_hat_functions

template<int dim, class VectorType = Vector<double>>
bool NonMatching::internal::DiscreteQuadratureGeneratorImplementation::RefSpaceFEFieldFunction< dim, VectorType >::polynomials_are_hat_functions
private

Check whether the shape functions are linear.

Definition at line 1415 of file quadrature_generator.cc.

◆ dimension

template<int dim, typename RangeNumberType = double>
constexpr unsigned int Function< dim, RangeNumberType >::dimension = dim
staticconstexprinherited

Export the value of the template parameter as a static member constant. Sometimes useful for some expression template programming.

Definition at line 159 of file function.h.

◆ n_components

template<int dim, typename RangeNumberType = double>
const unsigned int Function< dim, RangeNumberType >::n_components
inherited

Number of vector components.

Definition at line 164 of file function.h.

◆ time

numbers::NumberTraits< double >::real_type FunctionTime< numbers::NumberTraits< double >::real_type >::time
privateinherited

Store the present time.

Definition at line 113 of file function_time.h.


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