libMesh
Public Member Functions | Protected Attributes | List of all members
PeriodicQuadFunction Struct Referenceabstract
Inheritance diagram for PeriodicQuadFunction:
[legend]

Public Member Functions

 PeriodicQuadFunction ()=default
 
virtual std::unique_ptr< FunctionBase< Number > > clone () const
 
virtual Number operator() (const Point &, const Real=0.) override
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output) override
 
Number component (unsigned int i, const Point &p, Real) override
 
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...
 
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...
 

Detailed Description

Definition at line 37 of file periodic_bc_test.C.

Constructor & Destructor Documentation

◆ PeriodicQuadFunction()

PeriodicQuadFunction::PeriodicQuadFunction ( )
default

Member Function Documentation

◆ clear()

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

Clears the function.

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

Definition at line 92 of file function_base.h.

92 {}

◆ clone()

virtual std::unique_ptr<FunctionBase<Number> > PeriodicQuadFunction::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 41 of file periodic_bc_test.C.

42  { return std::make_unique<PeriodicQuadFunction>(); }

◆ component()

Number PeriodicQuadFunction::component ( unsigned int  i,
const Point p,
Real  time 
)
inlineoverridevirtual
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.
The default implementation calls operator() with a DenseVector of size i+1 which will result in unexpected behaviour if operator() makes any access beyond that limit.

Reimplemented from libMesh::FunctionBase< Number >.

Definition at line 58 of file periodic_bc_test.C.

References quadratic_solution().

61  {
62  Parameters params;
63  switch (i) {
64  case 0:
65  return quadratic_solution(p, params, "", "");
66  default:
67  libmesh_error();
68  }
69  return 0;
70  }
This class provides the ability to map between arbitrary, user-defined strings and several data types...
Definition: parameters.h:67
Number quadratic_solution(const Point &p, const Parameters &, const std::string &, const std::string &)

◆ init()

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

The actual initialization process.

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

Definition at line 87 of file function_base.h.

87 {}

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

Referenced by libMesh::MeshFunction::disable_out_of_mesh_mode(), libMesh::MeshFunction::discontinuous_gradient(), libMesh::MeshFunction::discontinuous_value(), libMesh::MeshFunction::enable_out_of_mesh_mode(), libMesh::MeshFunction::get_point_locator(), libMesh::MeshFunction::gradient(), libMesh::MeshFunction::hessian(), and libMesh::MeshFunction::operator()().

211 {
212  return (this->_initialized);
213 }
bool _initialized
When init() was called so that everything is ready for calls to operator() (...), then this bool is t...

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

225 {
226  return (this->_is_time_dependent);
227 }
bool _is_time_dependent
Cache whether or not this function is actually time-dependent.

◆ operator()() [1/4]

virtual Number PeriodicQuadFunction::operator() ( const Point p,
const Real  time = 0. 
)
inlineoverridevirtual
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 45 of file periodic_bc_test.C.

47  { libmesh_error(); }

◆ operator()() [2/4]

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

Definition at line 49 of file periodic_bc_test.C.

References quadratic_solution(), and libMesh::DenseVector< T >::size().

52  {
53  libmesh_assert_equal_to(output.size(), 1);
54  Parameters params;
55  output(0) = quadratic_solution(p, params, "", "");
56  }
This class provides the ability to map between arbitrary, user-defined strings and several data types...
Definition: parameters.h:67
virtual unsigned int size() const override final
Definition: dense_vector.h:104
Number quadratic_solution(const Point &p, const Parameters &, const std::string &, const std::string &)

◆ operator()() [3/4]

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

247 {
248  // Call the time-dependent function with t=0.
249  this->operator()(p, 0., output);
250 }
virtual Number operator()(const Point &p, const Real time=0.)=0

◆ operator()() [4/4]

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

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

218 {
220 }
bool _is_time_dependent
Cache whether or not this function is actually time-dependent.

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

Referenced by libMesh::MeshFunction::clear(), and libMesh::MeshFunction::init().

◆ _is_time_dependent

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

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

Definition at line 189 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 178 of file function_base.h.

Referenced by libMesh::MeshFunction::clear(), libMesh::MeshFunction::find_element(), and libMesh::MeshFunction::find_elements().


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