GRINS-0.7.0
system_helper.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 // GRINS
26 #include "grins/shared_ptr.h"
27 #include "grins/multiphysics_sys.h"
28 #include "grins/mesh_builder.h"
29 
30 // libMesh
31 #include "libmesh/getpot.h"
32 #include "libmesh/unstructured_mesh.h"
33 #include "libmesh/equation_systems.h"
34 
35 namespace GRINSTesting
36 {
39  {
40  protected:
41 
42  void setup_multiphysics_system(const std::string& filename)
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 
51  void reset_all()
52  {
53  _input.reset();
54  _es.reset(); // This will delete the system
55  _mesh.reset();
56  }
57 
58  libMesh::UniquePtr<GetPot> _input;
59  GRINS::SharedPtr<libMesh::UnstructuredMesh> _mesh;
60  libMesh::UniquePtr<libMesh::EquationSystems> _es;
61 
62  // Needs to be an ordinar pointer since EquationSystems owns this
64  };
65 
66 } // end namespace GRINSTesting
void setup_multiphysics_system(const std::string &filename)
Definition: system_helper.h:42
GRINS::SharedPtr< libMesh::UnstructuredMesh > _mesh
Definition: system_helper.h:59
libMesh::Parallel::Communicator * TestCommWorld
Definition: unit_driver.C:65
Helper class for setting up basic GRINS::MultiphysicsSystem for unit testing.
Definition: system_helper.h:38
libMesh::UniquePtr< libMesh::EquationSystems > _es
Definition: system_helper.h:60
Interface with libMesh for solving Multiphysics problems.
GRINS::MultiphysicsSystem * _system
Definition: system_helper.h:63
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:58

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