libMesh::ConstFEMFunction< Output > Class Template Reference

FEMFunction that returns a single. More...

#include <const_fem_function.h>

Inheritance diagram for libMesh::ConstFEMFunction< Output >:

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)
 
virtual void init_context (const FEMContext &)
 
void operator() (const FEMContext &, const Point &p, DenseVector< Output > &output)
 
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.

FEMFunction that returns a single.

Author
Roy Stogner
Date
2012

Definition at line 40 of file const_fem_function.h.

Constructor & Destructor Documentation

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

Definition at line 43 of file const_fem_function.h.

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

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

Definition at line 45 of file const_fem_function.h.

45 {}

Member Function Documentation

template<typename Output = Number>
virtual UniquePtr<FEMFunctionBase<Output> > libMesh::ConstFEMFunction< Output >::clone ( ) const
inlinevirtual

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 47 of file const_fem_function.h.

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

48  {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. 
)
inlinevirtualinherited
Returns
the vector component i at coordinate p and time time. Subclasses aren't required to overload this, since the default implementation is based on the full vector evaluation, which is often correct. Subclasses are recommended to overload 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 132 of file fem_function_base.h.

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

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

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

Definition at line 71 of file fem_function_base.h.

References libMesh::FEMFunctionBase< Output >::clone(), libMesh::FEMFunctionBase< Output >::component(), libMesh::FEMFunctionBase< Output >::operator()(), and libMesh::Real.

71 {}
template<typename Output = Number>
virtual Output libMesh::ConstFEMFunction< Output >::operator() ( const FEMContext ,
const Point p,
const Real  time = 0. 
)
inlinevirtual
Returns
the scalar value at coordinate p and time time, which defaults to zero. Purely virtual, so you have to overload it. Note that this cannot be a const method, check MeshFunction.

Implements libMesh::FEMFunctionBase< Output >.

Definition at line 50 of file const_fem_function.h.

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

53  { return _c; }
template<typename Output = Number>
virtual void libMesh::ConstFEMFunction< Output >::operator() ( const FEMContext ,
const Point p,
const Real  time,
DenseVector< Output > &  output 
)
inlinevirtual

Return function for vectors. Returns in output the values of the data at the coordinate p and for time time. Purely virtual, so you have to overload it. Note that this cannot be a const method, check MeshFunction.

Implements libMesh::FEMFunctionBase< Output >.

Definition at line 55 of file const_fem_function.h.

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

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

Return function for vectors. Returns in output the values of the data at the coordinate p.

Definition at line 144 of file fem_function_base.h.

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

147 {
148  // Call the time-dependent function with t=0.
149  this->operator()(context, p, 0., output);
150 }
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: