Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYSolver.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 #ifndef __TY_SOLVER_9613__
17 #define __TY_SOLVER_9613__
18 
19 #include <vector>
20 #include <memory>
21 #include "Tympan/core/interfaces.h"
27 
28 class OThreadPool;
29 class TYAcousticModel;
31 class TYFaceSelector;
32 class Scene;
33 
37 class TYSolver : public SolverInterface
38 {
39 public:
40  TYSolver();
41  virtual ~TYSolver();
42 
50  virtual bool solve(const tympan::AcousticProblemModel& aproblem, tympan::AcousticResultModel& aresult,
51  tympan::LPSolverConfiguration configuration);
52 
53  const std::vector<TYStructSurfIntersect>& getTabPolygon() const
54  {
55  return _tabPolygon;
56  }
57 
59  {
60  return _faceSelector.get();
61  }
63  {
64  return _acousticPathFinder.get();
65  }
66 
68  {
69  return _acousticModel.get();
70  }
71 
72  const Scene* getScene() const
73  {
74  return _scene.get();
75  }
76 
77 protected:
78  std::unique_ptr<TYFaceSelector> make_face_selector();
79  std::unique_ptr<TYAcousticPathFinder> make_path_finder();
80  std::unique_ptr<TYAcousticModel> make_acoustic_model();
81 
82  std::unique_ptr<TYFaceSelector> _faceSelector;
83  std::unique_ptr<TYAcousticPathFinder> _acousticPathFinder;
84  std::unique_ptr<TYAcousticModel> _acousticModel;
85 
86 private:
87  bool buildCalcStruct(const tympan::AcousticProblemModel& aproblem);
88 
94  bool appendTriangleToScene();
95 
96  // XXX This pointer is actually used like a C array :
97  // TODO replace with a std::deque or similar container.
98  std::vector<TYStructSurfIntersect> _tabPolygon;
99 
100  std::vector<TYTrajet*> _tabTrajets;
101 
103 
104 private:
105  std::unique_ptr<Scene> _scene;
106 };
107 
108 #endif // __TY_SOLVER_9613__
This file provides the top-level declaration for the acoustic problem model.
This file provides the top-level declaration for the acoustic result model.
Slave threads collection.
Definition: threading.h:225
This class mainly define a mesh (list of Shape) used by the Simulation object.
Definition: Scene.h:51
Interface class for solvers.
Definition: interfaces.h:33
Acoustic model for the default solver.
Build the acoustic path for the 9613 solver.
Building class of the faces list.
9613 Solver
Definition: TYSolver.h:38
std::unique_ptr< TYAcousticModel > make_acoustic_model()
TYAcousticModel builder.
Definition: TYSolver.cpp:187
TYAcousticPathFinder * getAcousticPathFinder()
Get the acoustic path finder.
Definition: TYSolver.h:62
const Scene * getScene() const
Get the Scene.
Definition: TYSolver.h:72
std::unique_ptr< TYAcousticPathFinder > make_path_finder()
TYAcousticPathFinder builder.
Definition: TYSolver.cpp:182
virtual ~TYSolver()
Destructor.
Definition: TYSolver.cpp:50
TYSolver()
Constructor.
Definition: TYSolver.cpp:31
bool appendTriangleToScene()
Convertion des triangles Tympan en primitives utilisables par ray tracer.
Definition: TYSolver.cpp:222
std::vector< TYTrajet * > _tabTrajets
Vector of TYTrajet.
Definition: TYSolver.h:100
const std::vector< TYStructSurfIntersect > & getTabPolygon() const
Get the array of polygons.
Definition: TYSolver.h:53
std::unique_ptr< TYFaceSelector > _faceSelector
Pointer to the TYFaceSelector.
Definition: TYSolver.h:82
TYAcousticModel * getAcousticModel()
Get acoustic model.
Definition: TYSolver.h:67
std::unique_ptr< TYAcousticPathFinder > _acousticPathFinder
Pointer to the TYAcousticPathFinder.
Definition: TYSolver.h:83
virtual bool solve(const tympan::AcousticProblemModel &aproblem, tympan::AcousticResultModel &aresult, tympan::LPSolverConfiguration configuration)
Launch the resolution and get the results.
Definition: TYSolver.cpp:64
OThreadPool * _pool
Definition: TYSolver.h:102
std::vector< TYStructSurfIntersect > _tabPolygon
Vector of TYStructSurfIntersect.
Definition: TYSolver.h:98
bool buildCalcStruct(const tympan::AcousticProblemModel &aproblem)
Definition: TYSolver.cpp:192
TYFaceSelector * getFaceSelector()
Get the face selector.
Definition: TYSolver.h:58
std::unique_ptr< TYFaceSelector > make_face_selector()
TYFaceSelector builder.
Definition: TYSolver.cpp:177
std::unique_ptr< Scene > _scene
Pointer to the Scene.
Definition: TYSolver.h:105
std::unique_ptr< TYAcousticModel > _acousticModel
Pointer to the TYAcousticModel.
Definition: TYSolver.h:84
Class to describe the acoustic problem.
Contains the results of the model solved.
This file provides class for solver configuration.
boost::shared_ptr< SolverConfiguration > LPSolverConfiguration
Definition: interfaces.h:25