AMDiS  0.3
The Adaptive Multi-Dimensional Simulation Toolbox
LocalToGlobalBasisAdapter< BasisCache, Geometry > Class Template Reference

Convert a simple (scalar) local basis into a global basis. More...

#include <LocalToGlobalAdapter.hpp>

Public Types

using Cache = BasisCache
 
using Traits = LocalToGlobalBasisAdapterTraits< typename LocalBasis::Traits, Geometry::coorddimension >
 

Public Member Functions

 LocalToGlobalBasisAdapter (Cache const &cache, Geometry const &geometry)
 Construct a LocalToGlobalBasisAdapter. More...
 
std::size_t size () const
 Return the number of local basis functions.
 
std::size_t order () const
 Return maximum polynomial order of the base function. More...
 
void evaluateFunction (typename Traits::DomainLocal const &x, std::vector< typename Traits::Range > &out) const
 Evaluate the local basis functions in the local coordinate x
 
auto const & valuesAt (typename Traits::DomainLocal const &x) const
 
void evaluateGradient (typename Traits::DomainLocal const &x, std::vector< typename Traits::GradientRange > &out) const
 
auto const & gradientsAt (typename Traits::DomainLocal const &x) const
 
void evaluatePartial (typename Traits::DomainLocal const &x, std::size_t comp, std::vector< typename Traits::PartialRange > &out) const
 
auto const & partialsAt (typename Traits::DomainLocal const &x, std::size_t comp) const
 

Detailed Description

template<class BasisCache, class Geometry>
class AMDiS::LocalToGlobalBasisAdapter< BasisCache, Geometry >

Convert a simple (scalar) local basis into a global basis.

The local basis must be scalar, i.e. LocalBasis::Traits::dimRange must be 1 It's values are not transformed.

For scalar function \(f\), the gradient is equivalent to the transposed Jacobian \(\nabla f|_x = J_f^T(x)\). The Jacobian is thus transformed using

\[ \nabla f|_{\mu(\hat x)} = \hat J_\mu^{-T}(\hat x) \cdot \hat\nabla\hat f|_{\hat x} \]

Here the hat \(\hat{\phantom x}\) denotes local quantities and \(\mu\) denotes the local-to-global map of the geometry.

Template Parameters
BasisCacheType of the local-basis cache containing local basis evaluations to adopt.
GeometryType of the local-to-global transformation.

NOTE: The adapter implements a caching of local basis evaluations at coordinates.

Constructor & Destructor Documentation

◆ LocalToGlobalBasisAdapter()

LocalToGlobalBasisAdapter ( Cache const &  cache,
Geometry const &  geometry 
)
inline

Construct a LocalToGlobalBasisAdapter.

Parameters
nodeThe basis node in the typetree containing the local basis to adopt.
geometryThe geometry object to use for adaption.
Note
This class stores the references passed here. Any use of this class after these references have become invalid results in undefined behaviour. The exception is that the destructor of this class may still be called.

Member Function Documentation

◆ evaluateGradient()

void evaluateGradient ( typename Traits::DomainLocal const &  x,
std::vector< typename Traits::GradientRange > &  out 
) const
inline

Return the full (global) gradient of the local basis functions in the local coordinate x

◆ evaluatePartial()

void evaluatePartial ( typename Traits::DomainLocal const &  x,
std::size_t  comp,
std::vector< typename Traits::PartialRange > &  out 
) const
inline

Return the (global) partial derivative in direction comp of the local basis functions in the local coordinate x

◆ gradientsAt()

auto const& gradientsAt ( typename Traits::DomainLocal const &  x) const
inline

Return the full (global) gradient of the local basis functions in the local coordinate x and return the result using a reference to a thread_local (or static) vector.

Referenced by DiscreteFunction< Coeff, GB, TreePath, R >::LocalFunction< Type >::localContext().

◆ order()

std::size_t order ( ) const
inline

Return maximum polynomial order of the base function.

This is to determine the required quadrature order. For an affine geometry this is the same order as for the local basis. For other geometries this returns the order of the local basis plus the global dimension minus 1. The assumption for non-affine geometries is that they are still multi-linear.

◆ partialsAt()

auto const& partialsAt ( typename Traits::DomainLocal const &  x,
std::size_t  comp 
) const
inline

Return the (global) partial derivative in direction comp of the local basis functions in the local coordinate x and return the result using a reference to a thread_local (or static) vector.

◆ valuesAt()

auto const& valuesAt ( typename Traits::DomainLocal const &  x) const
inline

Evaluate the local basis functions in the local coordinate x and return the result using a reference to a thread_local (or static) vector.


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