NSF Postdoctoral Research
A set of C++ code developed by Andrew E. Slaughter
|
A class for using boost::functions with libmesh. More...
#include <my_analytic_function.h>
Public Member Functions | |
MyAnalyticFunction (boost::function< Output(const Point &, const Real) > fptr) | |
Class constructor for functions with scalar return values. | |
MyAnalyticFunction (boost::function< void(DenseVector< Output > &, const Point &, const Real)> fptr) | |
Class constructor for functions with vector output, void return. | |
~MyAnalyticFunction () | |
Class destructor. | |
void | init () |
An initialization function. | |
void | clear () |
Clears the function. | |
virtual AutoPtr< FunctionBase < Output > > | clone () const |
Returns a new deep copy of the function. | |
Output | operator() (const Point &p, const Real t=0.) |
Allows the class to behave like a function. | |
void | operator() (const Point &p, const Real t, DenseVector< Output > &output) |
Allows the class to behave like a function. | |
Public Attributes | |
boost::function< Output(const Point &, const Real) > | _number_fptr |
boost::function< void(DenseVector < Output > &, const Point &, const Real) > | _vector_fptr |
A class for using boost::functions with libmesh.
This class mimics the behavior of libMesh::AnalyticFunction but utilizes the boost::function behavior, as such both class members and functions can be used.
SlaughterFEM::MyAnalyticFunction< Output >::MyAnalyticFunction | ( | boost::function< Output(const Point &, const Real) > | fptr | ) | [inline] |
Class constructor for functions with scalar return values.
fptr | A boost::function object that acts like a function pointer, this version outputs the type defined by the template parameter and takes a libMesh Point and Real (time) as input. |
SlaughterFEM::MyAnalyticFunction< Output >::MyAnalyticFunction | ( | boost::function< void(DenseVector< Output > &, const Point &, const Real)> | fptr | ) | [inline] |
Class constructor for functions with vector output, void return.
fptr | A boost::function object that acts like a function pointer, this version output values through the DenseVector reference input (the type is defined as the template parameter) that is computed from the libMesh Point and Real (time) inputs. |
void SlaughterFEM::MyAnalyticFunction< Output >::clear | ( | ) | [inline] |
Clears the function.
This sets the two boost::function objects to NULL, thus the function is set to be un-initilized.
virtual AutoPtr<FunctionBase<Output> > SlaughterFEM::MyAnalyticFunction< Output >::clone | ( | ) | const [inline, virtual] |
Returns a new deep copy of the function.
void SlaughterFEM::MyAnalyticFunction< Output >::init | ( | ) | [inline] |
An initialization function.
This checks if either the _number_fptr or the _vector_fptr is valid, if so the class is marked as intilized.
Output SlaughterFEM::MyAnalyticFunction< Output >::operator() | ( | const Point & | p, |
const Real | t = 0. |
||
) | [inline] |
Allows the class to behave like a function.
/param p A libMesh point /param t The time /return The value of the function to which this class points at point p
and time t
(defaults to zero).
boost::function< Output (const Point&, const Real) > SlaughterFEM::MyAnalyticFunction< Output >::_number_fptr |
Boost::function that points to a user provided class or function that computes the boundary values and has a scalar output.
boost::function< void (DenseVector<Output>&, const Point&, const Real) > SlaughterFEM::MyAnalyticFunction< Output >::_vector_fptr |
Boost::function that points to a user provided class or function that computes the boundary values and outputs a vector via the DenseVector input reference.