Wraps a function pointer into a FunctionBase object. More...
#include <analytic_function.h>
Public Types | |
typedef Output(* | OutputFunction) (const Point &p, const Real time) |
typedef void(* | OutputVectorFunction) (DenseVector< Output > &output, const Point &p, const Real time) |
Public Member Functions | |
AnalyticFunction (OutputFunction fptr) | |
AnalyticFunction (OutputVectorFunction fptr) | |
AnalyticFunction (AnalyticFunction &&)=default | |
AnalyticFunction (const AnalyticFunction &)=default | |
AnalyticFunction & | operator= (const AnalyticFunction &)=default |
AnalyticFunction & | operator= (AnalyticFunction &&)=default |
virtual | ~AnalyticFunction ()=default |
virtual void | init () override |
virtual void | clear () override |
virtual std::unique_ptr< FunctionBase< Output > > | clone () const override |
virtual Output | operator() (const Point &p, const Real time=0.) override |
virtual void | operator() (const Point &p, const Real time, DenseVector< Output > &output) override |
void | operator() (const Point &p, DenseVector< Output > &output) |
virtual Output | component (unsigned int i, const Point &p, Real time=0.) |
bool | initialized () const |
void | set_is_time_dependent (bool is_time_dependent) |
bool | is_time_dependent () const |
Public Attributes | |
OutputFunction | _number_fptr |
OutputVectorFunction | _vector_fptr |
Protected Attributes | |
const FunctionBase * | _master |
bool | _initialized |
bool | _is_time_dependent |
Wraps a function pointer into a FunctionBase object.
This class provides function-like objects for which an analytical expression can be provided. The user may either provide a function pointer that returns a vector or a number. All overridden virtual functions are documented in function_base.h.
Definition at line 48 of file analytic_function.h.
typedef Output(* libMesh::AnalyticFunction< Output >::OutputFunction) (const Point &p, const Real time) |
Scalar return value function pointer type.
Definition at line 53 of file analytic_function.h.
typedef void(* libMesh::AnalyticFunction< Output >::OutputVectorFunction) (DenseVector< Output > &output, const Point &p, const Real time) |
Vector return value function pointer type.
Definition at line 62 of file analytic_function.h.
libMesh::AnalyticFunction< Output >::AnalyticFunction | ( | OutputFunction | fptr | ) |
Constructor. Takes a function pointer for scalar return values.
Definition at line 134 of file analytic_function.h.
References libMesh::FunctionBase< Output >::_initialized.
|
inline |
Constructor. Takes a function pointer for vector valued functions.
Definition at line 147 of file analytic_function.h.
References libMesh::FunctionBase< Output >::_initialized.
|
default |
The 5 special functions can be defaulted for this class.
|
default |
|
virtualdefault |
|
inlineoverridevirtual |
Clears the function.
Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 172 of file analytic_function.h.
|
inlineoverridevirtual |
The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.
Implements libMesh::FunctionBase< Output >.
Definition at line 187 of file analytic_function.h.
|
inlinevirtualinherited |
i
at coordinate p
and time time
.Reimplemented in libMesh::CompositeFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, and libMesh::WrappedFunction< Output >.
Definition at line 228 of file function_base.h.
|
overridevirtual |
The actual initialization process.
Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 159 of file analytic_function.h.
|
inlineinherited |
true
when this object is properly initialized and ready for use, false
otherwise. Definition at line 206 of file function_base.h.
|
inlineinherited |
true
when the function this object represents is actually time-dependent, false
otherwise. Definition at line 220 of file function_base.h.
Referenced by libMesh::CompositeFunction< Output >::attach_subfunction().
|
inlineoverridevirtual |
p
and time time
, which defaults to zero.Pure virtual, so you have to override it.
Implements libMesh::FunctionBase< Output >.
Definition at line 111 of file analytic_function.h.
References libMesh::initialized().
|
inlineoverridevirtual |
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.
Implements libMesh::FunctionBase< Output >.
Definition at line 122 of file analytic_function.h.
References libMesh::initialized().
|
inlineinherited |
Evaluation function for time-independent vector-valued functions. Sets output values in the passed-in output
DenseVector.
Definition at line 241 of file function_base.h.
|
default |
|
default |
|
inlineinherited |
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 213 of file function_base.h.
|
protectedinherited |
When init()
was called so that everything is ready for calls to operator()
(...), then this bool
is true.
Definition at line 180 of file function_base.h.
Referenced by libMesh::AnalyticFunction< Output >::AnalyticFunction(), libMesh::ConstFunction< Output >::ConstFunction(), and libMesh::WrappedFunction< Output >::WrappedFunction().
|
protectedinherited |
Cache whether or not this function is actually time-dependent.
Definition at line 185 of file function_base.h.
Referenced by libMesh::CompositeFunction< Output >::attach_subfunction(), and libMesh::ConstFunction< Output >::ConstFunction().
|
protectedinherited |
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 174 of file function_base.h.
OutputFunction libMesh::AnalyticFunction< Output >::_number_fptr |
Pointer to user-provided function that computes the boundary values when an analytical expression is available.
Definition at line 84 of file analytic_function.h.
OutputVectorFunction libMesh::AnalyticFunction< Output >::_vector_fptr |
Pointer to user-provided vector valued function.
Definition at line 89 of file analytic_function.h.