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

Class hosting all the informations needed for ray tracing. It contains the function to launch the rays treatment and the main loop of the program. To run a simulation, a call to launchSimulation() is enough. More...

#include <Simulation.h>

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

Public Member Functions

 Simulation ()
 Constructor. More...
 
 Simulation (const Simulation &other)
 Copy constructor. More...
 
virtual ~Simulation ()
 Destructor. More...
 
ScenegetScene ()
 Get a pointer to the scene. More...
 
Sceneget_receptors_landscape ()
 Return the geometric distribution of receptors. More...
 
void setSolver (Solver *_solver)
 Tool function to set the acoustic solver for the simulation. More...
 
SolvergetSolver ()
 Get the acoustic solver. More...
 
EnginegetEngine ()
 Get the engine. More...
 
void clean ()
 Clean the simulation: the scene, sources, and receptors and all the rays are deleted. More...
 
bool launchSimulation ()
 Program main loop. Extract all the rays from the sources then treat them. The loop finishes when the treatment stack is empty and there is no more sources creating rays. Once the ray is treated, either it is added to the stack to continue its path or is suppressed. The receptor search is launched once the ray is treated. Single-threaded function. More...
 
void addSource (const Source &s)
 Tool function to add a source to the simulation. More...
 
std::vector< Source > & getSources ()
 Return the sources list of the scene. More...
 
void addRecepteur (Recepteur &r)
 Tool function to add quickly a receptor for the simulation. More...
 
std::vector< Recepteur > & getRecepteurs ()
 Return a vector of all receptors of the scene. More...
 
void setMaterialManager (MaterialManager *_materialManager)
 Set/Get the pointer to the MaterialManager. More...
 
MaterialManagergetMaterialManager ()
 
void setEngine (engineChoice engine=DEFAULT)
 Set the engine (by default, the DefaultEngine) More...
 
AcousticRaytracerConfigurationgetConfiguration ()
 Get the configuration. More...
 
- Public Member Functions inherited from Base
 Base ()
 Default constructor. More...
 
 Base (const Base &other)
 Copy constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
std::string getName ()
 Get the name of the object. More...
 
void setName (const std::string &_name)
 Set the name of the object. More...
 

Protected Attributes

Scene scene
 Description of the geometry in an accelerated structure. More...
 
Scene receptors_landscape
 Geometric distribution of receptors. More...
 
Solversolver
 Pointer to a solver (acoustic method) More...
 
MaterialManagermaterialManager
 Pointer to a MaterialManager object. More...
 
std::vector< Sourcesources
 All the acoustic sources for the Simulation. More...
 
std::vector< Recepteurrecepteurs
 All the acoustic receptors for the Simulation. More...
 
Engineengine
 Pointer to the selected Engine. More...
 
engineChoice engineC
 Enum giving the Engine choice. More...
 
unsigned int compteurSource
 Source counter. More...
 
unsigned int compteurRecepteur
 Receptor counter. More...
 
AcousticRaytracerConfigurationconfiguration
 Pointer to the Acoustic RayTracer configuration. More...
 
- Protected Attributes inherited from Base
std::string name
 Each instantiated object may be named. More...
 

Detailed Description

Class hosting all the informations needed for ray tracing. It contains the function to launch the rays treatment and the main loop of the program. To run a simulation, a call to launchSimulation() is enough.

Definition at line 44 of file Simulation.h.

Constructor & Destructor Documentation

◆ Simulation() [1/2]

Simulation::Simulation ( )
inline

Constructor.

Definition at line 49 of file Simulation.h.

Here is the call graph for this function:

◆ Simulation() [2/2]

Simulation::Simulation ( const Simulation other)
inline

Copy constructor.

Definition at line 56 of file Simulation.h.

◆ ~Simulation()

virtual Simulation::~Simulation ( )
inlinevirtual

Destructor.

Definition at line 67 of file Simulation.h.

Member Function Documentation

◆ addRecepteur()

void Simulation::addRecepteur ( Recepteur r)
inline

Tool function to add quickly a receptor for the simulation.

Parameters
r: Receptor

Definition at line 137 of file Simulation.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addSource()

void Simulation::addSource ( const Source s)
inline

Tool function to add a source to the simulation.

Parameters
s: Source

Definition at line 124 of file Simulation.h.

Here is the caller graph for this function:

◆ clean()

void Simulation::clean ( )

Clean the simulation: the scene, sources, and receptors and all the rays are deleted.

Definition at line 17 of file Simulation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_receptors_landscape()

Scene * Simulation::get_receptors_landscape ( )
inline

Return the geometric distribution of receptors.

Definition at line 81 of file Simulation.h.

Here is the caller graph for this function:

◆ getConfiguration()

AcousticRaytracerConfiguration* Simulation::getConfiguration ( )
inline

Get the configuration.

Definition at line 162 of file Simulation.h.

◆ getEngine()

Engine * Simulation::getEngine ( )
inline

Get the engine.

Returns
Pointer to the engine

Definition at line 102 of file Simulation.h.

Here is the call graph for this function:

◆ getMaterialManager()

MaterialManager* Simulation::getMaterialManager ( )
inline

Definition at line 156 of file Simulation.h.

◆ getRecepteurs()

std::vector< Recepteur > & Simulation::getRecepteurs ( )
inline

Return a vector of all receptors of the scene.

Returns
Vector

Definition at line 152 of file Simulation.h.

Here is the caller graph for this function:

◆ getScene()

Scene * Simulation::getScene ( )
inline

Get a pointer to the scene.

Returns
Pointer to the scene

Definition at line 74 of file Simulation.h.

Here is the caller graph for this function:

◆ getSolver()

Solver * Simulation::getSolver ( )
inline

Get the acoustic solver.

Returns
Pointer to the solver

Definition at line 95 of file Simulation.h.

Here is the caller graph for this function:

◆ getSources()

std::vector< Source > & Simulation::getSources ( )
inline

Return the sources list of the scene.

Returns
Vector containing the sources

Definition at line 130 of file Simulation.h.

Here is the caller graph for this function:

◆ launchSimulation()

bool Simulation::launchSimulation ( )

Program main loop. Extract all the rays from the sources then treat them. The loop finishes when the treatment stack is empty and there is no more sources creating rays. Once the ray is treated, either it is added to the stack to continue its path or is suppressed. The receptor search is launched once the ray is treated. Single-threaded function.

Returns
True if succeeds

Definition at line 30 of file Simulation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEngine()

void Simulation::setEngine ( engineChoice  engine = DEFAULT)
inline

Set the engine (by default, the DefaultEngine)

Definition at line 159 of file Simulation.h.

Here is the caller graph for this function:

◆ setMaterialManager()

void Simulation::setMaterialManager ( MaterialManager _materialManager)
inline

Set/Get the pointer to the MaterialManager.

Definition at line 155 of file Simulation.h.

◆ setSolver()

void Simulation::setSolver ( Solver _solver)
inline

Tool function to set the acoustic solver for the simulation.

Definition at line 88 of file Simulation.h.

Here is the caller graph for this function:

Member Data Documentation

◆ compteurRecepteur

unsigned int Simulation::compteurRecepteur
protected

Receptor counter.

Definition at line 185 of file Simulation.h.

◆ compteurSource

unsigned int Simulation::compteurSource
protected

Source counter.

Definition at line 184 of file Simulation.h.

◆ configuration

AcousticRaytracerConfiguration* Simulation::configuration
protected

Pointer to the Acoustic RayTracer configuration.

Definition at line 187 of file Simulation.h.

◆ engine

Engine* Simulation::engine
protected

Pointer to the selected Engine.

Definition at line 181 of file Simulation.h.

◆ engineC

engineChoice Simulation::engineC
protected

Enum giving the Engine choice.

Definition at line 182 of file Simulation.h.

◆ materialManager

MaterialManager* Simulation::materialManager
protected

Pointer to a MaterialManager object.

Definition at line 176 of file Simulation.h.

◆ recepteurs

std::vector<Recepteur> Simulation::recepteurs
protected

All the acoustic receptors for the Simulation.

Definition at line 179 of file Simulation.h.

◆ receptors_landscape

Scene Simulation::receptors_landscape
protected

Geometric distribution of receptors.

Definition at line 172 of file Simulation.h.

◆ scene

Scene Simulation::scene
protected

Description of the geometry in an accelerated structure.

Definition at line 170 of file Simulation.h.

◆ solver

Solver* Simulation::solver
protected

Pointer to a solver (acoustic method)

Definition at line 175 of file Simulation.h.

◆ sources

std::vector<Source> Simulation::sources
protected

All the acoustic sources for the Simulation.

Definition at line 178 of file Simulation.h.


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