Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticModel.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2014> <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 __TYACOUSTICMODEL__
17 #define __TYACOUSTICMODEL__
18 
19 #include "Tympan/core/interfaces.h"
22 #include <gtest/gtest_prod.h>
23 
24 class TYTrajet;
25 class TYSolver;
26 
32 {
33 public:
34  TYAcousticModel(TYSolver& solver); //<! Constructor
35  virtual ~TYAcousticModel(); //<! Destructor
36 
37  virtual void compute(const std::deque<TYSIntersection>& tabIntersect, TYTrajet& trajet,
38  TabPoint3D& ptsTop, TabPoint3D& ptsLeft, TabPoint3D& ptsRight);
39 
41  void init();
42 
57  virtual bool computeCheminsAvecEcran(const OSegment3D& rayon, const tympan::AcousticSource& source,
58  const TabPoint3D& pts, const bool vertical, TYTabChemin& TabChemins,
59  double distance, bool conditionFav = false) const;
60 
69  void computeCheminReflexion(const std::deque<TYSIntersection>& tabIntersect, const OSegment3D& rayon,
70  const tympan::AcousticSource& source, TYTabChemin& TabChemins,
71  double distance) const;
72 
73  // * \fn getSpectreAttVegetation
74  // * @brief Calcule les spectres d'attenuation caracteristiques de la vegetation
75  // * pour chaque terrain survole par rayon.
76  // *
77  // * @param rayon Un segment representant le rayon acoustique.
78  // * @param tabSegSp Le tableau dans lequel sont stockes les spectres d'attenuation et segments associes.
79  // * @param penteMoyenne La pente moyenne sur le rayon.
80  // */
81  // void getSpectreAttVegetation(const OSegment3D& rayon, const OSegment3D& penteMoyenne,
82  // TYTabStructSegLPSp& tabSegSp) const;
83 
84  // * \fn computeCheminAvecVeg
85  // * @brief Calcule le chemin direct en tenant compte de la vegetation.
86  // *
87  // * @param rayon Un segment representant le rayon acoustique.
88  // * @param Atmo L'atmosphere courante.
89  // * @param pSrcGeoNode La source ponctuelle.
90  // * @param penteMoyenne La pente moyenne sur le rayon.
91  // *
92  // * @return Le chemin determine.
93  // */
94  // void computeCheminAvecVeg(const OSegment3D& rayon, const tympan::AcousticSource& source, const
95  // OSegment3D& penteMoyenne, TYTabChemin& TabChemin, double distance) const;
96 
105  void computeCheminSansEcran(const OSegment3D& rayon, const tympan::AcousticSource& source,
106  TYTabChemin& TabChemins, double distance, bool conditionFav = false) const;
107 
115  void computeCheminAPlat(const OSegment3D& rayon, const tympan::AcousticSource& source,
116  TYTabChemin& TabChemins, double distance) const;
117 
124  OSpectre calculC(const double& epaisseur) const;
125 
143  OSpectre calculAttDiffraction(const OSegment3D& rayon, const OSegment3D& penteMoyenne, const bool& miroir,
144  const double& re, const double& epaisseur, const bool& vertical,
145  const bool& avantApres, bool& bDiffOk, bool conditionFav = false) const;
146 
152  OSpectre limAttDiffraction(const OSpectre& sNC, const OSpectre& C) const;
153 
169  bool addEtapesSol(const OPoint3D& ptDebut, const OPoint3D& ptFin, const OSegment3D& penteMoyenne,
170  const tympan::AcousticSource& source, const bool& fromSource, const bool& toRecepteur,
171  TYTabEtape& Etapes, double& longueur) const;
172 
178  void addEtapeDirectToChemins(const TYEtape& EtapeDirecte, TYTabChemin& TabChemin) const;
179 
184  bool solve(TYTrajet& trajet);
185 
186 private:
190  OSpectreComplex getReflexionSpectrumAt(const OSegment3D& incident, double length,
191  const OSegment3D& segPente,
192  const tympan::AcousticSource& source) const;
193 
197  void meanSlope(const OSegment3D& director, OSegment3D& slope) const;
198 
199 private:
200  FRIEND_TEST(test_TYAcousticModel, calculAttDiffraction);
201  FRIEND_TEST(test_TYAcousticModel, calculC);
202  FRIEND_TEST(test_TYAcousticModel, limAttDiffraction);
203  FRIEND_TEST(test_TYAcousticModel, computeCheminReflexion);
204  bool _useSol;
205  bool _useReflex;
206  int _propaCond;
207  bool _useAtmo;
208  bool _interference;
209  double _paramH;
210 
211  std::unique_ptr<AtmosphericConditions> pSolverAtmos;
212 
215 
217  TYSolver& _solver;
218 };
219 
220 #endif // __TYACOUSTICMODEL__
std::vector< OPoint3D > TabPoint3D
Definition: 3d.h:483
std::deque< TYChemin > TYTabChemin
TYChemin collection.
Definition: TYChemin.h:255
std::deque< TYEtape > TYTabEtape
TYEtape collection.
Definition: TYEtape.h:193
Representation of one of the most optimal path between source and receptor: S—>R.
Interface class for acoustic models.
Definition: interfaces.h:48
The 3D point class.
Definition: 3d.h:487
Class to define a segment.
Definition: 3d.h:1089
Acoustic model for the default solver.
OSpectreOctave limAttDiffraction(const OSpectreOctave &sNC, const OSpectreOctave &C) const
Limit the screen attenuation value with a frequency dependent criteria.
std::unique_ptr< AtmosphericConditions > pSolverAtmos
void computeCheminSansEcran(const std::deque< TYSIntersection > &tabIntersect, const OSegment3D &rayon, const tympan::AcousticSource &source, TYTabChemin &TabChemins, double distance, bool conditionFav=false) const
Compute the main path between source and receptor. In 9613 solver, this path includes all attenuation...
FRIEND_TEST(test_TYAcousticModel, limAttDiffraction)
TYSolver & _solver
Reference to the solver.
virtual bool computeCheminsAvecEcran(const OSegment3D &rayon, const tympan::AcousticSource &source, const TabPoint3D &pts, const bool vertical, TYTabChemin &TabChemins, double distance, bool conditionFav=false) const
Compute the segment path from the list of the points of the TYTrajet journey. It takes in account the...
void init()
Initialize the acoustic model.
FRIEND_TEST(test_TYAcousticModel, calculAttDiffraction)
void computeCheminAPlat(const OSegment3D &rayon, const tympan::AcousticSource &source, TYTabChemin &TabChemins, double distance) const
Compute the list of paths for a perfectly flat and reflective ground.
OSpectreOctave calculAttDiffraction(const OSegment3D &ray, const double &re, const double &dss, const double &dsr, const double &width, const bool &vertical) const
Compute the attenuation from the diffraction on the screen.
void addEtapeDirectToChemins(const TYEtape &EtapeDirecte, TYTabChemin &TabChemin) const
Add a direct journey to all the paths.
TYAcousticModel(TYSolver &solver)
virtual ~TYAcousticModel()
OSpectreComplex getReflexionSpectrumAt(const OSegment3D &incident, double length, const OSegment3D &segPente, const tympan::AcousticSource &source) const
Find Reflexion spectrum at point defined by the end of an incident segment.
FRIEND_TEST(test_TYAcousticModel, calculC)
FRIEND_TEST(test_TYAcousticModel, computeCheminReflexion)
void meanSlope(const OSegment3D &director, OSegment3D &slope) const
Create a segment corresponding to the projection of "director" segment on the ground.
OSpectreComplex _absoNulle
bool solve(TYTrajet &trajet)
Compute the source contribution to the point.
bool addEtapesSol(const OPoint3D &ptDebut, const OPoint3D &ptFin, const OSegment3D &penteMoyenne, const tympan::AcousticSource &source, const bool &fromSource, const bool &toRecepteur, TYTabEtape &Etapes, double &longueur) const
Compute the different steps from a point to another via a reflection and a direct view.
void computeCheminReflexion(const std::deque< TYSIntersection > &tabIntersect, const OSegment3D &rayon, const tympan::AcousticSource &source, TYTabChemin &TabChemins, double distance) const
Compute the list of path generated by reflection on the vertical walls.
OSpectre calculC(const double &epaisseur) const
Compute the spectrum of the C factor used in the diffraction calculation.
void computeCheminReflexion(const std::deque< TYSIntersection > &tabIntersect, const OSegment3D &ray, const tympan::AcousticSource &source, TYTabChemin &TabChemins, double distance) const
Compute the list of path generated by reflection on the vertical walls.
virtual void compute(const std::deque< TYSIntersection > &tabIntersect, TYTrajet &trajet, TabPoint3D &ptsTop, TabPoint3D &ptsLeft, TabPoint3D &ptsRight)
The TYEtape class is used to describe a part (a step) of a path (TYChemin) for the computation of tra...
Definition: TYEtape.h:47
9613 Solver
Definition: TYSolver.h:38
This class TYTrajet (journey) links a couple Source-Receptor and a collection of paths,...
Definition: TYTrajet.h:35
Describes an acoustic source.
Definition: entities.hpp:366