Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYTask.cpp
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 #include "TYAcousticModel.h"
17 #include "TYAcousticPathFinder.h"
18 #include "TYFaceSelector.h"
19 #include "TYSolver.h"
20 #include "TYTask.h"
22 
23 TYTask::TYTask(TYSolver& solver, const tympan::nodes_pool_t& nodes, const tympan::triangle_pool_t& triangles,
24  const tympan::material_pool_t& materials, TYTrajet& trajet, int nNbTrajets)
25  : _solver(solver), _trajet(trajet), _nNbTrajets(nNbTrajets), _nodes(nodes), _triangles(triangles),
26  _materials(materials)
27 {
28 }
29 
31 
33 {
34  TabPoint3D ptsTop;
35  TabPoint3D ptsLeft;
36  TabPoint3D ptsRight;
37 
38  // Construction du rayon SR
39  OSegment3D rayon;
41 
42  // On selectionne les faces de la scene concernes par le calcul acoustique pour la paire concernee
44 
45  // On calcul les trajets acoustiques horizontaux et verticaux reliant la paire source/recepteur
46  _solver.getAcousticPathFinder()->computePath(_tabIntersect, _trajet, ptsTop, ptsLeft, ptsRight);
47 
48  // On effectue les calculs acoustiques en utilisant les formules du modele acoustique
49  _solver.getAcousticModel()->compute(_tabIntersect, _trajet, ptsTop, ptsLeft, ptsRight);
50 
51  ptsTop.clear();
52  ptsLeft.clear();
53  ptsRight.clear();
54  _tabIntersect.clear();
55 }
std::vector< OPoint3D > TabPoint3D
Definition: 3d.h:483
Class to define a segment.
Definition: 3d.h:1089
virtual void compute(const std::deque< TYSIntersection > &tabIntersect, TYTrajet &trajet, TabPoint3D &ptsTop, TabPoint3D &ptsLeft, TabPoint3D &ptsRight)
Main entry point, trigger acoustic computations.
virtual void computePath(const std::deque< TYSIntersection > &tabIntersect, const TYTrajet &trajet, TabPoint3D &ptsTop, TabPoint3D &ptsLeft, TabPoint3D &ptsRight)
Compute a path between a source and a receptor. The receptor is not included in the path.
virtual void selectFaces(std::deque< TYSIntersection > &tabIntersect, const OSegment3D &rayon, const string &sourceVolumeId)
Build the array of intersections.
9613 Solver
Definition: TYSolver.h:38
TYAcousticPathFinder * getAcousticPathFinder()
Get the acoustic path finder.
Definition: TYSolver.h:62
TYAcousticModel * getAcousticModel()
Get acoustic model.
Definition: TYSolver.h:67
TYFaceSelector * getFaceSelector()
Get the face selector.
Definition: TYSolver.h:58
TYTrajet & _trajet
Reference to the path.
Definition: TYTask.h:53
TYTask(TYSolver &solver, const tympan::nodes_pool_t &nodes, const tympan::triangle_pool_t &triangles, const tympan::material_pool_t &materials, TYTrajet &trajet, int nNbTrajets)
Constructor.
Definition: TYTask.cpp:23
void main()
Main procedure to run the task.
Definition: TYTask.cpp:32
~TYTask()
Destructor.
Definition: TYTask.cpp:30
std::deque< TYSIntersection > _tabIntersect
Array of intersections.
Definition: TYTask.h:57
TYSolver & _solver
Reference to the solver.
Definition: TYTask.h:51
This class TYTrajet (journey) links a couple Source-Receptor and a collection of paths,...
Definition: TYTrajet.h:35
void getPtSetPtRfromOSeg3D(OSegment3D &seg) const
Definition: TYTrajet.h:175
tympan::AcousticSource & asrc
Business source.
Definition: TYTrajet.h:225
string volume_id
Volume id.
Definition: entities.hpp:376
std::deque< Point > nodes_pool_t
std::deque< material_ptr_t > material_pool_t
Definition: entities.hpp:41
std::deque< AcousticTriangle > triangle_pool_t
Array of AcousticTriangle.
Definition: entities.hpp:199