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

Describes analytical ray curve tracing. More...

#include <Lancer.h>

Collaboration diagram for Lancer:
Collaboration graph
[legend]

Public Member Functions

 Lancer ()
 Constructor. More...
 
 Lancer (Lancer &L)
 Copy constructor. More...
 
 ~Lancer ()
 Destructor. More...
 
void setMeteo (const meteo *Meteo)
 Set the pointer to the weather object. More...
 
void purgeMatRes ()
 Clear the memory of MatRes object. More...
 
void clear ()
 Clear all the arrays. More...
 
void setNbRay (const unsigned int &nb)
 Set the rays number to launch. More...
 
void setTMax (const double &TmpMax)
 Change the maximal propagation time. More...
 
void setDMax (const double &DistMax)
 Set the maximal distance. More...
 
void setTimeStep (const decimal &tt)
 Set the discretization step. More...
 
void setTriangle (vec3 *triangle)
 Add a triangle to the geometry. More...
 
decimal distance_max ()
 Compute and return the maximal distance between sources and receptors. More...
 
void createTemps ()
 Build the time vector (different times solved) More...
 
Step EqRay (const Step &y0)
 Function to define the eikonal equation. More...
 
vec3 valideIntersection (const vec3 &S, const vec3 &R, const vec3 *A, int &reflexion, const vec3 &nExt_plan, const vec3 &SR)
 Compute the intersection point between a plane and a line. More...
 
void intersection (const unsigned int &timer, RayCourb &current, Step &Y_t0, Step &Y_t1)
 
RayCourb RK4 (const Step &y0)
 Fourth order Runge-Kutta algorithm. More...
 
void RemplirMat ()
 Fill the MatRes matrix containing the ray curves. More...
 
void run ()
 Run the calculation. More...
 
void loadRayFile (vector< vec3 > &tableau_norm)
 Read the file containing the starting angles of the rays. More...
 
void setSampler (Sampler *generator)
 Set a pointer to the ray generator. More...
 
SamplergetSampler ()
 Get ray generator for modification. More...
 
void setLaunchType (const unsigned int &launchType)
 Set how rays will be created (launch type) More...
 
void addSource (const vec3 &source)
 Add a source into the sources list. More...
 

Public Attributes

vector< vec3sources
 Sources vector. More...
 
vector< vec3recepteurs
 Receptors vector. More...
 
vector< vec3 * > _plan
 List of objects defined by 3 points. More...
 
meteo_weather
 Pointer to weather. More...
 
Sampler_sampler
 Pointer to a ray generator. More...
 
decimal h
 Discretization step. More...
 
decimal TMax
 Maximal propagation time. More...
 
vector< decimaltemps
 [0:h:TMax] Vector containing the different times solved More...
 
decimal dmax
 Maximal distance traveled by the rays. More...
 
decimal initialAngleTheta
 Initial shot angle according theta. More...
 
decimal finalAngleTheta
 Final shot angle according theta. More...
 
decimal initialAnglePhi
 Initial shot angle according phi. More...
 
decimal finalAnglePhi
 Final shot angle according phi. More...
 
unsigned int nbRay
 Launched rays number. More...
 
unsigned int _launchType
 Launch type with 1:horizontal / 2:vertical / 3:spherical / 4:file. More...
 
bool wantOutFile
 True if an output file is wanted. More...
 
string ray_fileName
 Filename of file containing angles of rays. More...
 
string out_fileName
 Filename of the output file. More...
 
vector< RayCourb * > MatRes
 Array containing the resulting rays for each source. More...
 

Private Member Functions

void init_sampler ()
 Initialize ray generator. More...
 
void save ()
 Save rays to a file. More...
 
Step compute_next_step (const Step &current_step)
 Compute next step taking account of the weather. More...
 

Detailed Description

Describes analytical ray curve tracing.

Definition at line 37 of file Lancer.h.

Constructor & Destructor Documentation

◆ Lancer() [1/2]

Lancer::Lancer ( )

Constructor.

< angle de tir initial selon theta

< angle de tir final selon theta

< angle de tir initial selon phi

< angle de tir final selon phi

< mode de lancer des rayons 1:horizontal / 2:vertical / 3:spheric / 4:file

< true if outputfile wanted

Definition at line 28 of file Lancer.cpp.

◆ Lancer() [2/2]

Lancer::Lancer ( Lancer L)

Copy constructor.

Definition at line 41 of file Lancer.cpp.

◆ ~Lancer()

Lancer::~Lancer ( )

Destructor.

Definition at line 63 of file Lancer.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ addSource()

void Lancer::addSource ( const vec3 source)
inline

Add a source into the sources list.

Definition at line 131 of file Lancer.h.

Here is the caller graph for this function:

◆ clear()

void Lancer::clear ( )
inline

Clear all the arrays.

Definition at line 58 of file Lancer.h.

Here is the caller graph for this function:

◆ compute_next_step()

Step Lancer::compute_next_step ( const Step current_step)
private

Compute next step taking account of the weather.

Definition at line 238 of file Lancer.cpp.

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

◆ createTemps()

void Lancer::createTemps ( )

Build the time vector (different times solved)

Definition at line 251 of file Lancer.cpp.

◆ distance_max()

decimal Lancer::distance_max ( )

Compute and return the maximal distance between sources and receptors.

Definition at line 432 of file Lancer.cpp.

◆ EqRay()

Step Lancer::EqRay ( const Step y0)

Function to define the eikonal equation.

Parameters
y0Initial vector
Returns
A point of the ray under the form of a Step (position, normal)

Definition at line 114 of file Lancer.cpp.

Here is the caller graph for this function:

◆ getSampler()

Sampler* Lancer::getSampler ( )
inline

Get ray generator for modification.

Definition at line 125 of file Lancer.h.

Here is the caller graph for this function:

◆ init_sampler()

void Lancer::init_sampler ( )
private

Initialize ray generator.

Definition at line 68 of file Lancer.cpp.

Here is the call graph for this function:

◆ intersection()

void Lancer::intersection ( const unsigned int &  timer,
RayCourb current,
Step Y_t0,
Step Y_t1 
)

Definition at line 360 of file Lancer.cpp.

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

◆ loadRayFile()

void Lancer::loadRayFile ( vector< vec3 > &  tableau_norm)

Read the file containing the starting angles of the rays.

Parameters
tableau_normVector of the normals

Definition at line 447 of file Lancer.cpp.

◆ purgeMatRes()

void Lancer::purgeMatRes ( )

Clear the memory of MatRes object.

Definition at line 103 of file Lancer.cpp.

Here is the caller graph for this function:

◆ RemplirMat()

void Lancer::RemplirMat ( )

Fill the MatRes matrix containing the ray curves.

Definition at line 202 of file Lancer.cpp.

Here is the call graph for this function:

◆ RK4()

RayCourb Lancer::RK4 ( const Step y0)

Fourth order Runge-Kutta algorithm.

Parameters
y0Initial vector
Returns
Return a ray (list of points)

Definition at line 150 of file Lancer.cpp.

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

◆ run()

void Lancer::run ( )
inline

Run the calculation.

Definition at line 113 of file Lancer.h.

Here is the caller graph for this function:

◆ save()

void Lancer::save ( )
private

Save rays to a file.

Definition at line 496 of file Lancer.cpp.

Here is the caller graph for this function:

◆ setDMax()

void Lancer::setDMax ( const double &  DistMax)
inline

Set the maximal distance.

Definition at line 67 of file Lancer.h.

Here is the caller graph for this function:

◆ setLaunchType()

void Lancer::setLaunchType ( const unsigned int &  launchType)
inline

Set how rays will be created (launch type)

Definition at line 128 of file Lancer.h.

Here is the caller graph for this function:

◆ setMeteo()

void Lancer::setMeteo ( const meteo Meteo)
inline

Set the pointer to the weather object.

Definition at line 52 of file Lancer.h.

◆ setNbRay()

void Lancer::setNbRay ( const unsigned int &  nb)
inline

Set the rays number to launch.

Definition at line 61 of file Lancer.h.

Here is the caller graph for this function:

◆ setSampler()

void Lancer::setSampler ( Sampler generator)
inline

Set a pointer to the ray generator.

Definition at line 122 of file Lancer.h.

◆ setTimeStep()

void Lancer::setTimeStep ( const decimal tt)
inline

Set the discretization step.

Definition at line 70 of file Lancer.h.

Here is the caller graph for this function:

◆ setTMax()

void Lancer::setTMax ( const double &  TmpMax)
inline

Change the maximal propagation time.

Definition at line 64 of file Lancer.h.

Here is the caller graph for this function:

◆ setTriangle()

void Lancer::setTriangle ( vec3 triangle)
inline

Add a triangle to the geometry.

Definition at line 73 of file Lancer.h.

◆ valideIntersection()

vec3 Lancer::valideIntersection ( const vec3 S,
const vec3 R,
const vec3 A,
int &  reflexion,
const vec3 nExt_plan,
const vec3 SR 
)

Compute the intersection point between a plane and a line.

Parameters
[in]SSource
[in]RReceptor
[in]APlane: array containing the 3 vertices of the face (all the vertices should be coplanar)
[out]reflexionTrue if intersection has been founded, False if not
[in]nExt_planExterior normal relative to the plane
[in]SRVector between source and receptor
Returns
Return the intersection point between the plane A and the SR line.

Definition at line 262 of file Lancer.cpp.

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

Member Data Documentation

◆ _launchType

unsigned int Lancer::_launchType

Launch type with 1:horizontal / 2:vertical / 3:spherical / 4:file.

Definition at line 162 of file Lancer.h.

◆ _plan

vector<vec3*> Lancer::_plan

List of objects defined by 3 points.

Definition at line 148 of file Lancer.h.

◆ _sampler

Sampler* Lancer::_sampler

Pointer to a ray generator.

Definition at line 150 of file Lancer.h.

◆ _weather

meteo* Lancer::_weather

Pointer to weather.

Definition at line 149 of file Lancer.h.

◆ dmax

decimal Lancer::dmax

Maximal distance traveled by the rays.

Definition at line 155 of file Lancer.h.

◆ finalAnglePhi

decimal Lancer::finalAnglePhi

Final shot angle according phi.

Definition at line 159 of file Lancer.h.

◆ finalAngleTheta

decimal Lancer::finalAngleTheta

Final shot angle according theta.

Definition at line 157 of file Lancer.h.

◆ h

decimal Lancer::h

Discretization step.

Definition at line 152 of file Lancer.h.

◆ initialAnglePhi

decimal Lancer::initialAnglePhi

Initial shot angle according phi.

Definition at line 158 of file Lancer.h.

◆ initialAngleTheta

decimal Lancer::initialAngleTheta

Initial shot angle according theta.

Definition at line 156 of file Lancer.h.

◆ MatRes

vector<RayCourb*> Lancer::MatRes

Array containing the resulting rays for each source.

Definition at line 167 of file Lancer.h.

◆ nbRay

unsigned int Lancer::nbRay

Launched rays number.

Definition at line 161 of file Lancer.h.

◆ out_fileName

string Lancer::out_fileName

Filename of the output file.

Definition at line 165 of file Lancer.h.

◆ ray_fileName

string Lancer::ray_fileName

Filename of file containing angles of rays.

Definition at line 164 of file Lancer.h.

◆ recepteurs

vector<vec3> Lancer::recepteurs

Receptors vector.

Definition at line 147 of file Lancer.h.

◆ sources

vector<vec3> Lancer::sources

Sources vector.

Definition at line 146 of file Lancer.h.

◆ temps

vector<decimal> Lancer::temps

[0:h:TMax] Vector containing the different times solved

Definition at line 154 of file Lancer.h.

◆ TMax

decimal Lancer::TMax

Maximal propagation time.

Definition at line 153 of file Lancer.h.

◆ wantOutFile

bool Lancer::wantOutFile

True if an output file is wanted.

Definition at line 163 of file Lancer.h.


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