libMesh
Public Member Functions | List of all members
SlitFunc Class Referenceabstract
Inheritance diagram for SlitFunc:
[legend]

Public Member Functions

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

Detailed Description

Definition at line 31 of file slit_mesh_test.C.

Constructor & Destructor Documentation

SlitFunc::SlitFunc ( )

Definition at line 35 of file slit_mesh_test.C.

35 {}
SlitFunc::~SlitFunc ( )

Definition at line 37 of file slit_mesh_test.C.

37 {}

Member Function Documentation

virtual UniquePtr<FEMFunctionBase<Number> > SlitFunc::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< Number >.

Definition at line 42 of file slit_mesh_test.C.

43  {
45  }
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual Number libMesh::FEMFunctionBase< Number >::component ( const FEMContext ,
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.
virtual void SlitFunc::init_context ( const FEMContext )
virtual

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 from libMesh::FEMFunctionBase< Number >.

Definition at line 39 of file slit_mesh_test.C.

39 {}
virtual Number SlitFunc::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< Number >.

Definition at line 47 of file slit_mesh_test.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::FEMContext::get_elem(), libMesh::Real, and libMesh::x.

50  {
51  const Real & x = p(0);
52  const Real & y = p(1);
53  const Point centroid = c.get_elem().centroid();
54  const Real sign = centroid(1)/std::abs(centroid(1));
55 
56  return (1 - std::abs(1-x)) * (1-std::abs(y)) * sign;
57  }
double abs(double a)
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual void SlitFunc::operator() ( const FEMContext c,
const Point p,
const Real  time,
DenseVector< Number > &  output 
)
virtual

Definition at line 59 of file slit_mesh_test.C.

63  {
64  for (unsigned int i=0; i != output.size(); ++i)
65  output(i) = (*this)(c, p, time);
66  }
virtual unsigned int size() const libmesh_override
Definition: dense_vector.h:87
void libMesh::FEMFunctionBase< Number >::operator() ( const FEMContext ,
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::FEMFunctionBase< Number >::operator() ( const FEMContext ,
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.


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