openPSTD
2.0
Open source simulation for sound propagation in urban environments
|
Collection of the rectangular domains. More...
#include <Scene.h>
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< Domain > | get_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< PSTDSettings > | settings |
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 |
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.
OpenPSTD::Kernel::Scene::Scene | ( | std::shared_ptr< PSTDSettings > | settings | ) |
Constructor of Scene object.
config | pointer to configuration settings |
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
domain | pointer 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.
x | coordinate on grid in x dimension |
y | coordinate on grid in y dimension |
x | coordinate 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.
x | coordinate on grid in x dimension |
y | coordinate on grid in y dimension |
x | coordinate on grid in z dimension |
shared_ptr< Domain > OpenPSTD::Kernel::Scene::get_domain | ( | int | id | ) |
Fetch a domain with specified ID, if existing.
id | integer ID of domain. |
Eigen::ArrayXXf OpenPSTD::Kernel::Scene::get_pressure_field | ( | ) |
Obtains the global pressure field by summing the pressure in each domain.