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

Locations and amplitude of initial sound pressure. More...

#include <Speaker.h>

Collaboration diagram for OpenPSTD::Kernel::Speaker:
Collaboration graph

Public Member Functions

 Speaker (std::vector< float > location)
 Speaker initialization with coordinates from scene. More...
 
void addDomainContribution (std::shared_ptr< Domain > domain)
 Adds the initial sound pressure to the domain values. More...
 

Public Attributes

const float x
 
const float y
 
const float z
 
std::vector< float > location
 
Point grid_point = Point((int) x, (int) y, (int) z)
 
std::vector< float > grid_offset
 

Detailed Description

Locations and amplitude of initial sound pressure.

This class is a 'wrapper' around a gaussian kernel contribution. Note that speaker locations (just like receiver locations) are defined on the grid, but don't need to lie on grid points; their coordinates are not rounded off.

Constructor & Destructor Documentation

OpenPSTD::Kernel::Speaker::Speaker ( std::vector< float >  location)

Speaker initialization with coordinates from scene.

Parameters
locationvector of world coordinates

Member Function Documentation

void OpenPSTD::Kernel::Speaker::addDomainContribution ( std::shared_ptr< Domain domain)

Adds the initial sound pressure to the domain values.

The initial pressure shape is a Gaussian, defined as $p_0(x,y) = e^{-\beta((x-x_s)^2+(y-y_s)^2)}$ with bandwidth $\beta = -3e^{-6}c^2/dx^2$ and speaker location $(x_s,y_s)$.

Parameters
domaindomain to compute sound pressure contribution for

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