Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticModelDefaultSolver.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef __TYACOUSTICMODEL_DEFAULTSOLVER__
17 #define __TYACOUSTICMODEL_DEFAULTSOLVER__
18 
19 #include "Tympan/core/interfaces.h"
25 #include <gtest/gtest_prod.h>
26 
28 class TYSolver;
29 
35 {
36 public:
37  TYAcousticModelDefaultSolver(TYSolverDefaultSolver& solver); //<! Constructor
38 
39  virtual void compute(const std::deque<TYSIntersection>& tabIntersect, TYTrajetDefaultSolver& trajet,
40  TabPoint3D& ptsTop, TabPoint3D& ptsLeft, TabPoint3D& ptsRight);
41 
46  void computeWaveLength() override;
47 
62  virtual bool computeCheminsAvecEcran(const OSegment3D& rayon, const tympan::AcousticSource& source,
63  const TabPoint3D& pts, const bool vertical,
64  TYTabCheminDefaultSolver& TabChemins, double distance,
65  bool conditionFav = false) const;
66 
75  void computeCheminReflexion(const std::deque<TYSIntersection>& tabIntersect, const OSegment3D& rayon,
76  const tympan::AcousticSource& source, TYTabCheminDefaultSolver& TabChemins,
77  double distance) const;
78 
87  void computeCheminSansEcran(const OSegment3D& rayon, const tympan::AcousticSource& source,
88  TYTabCheminDefaultSolver& TabChemins, double distance,
89  bool conditionFav = false) const;
90 
98  void computeCheminAPlat(const OSegment3D& rayon, const tympan::AcousticSource& source,
99  TYTabCheminDefaultSolver& TabChemins, double distance) const;
100 
107  OSpectre calculC(const double& epaisseur) const;
108 
126  OSpectre calculAttDiffraction(const OSegment3D& rayon, const OSegment3D& penteMoyenne, const bool& miroir,
127  const double& re, const double& epaisseur, const bool& vertical,
128  const bool& avantApres, bool& bDiffOk, bool conditionFav = false) const;
129 
135  OSpectre limAttDiffraction(const OSpectre& sNC, const OSpectre& C) const;
136 
152  bool addGroundSteps(const OPoint3D& ptDebut, const OPoint3D& ptFin, const OSegment3D& penteMoyenne,
153  const tympan::AcousticSource& source, const bool& fromSource, const bool& toRecepteur,
154  TYTabEtapeDefaultSolver& Etapes, double& longueur) const;
155 
160  bool solve(TYTrajetDefaultSolver& trajet);
161 
162 private:
166  OSpectreComplex getReflexionSpectrumAt(const OSegment3D& incident, double length,
167  const OSegment3D& segPente,
168  const tympan::AcousticSource& source) const;
169 
170  TYSolver& getSolver() const override
171  {
172  return _solver;
173  }
174 
175 private:
176  FRIEND_TEST(test_TYAcousticModel, calculAttDiffraction);
177  FRIEND_TEST(test_TYAcousticModel, calculC);
178  FRIEND_TEST(test_TYAcousticModel, limAttDiffraction);
179  FRIEND_TEST(test_TYAcousticModel, computeCheminReflexion);
180 
183 
186 };
187 
188 #endif // __TYACOUSTICMODEL_DEFAULTSOLVER__
std::vector< OPoint3D > TabPoint3D
Definition: 3d.h:483
std::deque< TYCheminDefaultSolver > TYTabCheminDefaultSolver
TYChemin collection.
std::deque< TYEtapeDefaultSolver > TYTabEtapeDefaultSolver
TYEtape collection.
The 3D point class.
Definition: 3d.h:487
Class to define a segment.
Definition: 3d.h:1141
Acoustic model for the default solver.
OSpectre calculAttDiffraction(const OSegment3D &rayon, const OSegment3D &penteMoyenne, const bool &miroir, const double &re, const double &epaisseur, const bool &vertical, const bool &avantApres, bool &bDiffOk, bool conditionFav=false) const
Compute the attenuation from the diffraction on the screen.
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.
void computeCheminSansEcran(const OSegment3D &rayon, const tympan::AcousticSource &source, TYTabCheminDefaultSolver &TabChemins, double distance, bool conditionFav=false) const
Compute the list of paths generated by reflection on the ground if there is no screen.
bool solve(TYTrajetDefaultSolver &trajet)
Compute the source contribution to the point.
virtual void compute(const std::deque< TYSIntersection > &tabIntersect, TYTrajetDefaultSolver &trajet, TabPoint3D &ptsTop, TabPoint3D &ptsLeft, TabPoint3D &ptsRight)
FRIEND_TEST(test_TYAcousticModel, computeCheminReflexion)
OSpectre limAttDiffraction(const OSpectre &sNC, const OSpectre &C) const
Limit the screen attenuation value with a frequency dependent criteria.
void computeCheminReflexion(const std::deque< TYSIntersection > &tabIntersect, const OSegment3D &rayon, const tympan::AcousticSource &source, TYTabCheminDefaultSolver &TabChemins, double distance) const
Compute the list of path generated by reflection on the vertical walls.
TYSolverDefaultSolver & _solver
Reference to the solver.
bool addGroundSteps(const OPoint3D &ptDebut, const OPoint3D &ptFin, const OSegment3D &penteMoyenne, const tympan::AcousticSource &source, const bool &fromSource, const bool &toRecepteur, TYTabEtapeDefaultSolver &Etapes, double &longueur) const
Compute the different steps from a point to another via a reflection and a direct view.
void computeCheminAPlat(const OSegment3D &rayon, const tympan::AcousticSource &source, TYTabCheminDefaultSolver &TabChemins, double distance) const
Compute the list of paths for a perfectly flat and reflective ground.
OSpectre calculC(const double &epaisseur) const
Compute the spectrum of the C factor used in the diffraction calculation.
void computeWaveLength() override
Compute the wave length for the default solver.
TYSolver & getSolver() const override
FRIEND_TEST(test_TYAcousticModel, limAttDiffraction)
TYAcousticModelDefaultSolver(TYSolverDefaultSolver &solver)
FRIEND_TEST(test_TYAcousticModel, calculC)
virtual bool computeCheminsAvecEcran(const OSegment3D &rayon, const tympan::AcousticSource &source, const TabPoint3D &pts, const bool vertical, TYTabCheminDefaultSolver &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...
FRIEND_TEST(test_TYAcousticModel, calculAttDiffraction)
Acoustic model for the considered solver.
Class which represents the Solver for 9613 family solvers.
Definition: TYSolver.h:36
This class TYTrajet (journey) links a couple Source-Receptor and a collection of paths,...
Describes an acoustic source.
Definition: entities.hpp:394