GRINS-0.8.0
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Member Functions
GRINS::ErrorEstimatorFactoryBase Class Referenceabstract

Builds VariableBase objects. More...

#include <error_estimator_factory_base.h>

Inheritance diagram for GRINS::ErrorEstimatorFactoryBase:
Inheritance graph
[legend]
Collaboration diagram for GRINS::ErrorEstimatorFactoryBase:
Collaboration graph
[legend]

Public Member Functions

 ErrorEstimatorFactoryBase (const std::string &estimator_name)
 
 ~ErrorEstimatorFactoryBase ()
 
- Public Member Functions inherited from GRINS::FactoryWithGetPot< libMesh::ErrorEstimator >
 FactoryWithGetPot (const std::string &name)
 
 ~FactoryWithGetPot ()
 
- Public Member Functions inherited from GRINS::FactoryAbstract< libMesh::ErrorEstimator >
virtual ~FactoryAbstract ()
 

Static Public Member Functions

static void set_system (MultiphysicsSystem &system)
 
static void set_estimator_options (const ErrorEstimatorOptions &estimator_options)
 
- Static Public Member Functions inherited from GRINS::FactoryWithGetPot< libMesh::ErrorEstimator >
static void set_getpot (const GetPot &input)
 
- Static Public Member Functions inherited from GRINS::FactoryAbstract< libMesh::ErrorEstimator >
static libMesh::UniquePtr< libMesh::ErrorEstimator > build (const std::string &name)
 Use this method to build objects of type Base. More...
 

Protected Member Functions

virtual libMesh::UniquePtr< libMesh::ErrorEstimator > build_error_estimator (const GetPot &input, MultiphysicsSystem &system, const ErrorEstimatorOptions &estimator_options)=0
 Subclasses implement this method for building the ErrorEstimator object. More...
 
- Protected Member Functions inherited from GRINS::FactoryAbstract< libMesh::ErrorEstimator >
 FactoryAbstract (const std::string &name)
 Constructor is protected. Use the build() method to construct Base objects. More...
 

Static Protected Attributes

static MultiphysicsSystem_system = NULL
 Cache pointer to system. More...
 
static const ErrorEstimatorOptions_estimator_options = NULL
 Cache pointer to system. More...
 
- Static Protected Attributes inherited from GRINS::FactoryWithGetPot< libMesh::ErrorEstimator >
static const GetPot * _input
 We store only a raw pointer here because we can't make a copy. More...
 

Private Member Functions

virtual libMesh::UniquePtr< libMesh::ErrorEstimator > create ()
 Subclasses implement the actual construction of the Base object in create(). More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from GRINS::FactoryAbstract< libMesh::ErrorEstimator >
static FactoryAbstract< libMesh::ErrorEstimator > & get_factory (const std::string &name)
 Helper method that looks up the factory and returns it if present, or error if it's not. More...
 
static DerivedType & get_factory_subclass (const std::string &name)
 Like get_factory, but will downcast to DerivedType. More...
 
static std::map< std::string, FactoryAbstract< libMesh::ErrorEstimator > * > & factory_map ()
 

Detailed Description

Builds VariableBase objects.

Most variable classes only require a GetPot object to the constructor, but others may require more information. Subclasses can dictate the necessary behavior.

Definition at line 46 of file error_estimator_factory_base.h.

Constructor & Destructor Documentation

GRINS::ErrorEstimatorFactoryBase::ErrorEstimatorFactoryBase ( const std::string &  estimator_name)
inline

Definition at line 49 of file error_estimator_factory_base.h.

50  : FactoryWithGetPot<libMesh::ErrorEstimator>(estimator_name)
51  {}
GRINS::ErrorEstimatorFactoryBase::~ErrorEstimatorFactoryBase ( )
inline

Definition at line 53 of file error_estimator_factory_base.h.

53 {};

Member Function Documentation

virtual libMesh::UniquePtr<libMesh::ErrorEstimator> GRINS::ErrorEstimatorFactoryBase::build_error_estimator ( const GetPot &  input,
MultiphysicsSystem system,
const ErrorEstimatorOptions estimator_options 
)
protectedpure virtual
libMesh::UniquePtr< libMesh::ErrorEstimator > GRINS::ErrorEstimatorFactoryBase::create ( )
inlineprivatevirtual

Subclasses implement the actual construction of the Base object in create().

Implements GRINS::FactoryAbstract< libMesh::ErrorEstimator >.

Definition at line 84 of file error_estimator_factory_base.h.

References _estimator_options, GRINS::FactoryWithGetPot< libMesh::ErrorEstimator >::_input, _system, and build_error_estimator().

85  {
86  if( !_input )
87  libmesh_error_msg("ERROR: must call set_getpot() before building ErrorEstimator!");
88  if( !_system )
89  libmesh_error_msg("ERROR: must call set_system() before building ErrorEstimator!");
90  if( !_estimator_options )
91  libmesh_error_msg("ERROR: must call set_estimator_options() before building ErrorEstimator!");
92 
93  libMesh::UniquePtr<libMesh::ErrorEstimator>
94  new_estimator = this->build_error_estimator( *_input, *_system, *_estimator_options );
95 
96  libmesh_assert(new_estimator);
97 
98  return new_estimator;
99  }
static const ErrorEstimatorOptions * _estimator_options
Cache pointer to system.
virtual libMesh::UniquePtr< libMesh::ErrorEstimator > build_error_estimator(const GetPot &input, MultiphysicsSystem &system, const ErrorEstimatorOptions &estimator_options)=0
Subclasses implement this method for building the ErrorEstimator object.
static const GetPot * _input
We store only a raw pointer here because we can't make a copy.
static MultiphysicsSystem * _system
Cache pointer to system.
static void GRINS::ErrorEstimatorFactoryBase::set_estimator_options ( const ErrorEstimatorOptions estimator_options)
inlinestatic

Definition at line 58 of file error_estimator_factory_base.h.

References _estimator_options.

Referenced by GRINS::Simulation::build_error_estimator().

59  { _estimator_options = &estimator_options; }
static const ErrorEstimatorOptions * _estimator_options
Cache pointer to system.
static void GRINS::ErrorEstimatorFactoryBase::set_system ( MultiphysicsSystem system)
inlinestatic

Definition at line 55 of file error_estimator_factory_base.h.

References _system.

Referenced by GRINS::Simulation::build_error_estimator().

56  { _system = &system; }
static MultiphysicsSystem * _system
Cache pointer to system.

Member Data Documentation

const ErrorEstimatorOptions * GRINS::ErrorEstimatorFactoryBase::_estimator_options = NULL
staticprotected

Cache pointer to system.

We do not own this so do not delete!

Definition at line 75 of file error_estimator_factory_base.h.

Referenced by create(), and set_estimator_options().

MultiphysicsSystem * GRINS::ErrorEstimatorFactoryBase::_system = NULL
staticprotected

Cache pointer to system.

We can't copy this so it must be a pointer. We do not own this so do not delete!

Definition at line 71 of file error_estimator_factory_base.h.

Referenced by create(), and set_system().


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

Generated on Tue Dec 19 2017 12:47:30 for GRINS-0.8.0 by  doxygen 1.8.9.1