MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::QuadratureInterpolator Class Reference

A class that performs interpolation from an E-vector to quadrature point values and/or derivatives (Q-vectors). More...

#include <quadinterpolator.hpp>

Collaboration diagram for mfem::QuadratureInterpolator:
[legend]

Public Types

enum  EvalFlags { VALUES = 1 << 0 , DERIVATIVES = 1 << 1 , DETERMINANTS = 1 << 2 , PHYSICAL_DERIVATIVES = 1 << 3 }
 

Public Member Functions

 QuadratureInterpolator (const FiniteElementSpace &fes, const IntegrationRule &ir)
 
 QuadratureInterpolator (const FiniteElementSpace &fes, const QuadratureSpace &qs)
 
void DisableTensorProducts (bool disable=true) const
 Disable the use of tensor product evaluations, for tensor-product elements, e.g. quads and hexes. By default, tensor product evaluations are enabled.
 
void EnableTensorProducts () const
 Enable the use of tensor product evaluations, for tensor-product elements, e.g. quads and hexes. By default, this option is enabled.
 
bool UsesTensorProducts () const
 Query the current tensor product evaluation mode.
 
QVectorLayout GetOutputLayout () const
 Query the current output Q-vector layout. The default value is QVectorLayout::byNODES.
 
void SetOutputLayout (QVectorLayout layout) const
 Set the desired output Q-vector layout. The default value is QVectorLayout::byNODES.
 
void Mult (const Vector &e_vec, unsigned eval_flags, Vector &q_val, Vector &q_der, Vector &q_det) const
 Interpolate the E-vector e_vec to quadrature points.
 
void Values (const Vector &e_vec, Vector &q_val) const
 Interpolate the values of the E-vector e_vec at quadrature points.
 
void Derivatives (const Vector &e_vec, Vector &q_der) const
 Interpolate the derivatives (with respect to reference coordinates) of the E-vector e_vec at quadrature points.
 
void PhysDerivatives (const Vector &e_vec, Vector &q_der) const
 Interpolate the derivatives in physical space of the E-vector e_vec at quadrature points.
 
void Determinants (const Vector &e_vec, Vector &q_det) const
 Compute the determinants of the derivatives (with respect to reference coordinates) of the E-vector e_vec at quadrature points.
 
void MultTranspose (unsigned eval_flags, const Vector &q_val, const Vector &q_der, Vector &e_vec) const
 Perform the transpose operation of Mult(). (TODO)
 

Static Public Attributes

static const int MAX_NQ2D = 100
 
static const int MAX_ND2D = 100
 
static const int MAX_VDIM2D = 3
 
static const int MAX_NQ3D = 1000
 
static const int MAX_ND3D = 1000
 
static const int MAX_VDIM3D = 3
 

Protected Attributes

const FiniteElementSpacefespace
 Not owned.
 
const QuadratureSpaceqspace
 Not owned.
 
const IntegrationRuleIntRule
 Not owned.
 
QVectorLayout q_layout
 Output Q-vector layout.
 
bool use_tensor_products
 Tensor product evaluation mode.
 
Vector d_buffer
 Auxiliary device buffer.
 

Friends

class FiniteElementSpace
 

Detailed Description

A class that performs interpolation from an E-vector to quadrature point values and/or derivatives (Q-vectors).

An E-vector represents the element-wise discontinuous version of the FE space and can be obtained, for example, from a GridFunction using the Operator returned by FiniteElementSpace::GetElementRestriction().

The target quadrature points in the elements can be described either by an IntegrationRule (all mesh elements must be of the same type in this case) or by a QuadratureSpace.

Definition at line 29 of file quadinterpolator.hpp.

Member Enumeration Documentation

◆ EvalFlags

Enumerator
VALUES 

Evaluate the values at quadrature points.

DERIVATIVES 

Evaluate the derivatives at quadrature points.

DETERMINANTS 

Assuming the derivative at quadrature points form a matrix, this flag can be used to compute and store their determinants. This flag can only be used in Mult().

PHYSICAL_DERIVATIVES 

Evaluate the physical derivatives.

Definition at line 51 of file quadinterpolator.hpp.

Constructor & Destructor Documentation

◆ QuadratureInterpolator() [1/2]

mfem::QuadratureInterpolator::QuadratureInterpolator ( const FiniteElementSpace & fes,
const IntegrationRule & ir )

Definition at line 22 of file quadinterpolator.cpp.

◆ QuadratureInterpolator() [2/2]

mfem::QuadratureInterpolator::QuadratureInterpolator ( const FiniteElementSpace & fes,
const QuadratureSpace & qs )

Definition at line 38 of file quadinterpolator.cpp.

Member Function Documentation

◆ Derivatives()

void mfem::QuadratureInterpolator::Derivatives ( const Vector & e_vec,
Vector & q_der ) const

Interpolate the derivatives (with respect to reference coordinates) of the E-vector e_vec at quadrature points.

Definition at line 713 of file quadinterpolator.cpp.

◆ Determinants()

void mfem::QuadratureInterpolator::Determinants ( const Vector & e_vec,
Vector & q_det ) const

Compute the determinants of the derivatives (with respect to reference coordinates) of the E-vector e_vec at quadrature points.

Definition at line 727 of file quadinterpolator.cpp.

◆ DisableTensorProducts()

void mfem::QuadratureInterpolator::DisableTensorProducts ( bool disable = true) const
inline

Disable the use of tensor product evaluations, for tensor-product elements, e.g. quads and hexes. By default, tensor product evaluations are enabled.

See also
EnableTensorProducts(), UsesTensorProducts().

Definition at line 72 of file quadinterpolator.hpp.

◆ EnableTensorProducts()

void mfem::QuadratureInterpolator::EnableTensorProducts ( ) const
inline

Enable the use of tensor product evaluations, for tensor-product elements, e.g. quads and hexes. By default, this option is enabled.

See also
DisableTensorProducts(), UsesTensorProducts().

Definition at line 78 of file quadinterpolator.hpp.

◆ GetOutputLayout()

QVectorLayout mfem::QuadratureInterpolator::GetOutputLayout ( ) const
inline

Query the current output Q-vector layout. The default value is QVectorLayout::byNODES.

See also
SetOutputLayout().

Definition at line 87 of file quadinterpolator.hpp.

◆ Mult()

void mfem::QuadratureInterpolator::Mult ( const Vector & e_vec,
unsigned eval_flags,
Vector & q_val,
Vector & q_der,
Vector & q_det ) const

Interpolate the E-vector e_vec to quadrature points.

The eval_flags are a bitwise mask of constants from the EvalFlags enumeration. When the VALUES flag is set, the values at quadrature points are computed and stored in the Vector q_val. Similarly, when one of the flags DERIVATIVES or PHYSICAL_DERIVATIVES is set, the derivatives (with respect to reference or physical coordinates, respectively) are computed and stored in q_der. Only one of the flags DERIVATIVES or PHYSICAL_DERIVATIVES can be set in a call. When the DETERMINANTS flag is set, it is assumed that the derivatives (with respect to reference coordinates) form a matrix at each quadrature point (i.e. the associated FiniteElementSpace is a vector space) and their determinants are computed and stored in q_det.

The layout of the input E-vector, e_vec, must be consistent with the evaluation mode: if tensor-product evaluations are enabled, then tensor-product elements, must use the ElementDofOrdering::LEXICOGRAPHIC layout; otherwise – ElementDofOrdering::NATIVE layout. See FiniteElementSpace::GetElementRestriction().

Definition at line 459 of file quadinterpolator.cpp.

◆ MultTranspose()

void mfem::QuadratureInterpolator::MultTranspose ( unsigned eval_flags,
const Vector & q_val,
const Vector & q_der,
Vector & e_vec ) const

Perform the transpose operation of Mult(). (TODO)

Definition at line 694 of file quadinterpolator.cpp.

◆ PhysDerivatives()

void mfem::QuadratureInterpolator::PhysDerivatives ( const Vector & e_vec,
Vector & q_der ) const

Interpolate the derivatives in physical space of the E-vector e_vec at quadrature points.

Definition at line 720 of file quadinterpolator.cpp.

◆ SetOutputLayout()

void mfem::QuadratureInterpolator::SetOutputLayout ( QVectorLayout layout) const
inline

Set the desired output Q-vector layout. The default value is QVectorLayout::byNODES.

See also
GetOutputLayout().

Definition at line 92 of file quadinterpolator.hpp.

◆ UsesTensorProducts()

bool mfem::QuadratureInterpolator::UsesTensorProducts ( ) const
inline

Query the current tensor product evaluation mode.

See also
DisableTensorProducts(), EnableTensorProducts().

Definition at line 82 of file quadinterpolator.hpp.

◆ Values()

void mfem::QuadratureInterpolator::Values ( const Vector & e_vec,
Vector & q_val ) const

Interpolate the values of the E-vector e_vec at quadrature points.

Definition at line 706 of file quadinterpolator.cpp.

Friends And Related Symbol Documentation

◆ FiniteElementSpace

friend class FiniteElementSpace
friend

Definition at line 32 of file quadinterpolator.hpp.

Member Data Documentation

◆ d_buffer

Vector mfem::QuadratureInterpolator::d_buffer
mutableprotected

Auxiliary device buffer.

Definition at line 40 of file quadinterpolator.hpp.

◆ fespace

const FiniteElementSpace* mfem::QuadratureInterpolator::fespace
protected

Not owned.

Definition at line 34 of file quadinterpolator.hpp.

◆ IntRule

const IntegrationRule* mfem::QuadratureInterpolator::IntRule
protected

Not owned.

Definition at line 36 of file quadinterpolator.hpp.

◆ MAX_ND2D

const int mfem::QuadratureInterpolator::MAX_ND2D = 100
static

Definition at line 44 of file quadinterpolator.hpp.

◆ MAX_ND3D

const int mfem::QuadratureInterpolator::MAX_ND3D = 1000
static

Definition at line 48 of file quadinterpolator.hpp.

◆ MAX_NQ2D

const int mfem::QuadratureInterpolator::MAX_NQ2D = 100
static

Definition at line 43 of file quadinterpolator.hpp.

◆ MAX_NQ3D

const int mfem::QuadratureInterpolator::MAX_NQ3D = 1000
static

Definition at line 47 of file quadinterpolator.hpp.

◆ MAX_VDIM2D

const int mfem::QuadratureInterpolator::MAX_VDIM2D = 3
static

Definition at line 45 of file quadinterpolator.hpp.

◆ MAX_VDIM3D

const int mfem::QuadratureInterpolator::MAX_VDIM3D = 3
static

Definition at line 49 of file quadinterpolator.hpp.

◆ q_layout

QVectorLayout mfem::QuadratureInterpolator::q_layout
mutableprotected

Output Q-vector layout.

Definition at line 37 of file quadinterpolator.hpp.

◆ qspace

const QuadratureSpace* mfem::QuadratureInterpolator::qspace
protected

Not owned.

Definition at line 35 of file quadinterpolator.hpp.

◆ use_tensor_products

bool mfem::QuadratureInterpolator::use_tensor_products
mutableprotected

Tensor product evaluation mode.

Definition at line 39 of file quadinterpolator.hpp.


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