GRINS-0.7.0
simulation_builder.C
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 
26 // This class
28 
29 // libMesh
30 #include "libmesh/error_estimator.h"
31 #include "libmesh/adjoint_refinement_estimator.h"
32 
33 namespace GRINS
34 {
36  : _mesh_builder( new MeshBuilder ),
37  _solver_factory( new SolverFactory ),
38  _vis_factory( new VisualizationFactory ),
39  _qoi_factory( new QoIFactory ),
40  _postprocessing_factory( new PostprocessingFactory )
41  {}
42 
43  void SimulationBuilder::attach_solver_factory( SharedPtr<SolverFactory> solver_factory )
44  {
45  this->_solver_factory = solver_factory;
46  return;
47  }
48 
49  void SimulationBuilder::attach_mesh_builder( SharedPtr<MeshBuilder> mesh_builder )
50  {
52  return;
53  }
54 
55  void SimulationBuilder::attach_vis_factory( SharedPtr<VisualizationFactory> vis_factory )
56  {
57  this->_vis_factory = vis_factory;
58  return;
59  }
60 
61  void SimulationBuilder::attach_qoi_factory( SharedPtr<QoIFactory> qoi_factory )
62  {
63  this->_qoi_factory = qoi_factory;
64  }
65 
66  void SimulationBuilder::attach_postprocessing_factory( SharedPtr<PostprocessingFactory> postprocessing_factory )
67  {
68  this->_postprocessing_factory = postprocessing_factory;
69  }
70 
71  SharedPtr<libMesh::UnstructuredMesh> SimulationBuilder::build_mesh
72  ( const GetPot& input,
73  const libMesh::Parallel::Communicator &comm)
74  {
75  return (this->_mesh_builder)->build(input, comm);
76  }
77 
78  SharedPtr<GRINS::Solver> SimulationBuilder::build_solver( const GetPot& input )
79  {
80  return (this->_solver_factory)->build(input);
81  }
82 
83  SharedPtr<GRINS::Visualization> SimulationBuilder::build_vis
84  ( const GetPot& input,
85  const libMesh::Parallel::Communicator &comm)
86  {
87  return (this->_vis_factory)->build(input, comm);
88  }
89 
90  SharedPtr<CompositeQoI> SimulationBuilder::build_qoi( const GetPot& input )
91  {
92  return (this->_qoi_factory)->build(input);
93  }
94 
95  SharedPtr<PostProcessedQuantities<libMesh::Real> >
97  {
98  return (this->_postprocessing_factory)->build(input);
99  }
100 
102  {
103  return *_mesh_builder;
104  }
105 
106 } //namespace GRINS
SharedPtr< GRINS::Solver > build_solver(const GetPot &input)
SharedPtr< SolverFactory > _solver_factory
SharedPtr< VisualizationFactory > _vis_factory
SharedPtr< CompositeQoI > build_qoi(const GetPot &input)
GRINS namespace.
const MeshBuilder & mesh_builder() const
SharedPtr< QoIFactory > _qoi_factory
void attach_mesh_builder(SharedPtr< MeshBuilder > mesh_builder)
This object handles constructing the solver to be used.
SharedPtr< PostprocessingFactory > _postprocessing_factory
This object handles constructing the postprocessing object to be used.
void attach_vis_factory(SharedPtr< VisualizationFactory > vis_factory)
SharedPtr< MeshBuilder > _mesh_builder
void attach_solver_factory(SharedPtr< SolverFactory > solver_factory)
void attach_qoi_factory(SharedPtr< QoIFactory > qoi_factory)
SharedPtr< GRINS::Visualization > build_vis(const GetPot &input, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
SharedPtr< PostProcessedQuantities< libMesh::Real > > build_postprocessing(const GetPot &input)
SharedPtr< libMesh::UnstructuredMesh > build_mesh(const GetPot &input, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
void attach_postprocessing_factory(SharedPtr< PostprocessingFactory > postprocessing_factory)

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