libMesh
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
ExampleOneFunction Class Referenceabstract
Inheritance diagram for ExampleOneFunction:
[legend]

Public Member Functions

void operator() (const Point &p, DenseVector< Number > &output)
 Evaluation function for time-independent vector-valued functions. More...
 
virtual void operator() (const Point &p, const Real time, DenseVector< Number > &output)=0
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual Number 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 Attributes

const FunctionBase_master
 Const pointer to our master, initialized to NULL. 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...
 

Private Member Functions

virtual Number operator() (const Point &, const Real)
 
virtual void operator() (const Point &, const Real, DenseVector< Number > &output)
 
virtual void init ()
 The actual initialization process. More...
 
virtual void clear ()
 Clears the function. More...
 
virtual UniquePtr< FunctionBase< Number > > clone () const
 

Detailed Description

Definition at line 29 of file factoryfunction.C.

Member Function Documentation

virtual void ExampleOneFunction::clear ( )
privatevirtual

Clears the function.

Reimplemented from libMesh::FunctionBase< Number >.

Definition at line 46 of file factoryfunction.C.

46 {}
virtual UniquePtr<FunctionBase<Number> > ExampleOneFunction::clone ( ) const
privatevirtual
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.

Implements libMesh::FunctionBase< Number >.

Definition at line 47 of file factoryfunction.C.

48  {
50  }
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual Number libMesh::FunctionBase< Number >::component ( unsigned int  i,
const Point p,
Real  time = 0. 
)
virtualinherited
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 SolutionFunction, SolutionFunction, and SolutionFunction.

virtual void ExampleOneFunction::init ( )
privatevirtual

The actual initialization process.

Reimplemented from libMesh::FunctionBase< Number >.

Definition at line 45 of file factoryfunction.C.

45 {}
bool libMesh::FunctionBase< Number >::initialized ( ) const
inherited
bool libMesh::FunctionBase< Number >::is_time_dependent ( ) const
inherited
Returns
true when the function this object represents is actually time-dependent, false otherwise.
virtual Number ExampleOneFunction::operator() ( const Point p,
const Real  time 
)
privatevirtual
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Number >.

Definition at line 31 of file factoryfunction.C.

33  {
34  return 1;
35  }
virtual void ExampleOneFunction::operator() ( const Point ,
const Real  ,
DenseVector< Number > &  output 
)
privatevirtual

Definition at line 37 of file factoryfunction.C.

References libMesh::DenseVector< T >::size().

40  {
41  for (unsigned int i=0; i != output.size(); ++i)
42  output(i) = 1;
43  }
virtual unsigned int size() const libmesh_override
Definition: dense_vector.h:87
void libMesh::FunctionBase< Number >::operator() ( const Point p,
DenseVector< Number > &  output 
)
inherited

Evaluation function for time-independent vector-valued functions.

Sets output values in the passed-in output DenseVector.

virtual void libMesh::FunctionBase< Number >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  output 
)
pure virtualinherited

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::MeshFunction, libMesh::MeshlessInterpolationFunction, and libMesh::MeshlessInterpolationFunction.

void libMesh::FunctionBase< Number >::set_is_time_dependent ( bool  is_time_dependent)
inherited

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.

Member Data Documentation

bool libMesh::FunctionBase< Number >::_initialized
protectedinherited

When init() was called so that everything is ready for calls to operator() (...), then this bool is true.

Definition at line 174 of file function_base.h.

Referenced by libMesh::MeshFunction::clear(), and libMesh::MeshFunction::init().

bool libMesh::FunctionBase< Number >::_is_time_dependent
protectedinherited

Cache whether or not this function is actually time-dependent.

Definition at line 179 of file function_base.h.

const FunctionBase* libMesh::FunctionBase< Number >::_master
protectedinherited

Const pointer to our master, initialized to NULL.

There may be cases where multiple functions are required, but to save memory, one master handles some centralized data.

Definition at line 168 of file function_base.h.

Referenced by libMesh::MeshFunction::clear(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::MeshFunction::init(), and libMesh::MeshFunction::~MeshFunction().


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