46 const size_t& tabPolygonSize,
50 _tabPolygon(tabPolygon),
51 _tabPolygonSize(tabPolygonSize),
52 _tabTYRays(tabTYRays),
72 vector<vec3> recepteurs;
73 vector<tympan::VolumeFaceDirectivity*> directivities;
74 unsigned int sens =
getTabsSAndR(sources, recepteurs,directivities);
93 #ifdef TEST_ACCELERATION_RECEPTORS 117 unsigned int sens = config->RayTracingOrder;
121 directivities = vector<tympan::VolumeFaceDirectivity*>(
_aproblem.
nsources(),
nullptr);
122 vector<tympan::VolumeFaceDirectivity*> dirs = vector<tympan::VolumeFaceDirectivity*>(
_aproblem.
nsources(),
nullptr);
142 rcpts.push_back(pos);
146 switch (config->RayTracingOrder)
151 directivities = dirs;
158 if (rcpts.size() > srcs.size())
168 directivities = dirs;
174 directivities = dirs;
197 unsigned int a, b,
c;
213 if ( dynamic_cast<tympan::AcousticGroundMaterial*>(
_tabPolygon[i].material) )
223 ss <<
"Ajout d'un triangle non naturel." << std::endl;
233 unsigned int idRecepteur = 0;
235 for (
unsigned int i = 0; i < recepteurs.size(); i++)
238 recep.
setId(idRecepteur);
250 int nbRaysPerSource = config->NbRaysPerSource;
251 int realNbRaysPerSource = 0;
252 for (
unsigned int i = 0; i < sources.size(); i++)
256 if(directivities.at(i)){
257 vec3 dir =
vec3(directivities.at(i)->get_normal()._x,directivities.at(i)->get_normal()._y,directivities.at(i)->get_normal()._z);
264 switch (config->Discretization)
268 realNbRaysPerSource = nbRaysPerSource;
280 realNbRaysPerSource = nbRaysPerSource;
290 source.
setId(idSource);
292 ss <<
"Ajout d'une source (id=" << idSource <<
") en (" << sources[i].x <<
"," << sources[i].y <<
"," << sources[i].y <<
")" << endl;
308 for (
unsigned int i = 0; i < rays->size(); i++)
310 Ray* ray = rays->at(i);
327 double t_step(config->AnalyticH);
331 for (
size_t i = 0; i <
_tabTYRays.size(); i++)
352 unsigned int idSource = 0;
353 unsigned int idRecep = 0;
377 if (config->UseMeteo ==
false)
383 switch(config->AnalyticTypeTransfo)
394 if (config->UseMeteo)
400 CurveRayShot.
clear();
401 CurveRayShot.
setDMax(config->AnalyticDMax);
403 CurveRayShot.
setTMax(config->AnalyticTMax);
405 CurveRayShot.
setNbRay(config->AnalyticNbRay);
406 dynamic_cast<meteoLin*
>(CurveRayShot.
_weather)->setGradC(config->AnalyticGradC);
407 dynamic_cast<meteoLin*
>(CurveRayShot.
_weather)->setGradV(config->AnalyticGradV);
436 raytracer_config->
Accelerator = solver_config->Accelerator;
437 raytracer_config->
MaxTreeDepth = solver_config->MaxTreeDepth;
438 raytracer_config->
MaxProfondeur = solver_config->MaxProfondeur;
439 raytracer_config->
MaxReflexion = solver_config->MaxReflexion;
440 raytracer_config->
UseSol = solver_config->UseSol;
443 raytracer_config->
MaxLength = solver_config->MaxLength;
444 raytracer_config->
SizeReceiver = solver_config->SizeReceiver;
445 raytracer_config->
AngleDiffMin = solver_config->AngleDiffMin;
446 raytracer_config->
CylindreThick = solver_config->CylindreThick;
449 raytracer_config->
FinalAnglePhi = solver_config->FinalAnglePhi;
463 raytracer_config->
KeepDebugRay = solver_config->KeepDebugRay;
unsigned int getId()
Get the Source id.
double MaxPathDifference
Parameter (by default 24) for path validations during diffraction.
bool KeepDebugRay
Flag to store rays into a debug_rays array after being invalidated.
void clear()
Clear all the arrays.
std::vector< Source > & getSources()
Return the sources list of the scene.
bool DebugUseDiffractionAngleSelector
Flag to add the DiffractionAngleSelector filter.
This file provides the top-level declaration for the acoustic problem model.
meteo * _weather
Pointer to weather.
size_t nreceptors() const
Return the total number of receptors.
void appendRecepteurToSimulation(vector< vec3 > &recepteurs)
Ajoute les recepteurs a la simulation.
virtual void setC0(const double &c)
Set sound speed.
unsigned int MaxDiffraction
Maximal diffraction events.
Describes analytical ray curve tracing.
Point position
Destructor.
bool DiffractionFilterRayAtCreation
Flag to filter the created rays during diffraction.
void sampleAndCorrection()
Computes angle and length correction \ by calling the three previous functions \ Creates two matrix w...
Class defining the configuration of the acoustic ray tracer.
bool UsePathDifValidation
Flag to activate path validations during diffraction.
double compute_c() const
compute sound speed
bool exec()
Launch the research of acoustic paths.
TYANIME3DAcousticPathFinder(TYStructSurfIntersect *tabPolygon, const size_t &tabPolygonSize, const tympan::AcousticProblemModel &aproblem_, tab_acoustic_path &tabTYRays, AtmosphericConditions &atmos)
Constructor.
void setId(unsigned int _id)
Set the Source id.
void appendSourceToSimulation(vector< vec3 > &sources, vector< tympan::VolumeFaceDirectivity *> &directivities)
Ajoute les sources ponctuelles actives a la simulation.
double FinalAngleTheta
Ending angle theta for the curve ray sampler.
This file provides class for solver configuration.
virtual bool postTreatmentScene(Scene *scene, std::vector< Source > &sources, std::vector< Recepteur > &recepteurs)
Virtual function to post-process the Scene. It has two phases: transform the meta-objects and load th...
Solver * getSolver()
Get the acoustic solver.
base_vec3< decimal > vec3
void setLaunchType(const unsigned int &launchType)
Set how rays will be created (launch type)
const size_t & _tabPolygonSize
Polygons number in _tabPolygon.
bool finish(int accelerator_id=1, leafTreatment::treatment _intersectionChoice=leafTreatment::FIRST)
Build the selected accelerator on the scene.
TYStructSurfIntersect * _tabPolygon
Array containing all the informations relative to a site geometry and associated material to each fac...
bool appendTriangleToScene()
Convertion des triangles Tympan en primitives utilisables par le lancer de rayons.
void setSampler(Sampler *_sampler)
Set the Sampler for this Source.
virtual deque< Ray * > * getValidRays()
Return a pointer to the validated rays list.
void setId(unsigned int _id)
void setInitialRayCount(int nb)
Set the initial rays counter.
bool DiffractionUseDistanceAsFilter
Flag to use distance based filter during diffraction (distance from the ridge)
void run()
Run the calculation.
void setTMax(const double &TmpMax)
Change the maximal propagation time.
void * getRecepteur()
Return the ray receptor.
std::vector< Recepteur > & getRecepteurs()
Return a vector of all receptors of the scene.
double CylindreThick
Diffraction cylinder diameter.
void setNbRay(const unsigned int &nb)
Set the rays number to launch.
virtual void setRecepteur(unsigned int receptor_idx_, OPoint3D &globalPosition)
Set the ray receptor. The last polyline point is updated.
Class to define linear gradient for wind and sound speed.
tab_acoustic_path & _tabTYRays
Array containing all the Code_Tympan rays.
Shape * addTriangle(unsigned int i1, unsigned int i2, unsigned int i3, Material *m, const bool &isSol=false)
Add a triangle to the scene built with the vertices array.
3D vector Vector defined with 3 float numbers
std::unique_ptr< IGeometryModifier > transformer
Object _curveRayTracing for the curved ray tracer.
void build_links_between_events()
TYRayEvent has to know is direct neighbourg (before and after him)
Point position
Destructor.
AcousticSource & source(source_idx idx)
Return a source by its id.
bool DebugUseDiffractionPathSelector
Flag to add the DiffractionPathSelector filter.
Scene * getScene()
Get a pointer to the scene.
void addSource(const Source &s)
Tool function to add a source to the simulation.
double InitialAnglePhi
Starting angle phi for the curve ray sampler.
double _y
y coordinate of OCoord3D
AcousticReceptor & receptor(receptor_idx idx)
Return a receptor by its id.
double _x
x coordinate of OCoord3D
unsigned int NbRayWithDiffraction
Number of rays to throw during diffraction.
virtual void setSource(unsigned int source_idx_, OPoint3D &globalPosition)
Set the ray source.
Directivity for a volume face.
TabPoint3D tabPoint
Points array used during the pre-selection.
void setEngine(engineChoice engine=DEFAULT)
Set the engine (by default, the DefaultEngine)
void addRecepteur(Recepteur &r)
Tool function to add quickly a receptor for the simulation.
: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-40...
virtual ~TYANIME3DAcousticPathFinder()
Destructor.
unsigned int getTabsSAndR(vector< vec3 > &sources, vector< vec3 > &recepteurs, vector< tympan::VolumeFaceDirectivity *> &directivities)
Contruit la liste des points sources et des points recepteurs en fonction du parametre de sens de pro...
void configure_raytracer()
Configure parameters of the AcousticRayTracer.
vec3 OPoint3Dtovec3(const OPoint3D &_p)
Converts a OPoint3D to vec3.
AtmosphericConditions & _atmos
Atmospheric conditions.
Class to describe the acoustic problem.
Simulation _rayTracing
Object _rayTracing for the straigth-line ray tracer.
bool DiffractionDropDownNbRays
Flag to reduce the number of rays thrown depending on the diffraction order.
double AngleDiffMin
Minimal angle (other PI) between two face to allow building of a diffraction cylinder.
API class to run the ray tracer for the ANIME3D solver.
bool DebugUseFaceSelector
Flag to add the FaceSelector filter.
void setDMax(const double &DistMax)
Set the maximal distance.
unsigned int MaxProfondeur
Maximal number of events for ray validation in ANIME3D solver.
Describe surface intersections.
static AcousticRaytracerConfiguration * get()
Get access to the configuration.
void set_source_idx_and_receptor_idx_to_acoustic_path(int sens, Ray *ray, acoustic_path *tyRay)
boost::shared_ptr< SolverConfiguration > LPSolverConfiguration
bool addVertex(const vec3 &newVertex, unsigned int &index)
Add a vertex to the vertices array.
void setSolver(Solver *_solver)
Tool function to set the acoustic solver for the simulation.
void clean()
Clean the simulation: the scene, sources, and receptors and all the rays are deleted.
unsigned int Accelerator
Accelerator choice with 0: BruteForceAccelerator, 1: GridAccelerator, 2: BvhAccelerator, 3: KdtreeAccelerator.
bool DebugUseFermatSelector
Flag to add the FermatSelector filter.
size_t nsources() const
Return the total number of sources.
void setPosition(const vec3 _pos)
Set the position of the Source.
unsigned int NbRaysPerSource
Number of rays per source for the Sampler.
SourceDirectivityInterface * directivity
Pointer to the source directivity.
This class mainly define a mesh (list of Shape) used by the Simulation object.
void setTimeStep(const decimal &tt)
Set the discretization step.
Class for the definition of atmospheric conditions.
double _z
z coordinate of OCoord3D
unsigned int MaxReflexion
Maximal reflection events.
unsigned int Discretization
Sampler choice with 0: RandomSphericSampler, 1: UniformSphericSampler, 2: UniformSphericSampler2, 3: Latitude2DSampler.
A Sampler class for random spherical sampling.
Base class for accelerators.
void compute_shot_angle()
Compute shot angle from source.
const source_pool_t & sources() const
Return array of sources.
Point ComputeAcousticCentroid(const source_pool_t &tabSources_)
Source * getSource()
Return the ray source.
bool DiffractionUseRandomSampler
Flag to enable random (and not regular) sampling for diffraction.
static void set_sampler_step(double sampler_step_)
Set the sampler step.
Scene * get_receptors_landscape()
Return the geometric distribution of receptors.
double InitialAngleTheta
Starting angle theta for the curve ray sampler.
std::vector< acoustic_path * > tab_acoustic_path
bool UsePostFilters
Flag to use some specifics Selector.
bool launchSimulation()
Program main loop. Extract all the rays from the sources then treat them. The loop finishes when the ...
void build_geometry_transformer(const vector< vec3 > &sources)
Method to build the transformer of the scene geometry according to different parameters.
Receptor inherits from a Sphere Shape.
double MaxLength
LengthSelector Selector option (maximal length)
virtual void setWindAngle(const double &windAngle)
Define wind: angle given in windrose orientation (clockwise angle with 0 for a wind from north to sou...
unsigned int MaxTreeDepth
BvhAccelerator Accelerator option (Maximal tree depth)
double FinalAnglePhi
Ending angle phi for the curve ray sampler.
A Sampler class for latitude sampling.
void addSource(const vec3 &source)
Add a source into the sources list.
bool DebugUseCloseEventSelector
Flag to add the the CloseEventSelector filter.
static LPSolverConfiguration get()
Get the configuration.
Sampler * getSampler()
Get ray generator for modification.
const tympan::AcousticProblemModel & _aproblem
Sampler * getSampler()
Get the Sampler of this Source.
void convert_Rays_to_acoustic_path(const unsigned int &sens)
convertion des rayons en rayons TYMPAN