GRINS-0.7.0
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions
GRINS::PhysicsFactoryBase Class Referenceabstract

Builds Physics objects, used by PhysicsBuilder. More...

#include <physics_factory_base.h>

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

Public Member Functions

 PhysicsFactoryBase (const std::string &physics_name)
 
 ~PhysicsFactoryBase ()
 
- Public Member Functions inherited from GRINS::FactoryWithGetPotPhysicsName< Physics >
 FactoryWithGetPotPhysicsName (const std::string &name)
 
 ~FactoryWithGetPotPhysicsName ()
 
- Public Member Functions inherited from GRINS::FactoryWithGetPot< Physics >
 FactoryWithGetPot (const std::string &name)
 
 ~FactoryWithGetPot ()
 

Protected Member Functions

virtual libMesh::UniquePtr< Physicsbuild_physics (const GetPot &input, const std::string &physics_name)=0
 

Private Member Functions

virtual libMesh::UniquePtr< Physicscreate ()
 

Additional Inherited Members

- Static Public Member Functions inherited from GRINS::FactoryWithGetPotPhysicsName< Physics >
static void set_physics_name (const std::string &physics_name)
 Setter for physics name. More...
 
- Static Public Member Functions inherited from GRINS::FactoryWithGetPot< Physics >
static void set_getpot (const GetPot &input)
 
- Static Protected Attributes inherited from GRINS::FactoryWithGetPotPhysicsName< Physics >
static std::string _physics_name
 
- Static Protected Attributes inherited from GRINS::FactoryWithGetPot< Physics >
static const GetPot * _input
 We store only a raw pointer here because we can't make a copy. More...
 

Detailed Description

Builds Physics objects, used by PhysicsBuilder.

The user may subclass this class for more building more complex Physics objects. Because Physics objects require a GetPot input file object and the physics_name at construction time, both set_getpot() and set_physics_name() MUST be called before build() function. Note that set_physics_name() MUST be called each time a new Physics is built.

Definition at line 40 of file physics_factory_base.h.

Constructor & Destructor Documentation

GRINS::PhysicsFactoryBase::PhysicsFactoryBase ( const std::string &  physics_name)
inline

Definition at line 43 of file physics_factory_base.h.

44  : FactoryWithGetPotPhysicsName<Physics>(physics_name)
45  {}
GRINS::PhysicsFactoryBase::~PhysicsFactoryBase ( )
inline

Definition at line 47 of file physics_factory_base.h.

47 {};

Member Function Documentation

virtual libMesh::UniquePtr<Physics> GRINS::PhysicsFactoryBase::build_physics ( const GetPot &  input,
const std::string &  physics_name 
)
protectedpure virtual
libMesh::UniquePtr< Physics > GRINS::PhysicsFactoryBase::create ( )
inlineprivatevirtual

Definition at line 61 of file physics_factory_base.h.

References GRINS::FactoryWithGetPot< Physics >::_input, GRINS::FactoryWithGetPotPhysicsName< Physics >::_physics_name, and build_physics().

62  {
63  // Make sure user set the physics name
64  if( _physics_name == std::string("DIE!") )
65  libmesh_error_msg("ERROR: must call set_physics_name() before building Physics!");
66 
67  if( !_input )
68  libmesh_error_msg("ERROR: must call set_getpot() before building Physics!");
69 
70  libMesh::UniquePtr<Physics> new_physics = this->build_physics( *_input, _physics_name );
71 
72  // Reset the _physics_name for error checking
73  _physics_name = std::string("DIE!");
74 
75  libmesh_assert(new_physics);
76 
77  return new_physics;
78  }
static const GetPot * _input
We store only a raw pointer here because we can't make a copy.
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)=0

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

Generated on Thu Jun 2 2016 21:52:32 for GRINS-0.7.0 by  doxygen 1.8.10