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

Measure pressure values on a fixed location in the scene. More...

#include <Receiver.h>

Collaboration diagram for OpenPSTD::Kernel::Receiver:
Collaboration graph

Public Member Functions

 Receiver (std::vector< float > location, std::shared_ptr< PSTDSettings > config, int id, std::shared_ptr< Domain > container)
 Initializes a receiver on coordinates (x,y,z) in grid space (not fixed to integers) More...
 
float compute_local_pressure ()
 Calculates the sound pressure at the receiver at the current time step. More...
 

Public Attributes

const float x
 
const float y
 
const float z
 
int id
 
std::vector< float > location
 Unrounded (grid) location.
 
Point grid_location
 Integer grid location. More...
 
std::vector< float > grid_offset
 Distance from the receiver to the top left of the cell.
 
std::shared_ptr< PSTDSettingsconfig
 Config file containing the receiver parameters.
 
std::shared_ptr< Domaincontainer_domain
 Domain containing the receiver.
 
std::vector< float > received_values
 Vector of observed pressure values in the receiver.
 

Detailed Description

Measure pressure values on a fixed location in the scene.

This class measures and stores the sound pressure on each time step. Note that receiver locations (just like speaker locations) are defined on the grid, but don't need to lie on grid points; their coordinates are not rounded off. If the Receiver is not located on a grid point, the sound values are interpolated, either from the nearest grid point or using a spectral interpolation method.

Constructor & Destructor Documentation

OpenPSTD::Kernel::Receiver::Receiver ( std::vector< float >  location,
std::shared_ptr< PSTDSettings config,
int  id,
std::shared_ptr< Domain container 
)

Initializes a receiver on coordinates (x,y,z) in grid space (not fixed to integers)

Parameters
locationfloat coordinates in 3D grid space. For 2D, leave z=0
configPointer to configuration object
idUnique receiver identifier
containerThe domain in which the receiver is located. This should not be a PML-domain.

Member Function Documentation

float OpenPSTD::Kernel::Receiver::compute_local_pressure ( )

Calculates the sound pressure at the receiver at the current time step.

Depending on config, this method uses the nearest neighbour value (fast, inaccurate) or spectral interpolation (slower, more accurate)

See also
spatderp3
config
Returns
float approximation of the sound pressure in receiver location

Member Data Documentation

Point OpenPSTD::Kernel::Receiver::grid_location

Integer grid location.

<=> Cell containing the receiver.


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