SpatialOps
SpatialOps::OperatorDatabase Class Reference

Provides a database to hold operators of any type. More...

#include <OperatorDatabase.h>

Public Member Functions

template<typename OpT >
int register_new_operator (OpT *const op)
 Register a new operator of the given type. More...
 
template<typename OpT >
int register_new_bc_operator ()
 
template<typename OpT >
OpT * retrieve_operator (const int id=-1) const
 Retrieve an operator of the requested type. More...
 
void empty_database ()
 Remove all operators of all types.
 

Detailed Description

Provides a database to hold operators of any type.

Author
James C. Sutherland
Date
July, 2008
Example Usage

The OperatorDatabase can be easily pre-populated with most of the natively supported operator types in SpatialOps by using the build_stencils() function.

Definition at line 58 of file OperatorDatabase.h.

Member Function Documentation

◆ register_new_bc_operator()

template<typename OpT >
int SpatialOps::OperatorDatabase::register_new_bc_operator ( )

Given the operator type, register the associated BC operator.

Example:

opDB.register_new_bc_operator<InterpX>();
typedef NeboBoundaryConditionBuilder<InterpX> DirichletBCOpX;
DirichletBCOpX* dirichletX = opDB.retrieve_operator<DirichletBCOpX>();

Definition at line 190 of file OperatorDatabase.h.

References register_new_operator().

Here is the call graph for this function:

◆ register_new_operator()

template<typename OpT >
int SpatialOps::OperatorDatabase::register_new_operator ( OpT *const  op)

Register a new operator of the given type.

Parameters
opThe operator to register. Ownership is transfered. This should be heap-allocated via "new".

Example:

opDB.register_new_operator( new MyOpType(...) );

Definition at line 163 of file OperatorDatabase.h.

Referenced by SpatialOps::build_stencils(), and register_new_bc_operator().

Here is the caller graph for this function:

◆ retrieve_operator()

template<typename OpT >
OpT * SpatialOps::OperatorDatabase::retrieve_operator ( const int  id = -1) const
inline

Retrieve an operator of the requested type.

Parameters
idIn the case where more than one operator of this type has been registered, this specifies the identifier for the desired operator. This argument may be omitted. However, if omitted and multiple operators of this type are registered, an exception will be thrown.

Definition at line 199 of file OperatorDatabase.h.


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