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 std::unique_ptr< 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 std::unique_ptr< 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 std::unique_ptr< 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 nullptr. 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 38 of file coupled_system.C.

Constructor & Destructor Documentation

◆ BdyFunction() [1/3]

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

Definition at line 41 of file coupled_system.C.

43  :
44  _u_var(u_var),
45  _v_var(v_var),
46  _sign(sign)
47  { this->_initialized = true; }

◆ BdyFunction() [2/3]

BdyFunction::BdyFunction ( unsigned int  T_var)
inline

Definition at line 31 of file poisson.C.

32  : _T_var(T_var)
33  { this->_initialized = true; }

◆ BdyFunction() [3/3]

BdyFunction::BdyFunction ( unsigned int  u_var,
unsigned int  v_var,
unsigned int  w_var,
Real  Reynolds 
)
inline

Definition at line 42 of file naviersystem.C.

46  : _u_var(u_var), _v_var(v_var), _w_var(w_var), _Re(Reynolds)
47  { this->_initialized = true; }

Member Function Documentation

◆ clear()

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

Clears the function.

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

Definition at line 91 of file function_base.h.

91 {}

◆ clone() [1/3]

virtual std::unique_ptr<FunctionBase<Number> > BdyFunction::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::FunctionBase< Number >.

Definition at line 49 of file poisson.C.

50  { return libmesh_make_unique<BdyFunction>(_T_var); }

◆ clone() [2/3]

virtual std::unique_ptr<FunctionBase<Number> > BdyFunction::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::FunctionBase< Number >.

Definition at line 63 of file naviersystem.C.

64  { return libmesh_make_unique<BdyFunction>(_u_var, _v_var, _w_var, _Re); }

◆ clone() [3/3]

virtual std::unique_ptr<FunctionBase<Number> > BdyFunction::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::FunctionBase< Number >.

Definition at line 65 of file coupled_system.C.

66  { return libmesh_make_unique<BdyFunction>(_u_var, _v_var, int(_sign)); }

◆ component()

Number libMesh::FunctionBase< Number >::component ( unsigned int  i,
const Point p,
Real  time = 0. 
)
inlinevirtualinherited
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 TripleFunction, SolutionFunction, SolutionFunction, and SolutionFunction.

Definition at line 227 of file function_base.h.

230 {
231  DenseVector<Output> outvec(i+1);
232  (*this)(p, time, outvec);
233  return outvec(i);
234 }

◆ init()

virtual void libMesh::FunctionBase< Number >::init ( )
inlinevirtualinherited

The actual initialization process.

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

Definition at line 86 of file function_base.h.

86 {}

◆ initialized()

bool libMesh::FunctionBase< Number >::initialized ( ) const
inlineinherited
Returns
true when this object is properly initialized and ready for use, false otherwise.

Definition at line 205 of file function_base.h.

206 {
207  return (this->_initialized);
208 }

◆ is_time_dependent()

bool libMesh::FunctionBase< Number >::is_time_dependent ( ) const
inlineinherited
Returns
true when the function this object represents is actually time-dependent, false otherwise.

Definition at line 219 of file function_base.h.

220 {
221  return (this->_is_time_dependent);
222 }

◆ operator()() [1/8]

virtual Number BdyFunction::operator() ( const Point p,
const  time = 0 
)
inlinevirtual
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 35 of file poisson.C.

36  { libmesh_not_implemented(); }

◆ operator()() [2/8]

virtual Number BdyFunction::operator() ( const Point p,
const  time = 0 
)
inlinevirtual
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 49 of file coupled_system.C.

51  { libmesh_not_implemented(); }

◆ operator()() [3/8]

virtual Number BdyFunction::operator() ( const Point p,
const  time = 0 
)
inlinevirtual
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 49 of file naviersystem.C.

50  { libmesh_not_implemented(); }

◆ operator()() [4/8]

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.

◆ operator()() [5/8]

virtual void BdyFunction::operator() ( const Point p,
const  Real,
DenseVector< Number > &  output 
)
inlinevirtual

Definition at line 38 of file poisson.C.

41  {
42  output.resize(2);
43  output.zero();
44  const Real x=p(0);
45  // Set the parabolic weighting
46  output(_T_var) = -x * (1 - x);
47  }

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

◆ operator()() [6/8]

virtual void BdyFunction::operator() ( const Point p,
const  Real,
DenseVector< Number > &  output 
)
inlinevirtual

Definition at line 52 of file naviersystem.C.

55  {
56  output.zero();
57  const Real x=p(0), y=p(1), z=p(2);
58  output(_u_var) = (_Re+1)*(y*y + z*z);
59  output(_v_var) = (_Re+1)*(x*x + z*z);
60  output(_w_var) = (_Re+1)*(x*x + y*y);
61  }

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

◆ operator()() [7/8]

virtual void BdyFunction::operator() ( const Point p,
const  Real,
DenseVector< Number > &  output 
)
inlinevirtual

Definition at line 53 of file coupled_system.C.

56  {
57  output.resize(2);
58  output.zero();
59  const Real y=p(1);
60  // Set the parabolic inflow boundary conditions at stations 0 & 1
61  output(_u_var) = (_sign)*((y-2) * (y-3));
62  output(_v_var) = 0;
63  }

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

◆ operator()() [8/8]

void libMesh::FunctionBase< Number >::operator() ( const Point p,
DenseVector< Number > &  output 
)
inlineinherited

Evaluation function for time-independent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Definition at line 240 of file function_base.h.

242 {
243  // Call the time-dependent function with t=0.
244  this->operator()(p, 0., output);
245 }

◆ set_is_time_dependent()

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

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.

Definition at line 212 of file function_base.h.

213 {
215 }

Member Data Documentation

◆ _initialized

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 179 of file function_base.h.

◆ _is_time_dependent

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

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

Definition at line 184 of file function_base.h.

◆ _master

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

Const pointer to our master, initialized to nullptr.

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

Definition at line 173 of file function_base.h.

◆ _Re

const Real BdyFunction::_Re
private

Definition at line 68 of file naviersystem.C.

◆ _sign

const Real BdyFunction::_sign
private

Definition at line 70 of file coupled_system.C.

◆ _T_var

const unsigned int BdyFunction::_T_var
private

Definition at line 53 of file poisson.C.

◆ _u_var

const unsigned int BdyFunction::_u_var
private

Definition at line 69 of file coupled_system.C.

◆ _v_var

const unsigned int BdyFunction::_v_var
private

Definition at line 69 of file coupled_system.C.

◆ _w_var

const unsigned int BdyFunction::_w_var
private

Definition at line 67 of file naviersystem.C.


The documentation for this class was generated from the following files:
BdyFunction::_Re
const Real _Re
Definition: naviersystem.C:68
libMesh::FunctionBase< Number >::is_time_dependent
bool is_time_dependent() const
Definition: function_base.h:219
BdyFunction::_v_var
const unsigned int _v_var
Definition: coupled_system.C:69
BdyFunction::_u_var
const unsigned int _u_var
Definition: coupled_system.C:69
libMesh::DenseVector::zero
virtual void zero() override
Set every element in the vector to 0.
Definition: dense_vector.h:379
libMesh::FunctionBase< Number >::_is_time_dependent
bool _is_time_dependent
Cache whether or not this function is actually time-dependent.
Definition: function_base.h:184
BdyFunction::_sign
const Real _sign
Definition: coupled_system.C:70
libMesh::FunctionBase< Number >::_initialized
bool _initialized
When init() was called so that everything is ready for calls to operator() (...), then this bool is t...
Definition: function_base.h:179
BdyFunction::_T_var
const unsigned int _T_var
Definition: poisson.C:53
BdyFunction::_w_var
const unsigned int _w_var
Definition: naviersystem.C:67
libMesh::DenseVector::resize
void resize(const unsigned int n)
Resize the vector.
Definition: dense_vector.h:355
libMesh::FunctionBase< Number >::operator()
virtual Number operator()(const Point &p, const Real time=0.)=0
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121