28 _tabTYRays(tabRayons),
29 _tabSurfIntersect(tabStruct),
58 for (
int i = 0; i <
_nbRays; i++)
66 double angle = 0.0, rd = 0.0, rr = 0.0;
85 for (
int i = 0; i <
_nbRays; i++)
96 for (
size_t j = 0; j < tabRefl.size(); j++)
98 reflIndice = tabRefl[j];
100 Prefl = ray->
getEvents().at(reflIndice)->pos;
101 Pprec = ray->
getEvents().at(reflIndice)->previous->pos;
102 Psuiv = ray->
getEvents().at(reflIndice)->next->pos;
103 angle = ray->
getEvents().at(reflIndice)->angle;
106 rd = ray->
getEvents().at(reflIndice)->distPrevNext;
110 std::cout <<
"Position de la reflexion : X = " << Prefl.
_x <<
" Y = " << Prefl.
_y <<
" Z = " << Prefl.
_z << std::endl;
111 std::cout <<
"Angle d'incidence du rayon = " << angle << std::endl;
112 std::cout <<
"Longueur du rayon direct = " << rd << std::endl;
113 std::cout <<
"Longueur du rayon reflechi = " << rr << std::endl;
176 std::cout <<
"We are not using Fresnel Area on the ground" << std::endl;
179 unsigned int index_face = ray->
getEvents().at(reflIndice)->idFace1;
187 unsigned int index_face = ray->
getEvents().at(reflIndice)->idFace1;
223 double delta = 0.0, precDiff = 0.0, diffEnd = 0.0, precEnd = 0.0;
229 int signe = 1, diffIdx = 0;
231 OVector3D vDiffPrec, vDiffSuiv, n1, n2, normal;
235 for (
int i = 0; i <
_nbRays; i++)
243 for (
size_t j = 0; j < tabDiff.size(); j++)
245 diffIdx = tabDiff[j];
261 delta = signe * (precDiff + diffEnd - precEnd);
267 mod = (((nbF * 20.0 + 3.0)).sqrt()).inv();
275 prod = prod * absArrete;
403 for (
unsigned int i = 0; i < TY_SPECTRE_DEFAULT_NB_ELMT - 1; i++)
410 FMin.
getTabValReel()[i] = fn + ((phi0 - phin) / (phinp1 - phin)) * (fnp1 - fn);
412 FMax.
getTabValReel()[i] = fn + ((phi0 - phin) / (phinp1 - phin)) * (fnp1 - fn);
415 fc = (FMin * FMax).sqrt();
606 double totalRayLength;
608 for (
int i = 0; i <
_nbRays; i++)
610 totalRayLength = 0.0;
618 c1 = 4.0 *
M_PI * totalRayLength * totalRayLength;
633 mod = ((directivite * wSource * rhoc) * (1. / c1)).sqrt() * prodAbs.
getModule();
653 float incerRel = config->Anime3DSigma;
656 double cst = (pow(2., 1. / 6.) - pow(2., -1. / 6.)) * (pow(2., 1. / 6.) - pow(2., -1. / 6.)) / 3.0 + incerRel * incerRel;
657 double totalRayLength;
664 for (
int i = 0; i < nbSources; i++)
666 tabPressionAcoust[i].resize(nbRecepteurs);
669 for (
int i = 0; i < nbSources; i++)
671 for (
int j = 0; j < nbRecepteurs; j++)
677 for (
int k = 0; k <
_nbRays; k++)
679 const unsigned int source_id =
_tabTYRays[k]->getSource_idx();
680 const unsigned int receptor_id =
_tabTYRays[k]->getRecepteur_idx();
682 if ( (source_id == i ) && (receptor_id == j) )
687 switch(config->Anime3DForceC)
696 C = (K2 * totalRayLength * totalRayLength * (-1) * cst).
exp();
701 sum2 = sum2 + mod * mod * (un - C * C);
706 sum1 = sum1.
getModule() * sum1.getModule();
707 tabPressionAcoust[i][j] = sum1 + sum2;
711 return tabPressionAcoust;
double distEndEvent
Distance between this event and the next event needed for calculating (for example, reflection after a diffraction)
OSpectre computeFc(const double &dd, const double &dr)
static OSpectre getLambda(const double &c)
Describes building material.
This class store data and provide functions to manipulate event in the acoustic context.
This file provides the top-level declaration for the acoustic problem model.
size_t nreceptors() const
Return the total number of receptors.
virtual ~TYANIME3DAcousticModel()
Destructor.
acoustic_event * next
Pointer to the next event in TYRay's list of events.
std::vector< double > OTabDouble
Type for array of double.
const OSpectre & get_k() const
Get the wave number spectrum.
double compute_c() const
compute sound speed
double distFrom(const OPoint3D &pt) const
Computes the distance from this point to another.
tab_acoustic_path & _tabTYRays
Array of all TYMPAN rays.
This file provides class for solver configuration.
double distNextEvent
Distance between this event and the next one in TYRay's list of events.
std::vector< OPoint3D > TabPoint3D
virtual OSpectre invMult(const double &coefficient=1.0) const
Division of a double constant by this spectrum.
void ComputeAbsAtm()
Calculation of the atmospheric absorption.
tympan::AcousticMaterialBase * material
Triangle material.
virtual std::vector< int > getIndexOfEvents(const int &eventType) const
return a tab of indexes of events of the same type in a ray you can merge two types of events (exampl...
int idFace2
Face id on which the event happens (diffraction only)
int idFace1
Face id on which the event happens (reflection & diffraction)
OTabSpectreComplex _absRefl
Array of absorptions by reflection per ray.
AtmosphericConditions & _atmos
Atmospheric conditions.
AcousticSource & source(source_idx idx)
Return a source by its id.
OTabSpectreComplex _absDiff
Array of absorptions by diffraction per ray.
std::vector< OSpectreComplex > OTabSpectreComplex
OTabSpectreComplex vector.
double _y
y coordinate of OCoord3D
double _x
x coordinate of OCoord3D
virtual Spectrum lwAdjustment(Vector direction, double distance)=0
< Pure virtual method to return directivity of the Source
OVector3D normal
Surface normal vector.
TYANIME3DAcousticModel(tab_acoustic_path &tabRayons, TYStructSurfIntersect *tabStruct, const tympan::AcousticProblemModel &aproblem, AtmosphericConditions &atmos)
Constructor.
virtual OSpectre toGPhy() const
Converts to physical quantity.
static const double Z_ref
reference impedance
Class to describe the acoustic problem.
const tympan::AcousticProblemModel & _aproblem
Problem data.
Spectrum spectrum
Associated spectrum.
void ComputeAbsRefl()
Calculation of the absorption by reflection.
void ComputePressionAcoustEff()
Calculation of the effective acoustic pressure per ray and per frequency.
Class to define a segment.
static OSpectre getOSpectreFreqExact()
Return the spectrum of the exact frequencies.
Describe surface intersections.
OPoint3D pos
Event position.
boost::shared_ptr< SolverConfiguration > LPSolverConfiguration
virtual double * getTabValReel()
size_t nsources() const
Return the total number of sources.
OSpectre getPhase() const
SourceDirectivityInterface * directivity
Pointer to the source directivity.
void ComputeAbsDiff()
Calculation of absorption by diffraction.
virtual ComplexSpectrum get_absorption(double incidence_angle, double length)
Destructor.
acoustic_event * previous
Pointer to the previous event in TYRay's list of events.
OSpectre compute_length_absorption(double length) const
Describes an acoustic source.
virtual OSpectre mult(const OSpectre &spectre) const
Multiplication of two spectrums.
Class for the definition of atmospheric conditions.
virtual tab_acoustic_events & getEvents()
Get the events list of the ray.
virtual OSpectre exp(const double coef=1.0)
Compute e^(coef * spectre) of this spectrum.
double _z
z coordinate of OCoord3D
TYStructSurfIntersect * _tabSurfIntersect
Array containing all the informations relative to a site geometry and associated material to each fac...
Store acoustic power values for different frequencies.
bool _useFresnelArea
Flag to take into account or not the Fresnel area.
std::vector< acoustic_path * > tab_acoustic_path
virtual ComplexSpectrum get_absorption(double incidence_angle, double length)
Destructor.
Describes the ground material, a specific AcousticBuildingMaterial.
OSpectre _lambda
Wavelength.
OTab2DSpectreComplex ComputeAcousticModel()
Complete calculation of the acoustic model ANIME3D.
OSpectre getModule() const
OTabSpectreComplex _absAtm
Array of atmospheric absorptions per ray.
OTab2DSpectreComplex ComputePressionAcoustTotalLevel()
Calculation of the total quadratic pressure for a source/receptor - calculation with partial coherenc...
OTabSpectreComplex _pressAcoustEff
Array of effective acoustic pressure per ray.
static LPSolverConfiguration get()
Get the configuration.
std::vector< std::vector< OSpectreComplex > > OTab2DSpectreComplex
OTabSpectreComplex 2D array.