GRINS-0.8.0
List of all members | Protected Member Functions | Protected Attributes
GRINSTesting::SystemHelper Class Reference

Helper class for setting up basic GRINS::MultiphysicsSystem for unit testing. More...

#include <system_helper.h>

Inheritance diagram for GRINSTesting::SystemHelper:
Inheritance graph
[legend]
Collaboration diagram for GRINSTesting::SystemHelper:
Collaboration graph
[legend]

Protected Member Functions

void setup_multiphysics_system (const std::string &filename)
 
void reset_all ()
 

Protected Attributes

libMesh::UniquePtr< GetPot > _input
 
GRINS::SharedPtr< libMesh::UnstructuredMesh > _mesh
 
libMesh::UniquePtr< libMesh::EquationSystems > _es
 
GRINS::MultiphysicsSystem_system
 

Detailed Description

Helper class for setting up basic GRINS::MultiphysicsSystem for unit testing.

Definition at line 38 of file system_helper.h.

Member Function Documentation

void GRINSTesting::SystemHelper::reset_all ( )
inlineprotected

Definition at line 55 of file system_helper.h.

References _es, _input, and _mesh.

Referenced by GRINSTesting::BuilderHelperTest::tearDown(), GRINSTesting::DefaultBCBuilderTest::tearDown(), and GRINSTesting::VariablesTest::tearDown().

56  {
57  _input.reset();
58  _es.reset(); // This will delete the system
59  _mesh.reset();
60  }
GRINS::SharedPtr< libMesh::UnstructuredMesh > _mesh
Definition: system_helper.h:63
libMesh::UniquePtr< libMesh::EquationSystems > _es
Definition: system_helper.h:64
libMesh::UniquePtr< GetPot > _input
Definition: system_helper.h:62
void GRINSTesting::SystemHelper::setup_multiphysics_system ( const std::string &  filename)
inlineprotected

Definition at line 42 of file system_helper.h.

References _es, _input, _mesh, _system, GRINS::MeshBuilder::build(), GRINS::MultiphysicsSystem::read_input_options(), and TestCommWorld.

Referenced by GRINSTesting::DefaultBCBuilderTest::test_parse_periodic_master_slave_ids(), GRINSTesting::DefaultBCBuilderTest::test_parse_periodic_offset(), GRINSTesting::BuilderHelperTest::test_parse_var_sections(), GRINSTesting::VariablesTest::test_var_constraint(), GRINSTesting::VariablesTest::test_variable_arbitrary_names(), GRINSTesting::VariablesTest::test_variable_builder(), and GRINSTesting::DefaultBCBuilderTest::test_verify_bc_ids_with_mesh().

43  {
44  _input.reset( new GetPot(filename) );
45  GRINS::MeshBuilder mesh_builder;
46  _mesh = mesh_builder.build( *_input, *TestCommWorld );
47  _es.reset( new libMesh::EquationSystems(*_mesh) );
48  _system = &_es->add_system<GRINS::MultiphysicsSystem>( "GRINS-TEST" );
49 
50  // We may not need any of these options, but this does some setup work that's needed
51  // and all the options have sane defaults if they're not in the testing input file.
53  }
GRINS::SharedPtr< libMesh::UnstructuredMesh > _mesh
Definition: system_helper.h:63
libMesh::Parallel::Communicator * TestCommWorld
Definition: unit_driver.C:70
libMesh::UniquePtr< libMesh::EquationSystems > _es
Definition: system_helper.h:64
Interface with libMesh for solving Multiphysics problems.
GRINS::MultiphysicsSystem * _system
Definition: system_helper.h:67
SharedPtr< libMesh::UnstructuredMesh > build(const GetPot &input, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
Builds the libMesh::Mesh according to input options.
Definition: mesh_builder.C:46
libMesh::UniquePtr< GetPot > _input
Definition: system_helper.h:62
virtual void read_input_options(const GetPot &input)
Reads input options for this class and all physics that are enabled.

Member Data Documentation

libMesh::UniquePtr<libMesh::EquationSystems> GRINSTesting::SystemHelper::_es
protected

Definition at line 64 of file system_helper.h.

Referenced by reset_all(), and setup_multiphysics_system().

libMesh::UniquePtr<GetPot> GRINSTesting::SystemHelper::_input
protected
GRINS::SharedPtr<libMesh::UnstructuredMesh> GRINSTesting::SystemHelper::_mesh
protected

Definition at line 63 of file system_helper.h.

Referenced by reset_all(), and setup_multiphysics_system().

GRINS::MultiphysicsSystem* GRINSTesting::SystemHelper::_system
protected

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

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