libMesh
Public Member Functions | Protected Member Functions | List of all members
libMesh::FEMFunctionBase< Output > Class Template Referenceabstract

FEMFunctionBase is a base class from which users can derive in order to define "function-like" objects that can be used within FEMSystem. More...

#include <dirichlet_boundaries.h>

Inheritance diagram for libMesh::FEMFunctionBase< Output >:
[legend]

Public Member Functions

 FEMFunctionBase (FEMFunctionBase &&)=default
 The 5 special functions can be defaulted for this class. More...
 
 FEMFunctionBase (const FEMFunctionBase &)=default
 
FEMFunctionBaseoperator= (const FEMFunctionBase &)=default
 
FEMFunctionBaseoperator= (FEMFunctionBase &&)=default
 
virtual ~FEMFunctionBase ()=default
 
virtual void init_context (const FEMContext &)
 Prepares a context object for use. More...
 
virtual std::unique_ptr< FEMFunctionBase< Output > > clone () const =0
 
virtual Output operator() (const FEMContext &, const Point &p, const Real time=0.)=0
 
void operator() (const FEMContext &, const Point &p, DenseVector< Output > &output)
 Evaluation function for time-independent vector-valued functions. More...
 
virtual void operator() (const FEMContext &, const Point &p, const Real time, DenseVector< Output > &output)=0
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual Output component (const FEMContext &, unsigned int i, const Point &p, Real time=0.)
 

Protected Member Functions

 FEMFunctionBase ()=default
 Constructor. More...
 

Detailed Description

template<typename Output = Number>
class libMesh::FEMFunctionBase< Output >

FEMFunctionBase is a base class from which users can derive in order to define "function-like" objects that can be used within FEMSystem.

Author
Roy Stogner
Date
2012

Definition at line 44 of file dirichlet_boundaries.h.

Constructor & Destructor Documentation

◆ FEMFunctionBase() [1/3]

template<typename Output = Number>
libMesh::FEMFunctionBase< Output >::FEMFunctionBase ( )
protecteddefault

Constructor.

◆ FEMFunctionBase() [2/3]

template<typename Output = Number>
libMesh::FEMFunctionBase< Output >::FEMFunctionBase ( FEMFunctionBase< Output > &&  )
default

The 5 special functions can be defaulted for this class.

◆ FEMFunctionBase() [3/3]

template<typename Output = Number>
libMesh::FEMFunctionBase< Output >::FEMFunctionBase ( const FEMFunctionBase< Output > &  )
default

◆ ~FEMFunctionBase()

template<typename Output = Number>
virtual libMesh::FEMFunctionBase< Output >::~FEMFunctionBase ( )
virtualdefault

Member Function Documentation

◆ clone()

template<typename Output = Number>
virtual std::unique_ptr<FEMFunctionBase<Output> > libMesh::FEMFunctionBase< Output >::clone ( ) const
pure virtual
Returns
A new copy of the function.

The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.

Implemented in CoupledFEMFunctionsy, libMesh::CompositeFEMFunction< Output >, CoupledFEMFunctionsx, libMesh::ParsedFEMFunction< Output >, libMesh::ParsedFEMFunction< T >, libMesh::WrappedFunctor< Output >, and libMesh::ConstFEMFunction< Output >.

Referenced by libMesh::CompositeFEMFunction< Output >::attach_subfunction().

◆ component()

template<typename Output >
Output libMesh::FEMFunctionBase< Output >::component ( const FEMContext context,
unsigned int  i,
const Point p,
Real  time = 0. 
)
virtual
Returns
The vector component i at coordinate p and time time.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.

Reimplemented in libMesh::CompositeFEMFunction< Output >, libMesh::ParsedFEMFunction< Output >, libMesh::ParsedFEMFunction< T >, and libMesh::WrappedFunctor< Output >.

Definition at line 133 of file fem_function_base.h.

137 {
138  DenseVector<Output> outvec(i+1);
139  (*this)(context, p, time, outvec);
140  return outvec(i);
141 }

◆ init_context()

template<typename Output = Number>
virtual void libMesh::FEMFunctionBase< Output >::init_context ( const FEMContext )
virtual

Prepares a context object for use.

Most problems will want to reimplement this for efficiency, in order to call FE::get_*() as their particular function requires.

Reimplemented in libMesh::ParsedFEMFunction< Output >, and libMesh::ParsedFEMFunction< T >.

Definition at line 73 of file fem_function_base.h.

73 {}

◆ operator()() [1/3]

template<typename Output = Number>
virtual Output libMesh::FEMFunctionBase< Output >::operator() ( const FEMContext ,
const Point p,
const Real  time = 0. 
)
pure virtual
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implemented in CoupledFEMFunctionsy, CoupledFEMFunctionsx, libMesh::CompositeFEMFunction< Output >, libMesh::ParsedFEMFunction< Output >, libMesh::ParsedFEMFunction< T >, libMesh::WrappedFunctor< Output >, and libMesh::ConstFEMFunction< Output >.

◆ operator()() [2/3]

template<typename Output >
void libMesh::FEMFunctionBase< Output >::operator() ( const FEMContext context,
const Point p,
DenseVector< Output > &  output 
)

Evaluation function for time-independent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Definition at line 145 of file fem_function_base.h.

148 {
149  // Call the time-dependent function with t=0.
150  this->operator()(context, p, 0., output);
151 }
virtual Output operator()(const FEMContext &, const Point &p, const Real time=0.)=0

◆ operator()() [3/3]

template<typename Output = Number>
virtual void libMesh::FEMFunctionBase< Output >::operator() ( const FEMContext ,
const Point p,
const Real  time,
DenseVector< Output > &  output 
)
pure virtual

Evaluation function for time-dependent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Pure virtual, so you have to override it.

Implemented in libMesh::CompositeFEMFunction< Output >, libMesh::ParsedFEMFunction< Output >, libMesh::WrappedFunctor< Output >, and libMesh::ConstFEMFunction< Output >.

◆ operator=() [1/2]

template<typename Output = Number>
FEMFunctionBase& libMesh::FEMFunctionBase< Output >::operator= ( const FEMFunctionBase< Output > &  )
default

◆ operator=() [2/2]

template<typename Output = Number>
FEMFunctionBase& libMesh::FEMFunctionBase< Output >::operator= ( FEMFunctionBase< Output > &&  )
default

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