Code_TYMPAN  4.2.0
Industrial site acoustic simulation
Public Member Functions | Protected Attributes | List of all members
Solver Class Reference

The Solver class gives an interface to the developer to add easily a new acoustic method using ray tracing. This class provides a way for the programmer to interact at each point of the ray tracing algorithm. It is possible to add several acoustic objects to model phenomena like diffraction. The features of this class are: More...

#include <Solver.h>

Inheritance diagram for Solver:
Inheritance graph
[legend]
Collaboration diagram for Solver:
Collaboration graph
[legend]

Public Member Functions

 Solver ()
 Default constructor. More...
 
 Solver (Solver *_solver)
 Copy constructor. More...
 
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 the Scene. During the first phase, we iterate on the different meta-objects lists and are extracted elements for the ray tracer. Typically, a wall object would be transformed in a set of Primitives, extract polylines from punctual Sources,... The Scene will be loaded with objects related to acoustic calculation which are not present into the physical description of the Scene. For instance, diffraction edges are modeled by a cylinder and should be generated. More...
 
virtual double leafTreatment (vector< Intersection > &primitives)
 Leaf treatment function for accelerators. The default is to keep only the first intersection. It is possible to keep all the intersections which happens before a type specific intersection. For instance, we can keep all the intersections before an intersection with a triangle considered as blocking. More...
 
virtual bool valideIntersection (Ray *r, Intersection *inter)
 Validation function for an intersection. If the intersection is validated, an event is created and added on the ray. More...
 
virtual bool valideRayon (Ray *r)
 Ray validation. The developer may, for instance, choose a filtering on the rays and only validate single paths. If the ray is valid, it is added to the valid rays list and will be used for the export. More...
 
virtual bool invalidRayon (Ray *r)
 Method to arrange the invalid rays. The invalid rays are put away into a debug_ray array in order to visualize all of the rays. More...
 
virtual deque< Ray * > * getValidRays ()
 Return a pointer to the validated rays list. More...
 
deque< Ray * > * getDebugRays ()
 Return a pointer to the invalidated rays list. More...
 
virtual void finish ()
 End the operations. More...
 
virtual void clean ()
 Delete the valid rays array. More...
 
virtual bool loadParameters ()
 Load the computation parameters. More...
 

Protected Attributes

deque< Ray * > valid_rays
 Rays list which are validated by the solver. More...
 
deque< Ray * > debug_rays
 Rays list which are invalidated by the solver. More...
 

Detailed Description

The Solver class gives an interface to the developer to add easily a new acoustic method using ray tracing. This class provides a way for the programmer to interact at each point of the ray tracing algorithm. It is possible to add several acoustic objects to model phenomena like diffraction. The features of this class are:

Definition at line 42 of file Solver.h.

Constructor & Destructor Documentation

◆ Solver() [1/2]

Solver::Solver ( )
inline

Default constructor.

Definition at line 46 of file Solver.h.

◆ Solver() [2/2]

Solver::Solver ( Solver _solver)
inline

Copy constructor.

Definition at line 51 of file Solver.h.

Here is the call graph for this function:

Member Function Documentation

◆ clean()

void Solver::clean ( )
virtual

Delete the valid rays array.

Definition at line 55 of file Solver.cpp.

Here is the caller graph for this function:

◆ finish()

void Solver::finish ( )
virtual

End the operations.

Reimplemented in BasicSolver, and TYANIME3DRayTracerSolverAdapter.

Definition at line 66 of file Solver.cpp.

Here is the caller graph for this function:

◆ getDebugRays()

deque<Ray*>* Solver::getDebugRays ( )
inline

Return a pointer to the invalidated rays list.

Definition at line 108 of file Solver.h.

Here is the call graph for this function:

◆ getValidRays()

virtual deque<Ray*>* Solver::getValidRays ( )
inlinevirtual

Return a pointer to the validated rays list.

Definition at line 104 of file Solver.h.

Here is the caller graph for this function:

◆ invalidRayon()

bool Solver::invalidRayon ( Ray r)
virtual

Method to arrange the invalid rays. The invalid rays are put away into a debug_ray array in order to visualize all of the rays.

Parameters
r: Ray to invalid.
Returns
Return true if the ray has been invalidated.

Reimplemented in BasicSolver, and TYANIME3DRayTracerSolverAdapter.

Definition at line 71 of file Solver.cpp.

Here is the caller graph for this function:

◆ leafTreatment()

double Solver::leafTreatment ( vector< Intersection > &  primitives)
virtual

Leaf treatment function for accelerators. The default is to keep only the first intersection. It is possible to keep all the intersections which happens before a type specific intersection. For instance, we can keep all the intersections before an intersection with a triangle considered as blocking.

Parameters
primitivesAll the primitives encountered by the current leaf.
Returns
Maximal time authorized by the ray. It is the intersection time before the first blocking primitive.

Definition at line 38 of file Solver.cpp.

Here is the caller graph for this function:

◆ loadParameters()

bool Solver::loadParameters ( )
virtual

Load the computation parameters.

Returns
True if operation succeeds.

Definition at line 78 of file Solver.cpp.

Here is the caller graph for this function:

◆ postTreatmentScene()

bool Solver::postTreatmentScene ( Scene scene,
std::vector< Source > &  sources,
std::vector< Recepteur > &  recepteurs 
)
virtual

Virtual function to post-process the Scene. It has two phases: transform the meta-objects and load the Scene. During the first phase, we iterate on the different meta-objects lists and are extracted elements for the ray tracer. Typically, a wall object would be transformed in a set of Primitives, extract polylines from punctual Sources,... The Scene will be loaded with objects related to acoustic calculation which are not present into the physical description of the Scene. For instance, diffraction edges are modeled by a cylinder and should be generated.

Parameters
sceneScene to post-process
sourcesSources
recepteursReceptors
Returns
Return true if success

Reimplemented in BasicSolver, and TYANIME3DRayTracerSolverAdapter.

Definition at line 33 of file Solver.cpp.

Here is the caller graph for this function:

◆ valideIntersection()

bool Solver::valideIntersection ( Ray r,
Intersection inter 
)
virtual

Validation function for an intersection. If the intersection is validated, an event is created and added on the ray.

Parameters
r: Ray
inter: Intersection to validate
Returns
Return true if the validation is done
Warning
The validation functions should agree with the primitives types in the Scene. The unsupported primitives types should throw an exception if not handled by the simulation.

Reimplemented in BasicSolver, and TYANIME3DRayTracerSolverAdapter.

Definition at line 44 of file Solver.cpp.

Here is the caller graph for this function:

◆ valideRayon()

bool Solver::valideRayon ( Ray r)
virtual

Ray validation. The developer may, for instance, choose a filtering on the rays and only validate single paths. If the ray is valid, it is added to the valid rays list and will be used for the export.

Parameters
r: Ray to validate. The ray should have a source and a receiver.
Returns
Return true if the ray has been validated.

Reimplemented in BasicSolver, and TYANIME3DRayTracerSolverAdapter.

Definition at line 49 of file Solver.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ debug_rays

deque<Ray*> Solver::debug_rays
protected

Rays list which are invalidated by the solver.

Definition at line 124 of file Solver.h.

◆ valid_rays

deque<Ray*> Solver::valid_rays
protected

Rays list which are validated by the solver.

Definition at line 123 of file Solver.h.


The documentation for this class was generated from the following files: