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

Public Member Functions

 BdyFunction (unsigned int u_var, unsigned int v_var, int sign)
 
virtual Number operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
virtual UniquePtr< FunctionBase< Number > > clone () const
 
 BdyFunction (unsigned int T_var)
 
virtual Number operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
virtual UniquePtr< FunctionBase< Number > > clone () const
 
 BdyFunction (unsigned int u_var, unsigned int v_var, unsigned int w_var, Real Reynolds)
 
virtual Number operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
virtual UniquePtr< FunctionBase< Number > > clone () const
 
virtual void init ()
 The actual initialization process. More...
 
virtual void clear ()
 Clears the function. More...
 
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 Attributes

const unsigned int _u_var
 
const unsigned int _v_var
 
const Real _sign
 
const unsigned int _T_var
 
const unsigned int _w_var
 
const Real _Re
 

Detailed Description

Definition at line 37 of file coupled_system.C.

Constructor & Destructor Documentation

BdyFunction::BdyFunction ( unsigned int  u_var,
unsigned int  v_var,
int  sign 
)

Definition at line 40 of file coupled_system.C.

42  :
43  _u_var(u_var),
44  _v_var(v_var),
45  _sign(sign)
46  { this->_initialized = true; }
bool _initialized
When init() was called so that everything is ready for calls to operator() (...), then this bool is t...
const unsigned int _v_var
const unsigned int _u_var
const Real _sign
BdyFunction::BdyFunction ( unsigned int  T_var)

Definition at line 30 of file poisson.C.

31  : _T_var(T_var)
32  { this->_initialized = true; }
bool _initialized
When init() was called so that everything is ready for calls to operator() (...), then this bool is t...
const unsigned int _T_var
Definition: poisson.C:52
BdyFunction::BdyFunction ( unsigned int  u_var,
unsigned int  v_var,
unsigned int  w_var,
Real  Reynolds 
)

Definition at line 41 of file naviersystem.C.

45  : _u_var(u_var), _v_var(v_var), _w_var(w_var), _Re(Reynolds)
46  { this->_initialized = true; }
bool _initialized
When init() was called so that everything is ready for calls to operator() (...), then this bool is t...
const unsigned int _v_var
const unsigned int _u_var
const unsigned int _w_var
Definition: naviersystem.C:66
const Real _Re
Definition: naviersystem.C:67

Member Function Documentation

virtual void libMesh::FunctionBase< Number >::clear ( )
virtualinherited

Clears the function.

Reimplemented in libMesh::MeshFunction, libMesh::MeshlessInterpolationFunction, libMesh::MeshlessInterpolationFunction, and ExampleOneFunction.

Definition at line 86 of file function_base.h.

86 {}
virtual UniquePtr<FunctionBase<Number> > BdyFunction::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::FunctionBase< Number >.

Definition at line 48 of file poisson.C.

std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
BdyFunction(unsigned int u_var, unsigned int v_var, int sign)
const unsigned int _T_var
Definition: poisson.C:52
virtual UniquePtr<FunctionBase<Number> > BdyFunction::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::FunctionBase< Number >.

Definition at line 62 of file naviersystem.C.

const unsigned int _v_var
const unsigned int _u_var
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
BdyFunction(unsigned int u_var, unsigned int v_var, int sign)
const unsigned int _w_var
Definition: naviersystem.C:66
const Real _Re
Definition: naviersystem.C:67
virtual UniquePtr<FunctionBase<Number> > BdyFunction::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::FunctionBase< Number >.

Definition at line 64 of file coupled_system.C.

const unsigned int _v_var
const unsigned int _u_var
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
BdyFunction(unsigned int u_var, unsigned int v_var, int sign)
const Real _sign
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 libMesh::FunctionBase< Number >::init ( )
virtualinherited

The actual initialization process.

Reimplemented in libMesh::MeshFunction, libMesh::MeshlessInterpolationFunction, libMesh::MeshlessInterpolationFunction, and ExampleOneFunction.

Definition at line 81 of file function_base.h.

81 {}
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 BdyFunction::operator() ( 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::FunctionBase< Number >.

Definition at line 34 of file poisson.C.

35  { libmesh_not_implemented(); }
virtual void BdyFunction::operator() ( const Point p,
const Real  ,
DenseVector< Number > &  output 
)
virtual

Definition at line 37 of file poisson.C.

References libMesh::Real, libMesh::DenseVector< T >::resize(), libMesh::x, and libMesh::DenseVector< T >::zero().

40  {
41  output.resize(2);
42  output.zero();
43  const Real x=p(0);
44  // Set the parabolic weighting
45  output(_T_var) = -x * (1 - x);
46  }
void resize(const unsigned int n)
Resize the vector.
Definition: dense_vector.h:350
virtual void zero() libmesh_override
Set every element in the vector to 0.
Definition: dense_vector.h:374
PetscErrorCode Vec x
const unsigned int _T_var
Definition: poisson.C:52
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Number BdyFunction::operator() ( 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::FunctionBase< Number >.

Definition at line 48 of file coupled_system.C.

50  { libmesh_not_implemented(); }
virtual Number BdyFunction::operator() ( 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::FunctionBase< Number >.

Definition at line 48 of file naviersystem.C.

49  { libmesh_not_implemented(); }
virtual void BdyFunction::operator() ( const Point p,
const Real  ,
DenseVector< Number > &  output 
)
virtual

Definition at line 51 of file naviersystem.C.

References libMesh::Real, libMesh::x, and libMesh::DenseVector< T >::zero().

54  {
55  output.zero();
56  const Real x=p(0), y=p(1), z=p(2);
57  output(_u_var) = (_Re+1)*(y*y + z*z);
58  output(_v_var) = (_Re+1)*(x*x + z*z);
59  output(_w_var) = (_Re+1)*(x*x + y*y);
60  }
virtual void zero() libmesh_override
Set every element in the vector to 0.
Definition: dense_vector.h:374
const unsigned int _v_var
const unsigned int _u_var
PetscErrorCode Vec x
const unsigned int _w_var
Definition: naviersystem.C:66
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _Re
Definition: naviersystem.C:67
virtual void BdyFunction::operator() ( const Point p,
const Real  ,
DenseVector< Number > &  output 
)
virtual

Definition at line 52 of file coupled_system.C.

References libMesh::Real, libMesh::DenseVector< T >::resize(), and libMesh::DenseVector< T >::zero().

55  {
56  output.resize(2);
57  output.zero();
58  const Real y=p(1);
59  // Set the parabolic inflow boundary conditions at stations 0 & 1
60  output(_u_var) = (_sign)*((y-2) * (y-3));
61  output(_v_var) = 0;
62  }
void resize(const unsigned int n)
Resize the vector.
Definition: dense_vector.h:350
virtual void zero() libmesh_override
Set every element in the vector to 0.
Definition: dense_vector.h:374
const unsigned int _v_var
const unsigned int _u_var
const Real _sign
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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().

const Real BdyFunction::_Re
private

Definition at line 67 of file naviersystem.C.

const Real BdyFunction::_sign
private

Definition at line 69 of file coupled_system.C.

const unsigned int BdyFunction::_T_var
private

Definition at line 52 of file poisson.C.

const unsigned int BdyFunction::_u_var
private

Definition at line 68 of file coupled_system.C.

const unsigned int BdyFunction::_v_var
private

Definition at line 68 of file coupled_system.C.

const unsigned int BdyFunction::_w_var
private

Definition at line 66 of file naviersystem.C.


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