openPSTD  2.0
Open source simulation for sound propagation in urban environments
Public Member Functions | Public Attributes | List of all members
OpenPSTD::Kernel::Scene Class Reference

Collection of the rectangular domains. More...

#include <Scene.h>

Collaboration diagram for OpenPSTD::Kernel::Scene:
Collaboration graph

Public Member Functions

 Scene (std::shared_ptr< PSTDSettings > settings)
 Constructor of Scene object. More...
 
void add_receiver (const float x, const float y, const float z)
 Adds a receiver to the scene. More...
 
void add_speaker (const float x, const float y, const float z)
 Adds a speaker to the scene. More...
 
void add_domain (std::shared_ptr< Domain > domain)
 Add domain to the scene. More...
 
void compute_pml_matrices ()
 Computes the perfectly matched layer matrix coefficients for each domain in the scene.
 
void add_pml_domains ()
 Add the necessary perfectly matched layer domain to the current scene, checks which layers belong to which domains, and checks which layers can be merged.
 
void apply_pml_matrices ()
 Applies the layer coefficients for each domain in the scene.
 
Eigen::ArrayXXf get_pressure_field ()
 Obtains the global pressure field by summing the pressure in each domain. More...
 
std::shared_ptr< Domainget_domain (int id)
 Fetch a domain with specified ID, if existing. More...
 
int get_new_id ()
 Returns a new domain ID integer.
 

Public Attributes

std::vector< std::shared_ptr< Domain > > domain_list
 List with domains.
 
std::shared_ptr< PSTDSettingssettings
 Settings for the simulation.
 
Point top_left
 Top left of the most top left domain.
 
Initial sound pressure Point bottom_right
 Bottom right of the most bottom right domain.
 
Point size
 Difference between top left and bottom right.
 
std::vector< std::shared_ptr< Boundary > > boundary_list
 
std::vector< std::shared_ptr< Receiver > > receiver_list
 
std::vector< std::shared_ptr< Speaker > > speaker_list
 

Detailed Description

Collection of the rectangular domains.

This class holds all the (PML) domains through which the sound propagates. It also has a reference to all speakers and receivers as well as the boundaries.

Constructor & Destructor Documentation

OpenPSTD::Kernel::Scene::Scene ( std::shared_ptr< PSTDSettings settings)

Constructor of Scene object.

Parameters
configpointer to configuration settings

Member Function Documentation

void OpenPSTD::Kernel::Scene::add_domain ( std::shared_ptr< Domain domain)

Add domain to the scene.

Checks for every other domain whether they share a boundary and processes pml domains correctly

Parameters
domainpointer to domain object to be added.
void OpenPSTD::Kernel::Scene::add_receiver ( const float  x,
const float  y,
const float  z 
)

Adds a receiver to the scene.

A receiver logs the sound perceived in that location each time step. The coordinates have to correspond to the (integer) grid points from the scene descriptor file, but need not be integer.

Parameters
xcoordinate on grid in x dimension
ycoordinate on grid in y dimension
xcoordinate on grid in z dimension
void OpenPSTD::Kernel::Scene::add_speaker ( const float  x,
const float  y,
const float  z 
)

Adds a speaker to the scene.

A speaker emits the sound that is modelled by the PSTD method. The coordinates have to correspond to the (integer) grid points from the scene descriptor file, but need not be integer.

Parameters
xcoordinate on grid in x dimension
ycoordinate on grid in y dimension
xcoordinate on grid in z dimension
shared_ptr< Domain > OpenPSTD::Kernel::Scene::get_domain ( int  id)

Fetch a domain with specified ID, if existing.

Parameters
idinteger ID of domain.
Returns
: domain pointer if domain with id exists, else nullptr.
Eigen::ArrayXXf OpenPSTD::Kernel::Scene::get_pressure_field ( )

Obtains the global pressure field by summing the pressure in each domain.

Returns
: Array with pressure values

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