libMesh
|
Base class for functors that can be evaluated at a point and (optionally) time. More...
#include <dirichlet_boundaries.h>
Public Member Functions | |
FunctionBase (FunctionBase &&)=default | |
The 5 special functions can be defaulted for this class. More... | |
FunctionBase (const FunctionBase &)=default | |
FunctionBase & | operator= (const FunctionBase &)=default |
FunctionBase & | operator= (FunctionBase &&)=default |
virtual | ~FunctionBase ()=default |
virtual void | init () |
The actual initialization process. More... | |
virtual void | clear () |
Clears the function. More... | |
virtual std::unique_ptr< FunctionBase< Output > > | clone () const =0 |
virtual Output | operator() (const Point &p, const Real time=0.)=0 |
void | operator() (const Point &p, DenseVector< Output > &output) |
Evaluation function for time-independent vector-valued functions. More... | |
virtual void | operator() (const Point &p, const Real time, DenseVector< Output > &output)=0 |
Evaluation function for time-dependent vector-valued functions. More... | |
virtual Output | component (unsigned int i, const Point &p, Real time=0.) |
bool | initialized () const |
void | set_is_time_dependent (bool is_time_dependent) |
Function to set whether this is a time-dependent function or not. More... | |
bool | is_time_dependent () const |
Protected Member Functions | |
FunctionBase (const FunctionBase *master=nullptr) | |
Constructor. More... | |
Protected Attributes | |
const FunctionBase * | _master |
Const pointer to our master, initialized to nullptr . More... | |
bool | _initialized |
When init() was called so that everything is ready for calls to operator() (...), then this bool is true. More... | |
bool | _is_time_dependent |
Cache whether or not this function is actually time-dependent. More... | |
Base class for functors that can be evaluated at a point and (optionally) time.
Instances of FunctionBase represent functions (in the mathematical sense) of time and space, \( f(\mathbf{x},t) = \mbox{\texttt{v}} \), where v
may be either a Number
or a DenseVector<Number>
. Children of this base class implement different styles of data retrieval for these functions. Use the constructors of the derived classes for creating new objects. The required input of each derived class thwarts the effective use of the commonly used build()
member. But afterward the virtual members allow the convenient and libMesh-common usage through a FunctionBase
*.
Definition at line 44 of file dirichlet_boundaries.h.
|
inlineexplicitprotected |
|
default |
The 5 special functions can be defaulted for this class.
|
default |
|
virtualdefault |
|
inlinevirtual |
Clears the function.
Reimplemented in libMesh::MeshFunction, libMesh::AnalyticFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, libMesh::MeshlessInterpolationFunction, libMesh::MeshlessInterpolationFunction, and ExampleOneFunction.
Definition at line 91 of file function_base.h.
|
pure virtual |
The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.
Implemented in libMesh::MeshTools::Generation::Private::GaussLobattoRedistributionFunction, libMesh::CompositeFunction< Output >, libMesh::MeshFunction, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, libMesh::AnalyticFunction< Output >, libMesh::WrappedFunction< Output >, libMesh::ConstFunction< Output >, libMesh::ZeroFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, TripleFunction, SolutionGradient, SolutionGradient, SolutionGradient, libMesh::MeshlessInterpolationFunction, libMesh::MeshlessInterpolationFunction, BdyFunction, SolutionFunction, BdyFunction, SolutionFunction, SolutionFunction, BdyFunction, and ExampleOneFunction.
Referenced by libMesh::ExactErrorEstimator::attach_exact_deriv(), libMesh::ExactSolution::attach_exact_deriv(), libMesh::ExactErrorEstimator::attach_exact_hessian(), libMesh::ExactSolution::attach_exact_hessian(), libMesh::ExactErrorEstimator::attach_exact_value(), libMesh::ExactSolution::attach_exact_value(), libMesh::CompositeFunction< Output >::attach_subfunction(), libMesh::DirichletBoundary::DirichletBoundary(), and libMesh::MeshTools::Modification::redistribute().
|
inlinevirtual |
i
at coordinate p
and time time
.Reimplemented in TripleFunction, libMesh::WrappedFunction< Output >, libMesh::CompositeFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, SolutionGradient, SolutionGradient, SolutionGradient, SolutionFunction, SolutionFunction, and SolutionFunction.
Definition at line 227 of file function_base.h.
|
inlinevirtual |
The actual initialization process.
Reimplemented in libMesh::MeshFunction, libMesh::AnalyticFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, libMesh::MeshlessInterpolationFunction, libMesh::MeshlessInterpolationFunction, and ExampleOneFunction.
Definition at line 86 of file function_base.h.
|
inline |
true
when this object is properly initialized and ready for use, false
otherwise. Definition at line 205 of file function_base.h.
|
inline |
true
when the function this object represents is actually time-dependent, false
otherwise. Definition at line 219 of file function_base.h.
Referenced by libMesh::CompositeFunction< Output >::attach_subfunction(), CompositeFunctionTest::testTimeDependence(), and ParsedFunctionTest::testTimeDependence().
|
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::MeshTools::Generation::Private::GaussLobattoRedistributionFunction, SolutionGradient, SolutionGradient, SolutionGradient, libMesh::ParsedFunction< T >, libMesh::CompositeFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::AnalyticFunction< Output >, libMesh::WrappedFunction< Output >, libMesh::MeshFunction, libMesh::MeshlessInterpolationFunction, libMesh::MeshlessInterpolationFunction, libMesh::ParsedFunction< T >, libMesh::ConstFunction< Output >, and libMesh::ParsedFunction< Output, OutputGradient >.
|
pure virtual |
p
and time time
, which defaults to zero.Pure virtual, so you have to override it.
Implemented in libMesh::MeshlessInterpolationFunction, libMesh::MeshFunction, libMesh::AnalyticFunction< Output >, libMesh::WrappedFunction< Output >, libMesh::MeshlessInterpolationFunction, libMesh::CompositeFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, TripleFunction, libMesh::ConstFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, SolutionGradient, SolutionGradient, SolutionGradient, BdyFunction, BdyFunction, SolutionFunction, SolutionFunction, SolutionFunction, BdyFunction, libMesh::MeshTools::Generation::Private::GaussLobattoRedistributionFunction, and ExampleOneFunction.
|
inline |
Evaluation function for time-independent vector-valued functions.
Sets output values in the passed-in output
DenseVector.
Definition at line 240 of file function_base.h.
|
default |
|
default |
|
inline |
Function to set whether this is a time-dependent function or not.
This is intended to be only used by subclasses who cannot natively determine time-dependence. In such a case, this function should be used immediately following construction.
Definition at line 212 of file function_base.h.
|
protected |
When init()
was called so that everything is ready for calls to operator()
(...), then this bool
is true.
Definition at line 179 of file function_base.h.
Referenced by libMesh::AnalyticFunction< Output >::AnalyticFunction(), libMesh::ConstFunction< Output >::ConstFunction(), and libMesh::WrappedFunction< Output >::WrappedFunction().
|
protected |
Cache whether or not this function is actually time-dependent.
Definition at line 184 of file function_base.h.
Referenced by libMesh::CompositeFunction< Output >::attach_subfunction(), and libMesh::ConstFunction< Output >::ConstFunction().
|
protected |
Const pointer to our master, initialized to nullptr
.
There may be cases where multiple functions are required, but to save memory, one master handles some centralized data.
Definition at line 173 of file function_base.h.