libMesh
Public Member Functions | Private Attributes | List of all members
libMesh::ConstFEMFunction< Output > Class Template Reference

FEMFunction that returns a single value, regardless of the time and location inputs. More...

#include <const_fem_function.h>

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

Public Member Functions

 ConstFEMFunction (const Output c)
 
 ~ConstFEMFunction ()
 
virtual UniquePtr< FEMFunctionBase< Output > > clone () const
 
virtual Output operator() (const FEMContext &, const Point &, const Real=0.)
 
virtual void operator() (const FEMContext &, const Point &, const Real, DenseVector< Output > &output)
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual void init_context (const FEMContext &)
 Prepares a context object for use. More...
 
void operator() (const FEMContext &, const Point &p, DenseVector< Output > &output)
 Evaluation function for time-independent vector-valued functions. More...
 
virtual Output component (const FEMContext &, unsigned int i, const Point &p, Real time=0.)
 

Private Attributes

Output _c
 

Detailed Description

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

FEMFunction that returns a single value, regardless of the time and location inputs.

Author
Roy Stogner
Date
2012 FEMFunction that returns a single value.

Definition at line 41 of file const_fem_function.h.

Constructor & Destructor Documentation

template<typename Output = Number>
libMesh::ConstFEMFunction< Output >::ConstFEMFunction ( const Output  c)

Definition at line 44 of file const_fem_function.h.

Referenced by libMesh::ConstFEMFunction< Output >::clone().

template<typename Output = Number>
libMesh::ConstFEMFunction< Output >::~ConstFEMFunction ( )

Definition at line 46 of file const_fem_function.h.

46 {}

Member Function Documentation

template<typename Output = Number>
virtual UniquePtr<FEMFunctionBase<Output> > libMesh::ConstFEMFunction< Output >::clone ( ) const
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.

Implements libMesh::FEMFunctionBase< Output >.

Definition at line 48 of file const_fem_function.h.

References libMesh::ConstFEMFunction< Output >::ConstFEMFunction().

49  {return UniquePtr<FEMFunctionBase<Output>>( new ConstFEMFunction(*this) ); }
ConstFEMFunction(const Output c)
template<typename Output >
Output libMesh::FEMFunctionBase< Output >::component ( const FEMContext context,
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 libMesh::CompositeFEMFunction< Output >, libMesh::ParsedFEMFunction< Output >, libMesh::ParsedFEMFunction< T >, and libMesh::WrappedFunctor< Output >.

Definition at line 131 of file fem_function_base.h.

Referenced by libMesh::FEMFunctionBase< Number >::init_context(), and libMesh::System::project_vector().

135 {
136  DenseVector<Output> outvec(i+1);
137  (*this)(context, p, time, outvec);
138  return outvec(i);
139 }
template<typename Output = Number>
virtual void libMesh::FEMFunctionBase< Output >::init_context ( const FEMContext )
virtualinherited

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 >, libMesh::ParsedFEMFunction< T >, and SlitFunc.

Definition at line 71 of file fem_function_base.h.

71 {}
template<typename Output = Number>
virtual Output libMesh::ConstFEMFunction< Output >::operator() ( const FEMContext ,
const Point p,
const Real  time = 0. 
)
virtual
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::FEMFunctionBase< Output >.

Definition at line 51 of file const_fem_function.h.

References libMesh::ConstFEMFunction< Output >::_c.

54  { return _c; }
template<typename Output = Number>
virtual void libMesh::ConstFEMFunction< Output >::operator() ( const FEMContext ,
const Point p,
const Real  time,
DenseVector< Output > &  output 
)
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.

Implements libMesh::FEMFunctionBase< Output >.

Definition at line 56 of file const_fem_function.h.

References libMesh::ConstFEMFunction< Output >::_c, and libMesh::DenseVector< T >::size().

60  {
61  for (std::size_t i = 0; i < output.size(); i++)
62  output(i) = _c;
63  }
template<typename Output>
void libMesh::FEMFunctionBase< Output >::operator() ( const FEMContext context,
const Point p,
DenseVector< Output > &  output 
)
inherited

Evaluation function for time-independent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Definition at line 143 of file fem_function_base.h.

References libMesh::FEMFunctionBase< Output >::operator()().

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

Member Data Documentation

template<typename Output = Number>
Output libMesh::ConstFEMFunction< Output >::_c
private

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