GRINS-0.6.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-2015 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  : _physics_factory( new PhysicsFactory ),
37  _mesh_builder( new MeshBuilder ),
38  _solver_factory( new SolverFactory ),
39  _vis_factory( new VisualizationFactory ),
40  _bc_factory( new BoundaryConditionsFactory ),
41  _qoi_factory( new QoIFactory ),
42  _postprocessing_factory( new PostprocessingFactory ),
43  _error_estimator_factory( new ErrorEstimatorFactory )
44  {
45  return;
46  }
47 
49  {
50  return;
51  }
52 
53  void SimulationBuilder::attach_physics_factory( std::tr1::shared_ptr<PhysicsFactory> physics_factory )
54  {
55  this->_physics_factory = physics_factory;
56  return;
57  }
58 
59  void SimulationBuilder::attach_solver_factory( std::tr1::shared_ptr<SolverFactory> solver_factory )
60  {
61  this->_solver_factory = solver_factory;
62  return;
63  }
64 
65  void SimulationBuilder::attach_mesh_builder( std::tr1::shared_ptr<MeshBuilder> mesh_builder )
66  {
68  return;
69  }
70 
71  void SimulationBuilder::attach_vis_factory( std::tr1::shared_ptr<VisualizationFactory> vis_factory )
72  {
73  this->_vis_factory = vis_factory;
74  return;
75  }
76 
77  void SimulationBuilder::attach_bc_factory( std::tr1::shared_ptr<BoundaryConditionsFactory> bc_factory )
78  {
79  this->_bc_factory = bc_factory;
80  return;
81  }
82 
83  void SimulationBuilder::attach_qoi_factory( std::tr1::shared_ptr<QoIFactory> qoi_factory )
84  {
85  this->_qoi_factory = qoi_factory;
86  }
87 
88  void SimulationBuilder::attach_postprocessing_factory( std::tr1::shared_ptr<PostprocessingFactory> postprocessing_factory )
89  {
90  this->_postprocessing_factory = postprocessing_factory;
91  }
92 
93  void SimulationBuilder::attach_error_estimator_factory( std::tr1::shared_ptr<ErrorEstimatorFactory> error_estimator_factory )
94  {
95  this->_error_estimator_factory = error_estimator_factory;
96  }
97 
98  std::tr1::shared_ptr<libMesh::UnstructuredMesh> SimulationBuilder::build_mesh
99  ( const GetPot& input,
100  const libMesh::Parallel::Communicator &comm)
101  {
102  return (this->_mesh_builder)->build(input, comm);
103  }
104 
106  {
107  return (this->_physics_factory)->build(input);
108  }
109 
110  std::tr1::shared_ptr<GRINS::Solver> SimulationBuilder::build_solver( const GetPot& input )
111  {
112  return (this->_solver_factory)->build(input);
113  }
114 
115  std::tr1::shared_ptr<GRINS::Visualization> SimulationBuilder::build_vis
116  ( const GetPot& input,
117  const libMesh::Parallel::Communicator &comm)
118  {
119  return (this->_vis_factory)->build(input, comm);
120  }
121 
122  std::multimap< GRINS::PhysicsName, GRINS::DBCContainer > SimulationBuilder::build_dirichlet_bcs()
123  {
124  return (this->_bc_factory)->build_dirichlet();
125  }
126 
127  std::map< GRINS::PhysicsName, GRINS::NBCContainer > SimulationBuilder::build_neumann_bcs( libMesh::EquationSystems& equation_system )
128  {
129  return (this->_bc_factory)->build_neumann(equation_system);
130  }
131 
132  std::tr1::shared_ptr<CompositeQoI> SimulationBuilder::build_qoi( const GetPot& input )
133  {
134  return (this->_qoi_factory)->build(input);
135  }
136 
137  std::tr1::shared_ptr<PostProcessedQuantities<libMesh::Real> >
139  {
140  return (this->_postprocessing_factory)->build(input);
141  }
142 
143  std::tr1::shared_ptr<libMesh::ErrorEstimator> SimulationBuilder::build_error_estimator( const GetPot& input,
144  const libMesh::QoISet& qoi_set)
145  {
146  return (this->_error_estimator_factory)->build(input,qoi_set);
147  }
148 
150  {
151  return *_mesh_builder;
152  }
153 
154 } //namespace GRINS
std::tr1::shared_ptr< CompositeQoI > build_qoi(const GetPot &input)
std::map< std::string, std::tr1::shared_ptr< GRINS::Physics > > PhysicsList
Container for GRINS::Physics object pointers.
Definition: var_typedefs.h:57
std::tr1::shared_ptr< libMesh::ErrorEstimator > build_error_estimator(const GetPot &input, const libMesh::QoISet &qoi_set)
Object for constructing boundary condition function objects.
Definition: bc_factory.h:50
void attach_mesh_builder(std::tr1::shared_ptr< MeshBuilder > mesh_builder)
std::tr1::shared_ptr< PostProcessedQuantities< libMesh::Real > > build_postprocessing(const GetPot &input)
void attach_qoi_factory(std::tr1::shared_ptr< QoIFactory > qoi_factory)
std::tr1::shared_ptr< BoundaryConditionsFactory > _bc_factory
std::map< GRINS::PhysicsName, GRINS::NBCContainer > build_neumann_bcs(libMesh::EquationSystems &equation_system)
void attach_vis_factory(std::tr1::shared_ptr< VisualizationFactory > vis_factory)
void attach_solver_factory(std::tr1::shared_ptr< SolverFactory > solver_factory)
GRINS namespace.
std::tr1::shared_ptr< MeshBuilder > _mesh_builder
std::tr1::shared_ptr< GRINS::Solver > build_solver(const GetPot &input)
GRINS::PhysicsList build_physics(const GetPot &input)
Object for constructing list of physics for simulation.
const MeshBuilder & mesh_builder() const
std::tr1::shared_ptr< ErrorEstimatorFactory > _error_estimator_factory
std::multimap< GRINS::PhysicsName, GRINS::DBCContainer > build_dirichlet_bcs()
void attach_postprocessing_factory(std::tr1::shared_ptr< PostprocessingFactory > postprocessing_factory)
std::tr1::shared_ptr< SolverFactory > _solver_factory
void attach_physics_factory(std::tr1::shared_ptr< PhysicsFactory > physics_factory)
This object handles constructing the solver to be used.
std::tr1::shared_ptr< QoIFactory > _qoi_factory
void attach_error_estimator_factory(std::tr1::shared_ptr< ErrorEstimatorFactory > error_estimator_factory)
This object handles constructing the postprocessing object to be used.
std::tr1::shared_ptr< PhysicsFactory > _physics_factory
std::tr1::shared_ptr< libMesh::UnstructuredMesh > build_mesh(const GetPot &input, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
std::tr1::shared_ptr< VisualizationFactory > _vis_factory
void attach_bc_factory(std::tr1::shared_ptr< BoundaryConditionsFactory > bc_factory)
std::tr1::shared_ptr< PostprocessingFactory > _postprocessing_factory
std::tr1::shared_ptr< GRINS::Visualization > build_vis(const GetPot &input, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1