acoustic.cpp
Go to the documentation of this file.
1 
3 #include <cmath>
4 #include "acoustic.hpp"
5 #include "../../misc/universal_error.hpp"
6 
7 AcousticInitCond::AcousticInitCond(double d0, double p0,
8  EquationOfState const& eos,
9  double dd, double wavelength):
10  c0_(eos.dp2c(d0,p0)),
11  density_(dd,wavelength,0,d0),
12  pressure_(dd*pow(c0_,2),
13  wavelength,0,p0),
14  xvelocity_(c0_*dd/d0,
15  wavelength,0,0),
16  yvelocity_(0) {}
17 
19 (string const& pname) const
20 {
21  if("density"==pname)
22  return density_;
23  else if("pressure"==pname)
24  return pressure_;
25  else if("xvelocity"==pname)
26  return xvelocity_;
27  else if("yvelocity"==pname)
28  return yvelocity_;
29  else
30  throw UniversalError("Unknown profile name "+pname);
31 }
SpatialDistribution1D const & getProfile(string const &pname) const
Returns the spatial distribution of one of the hydrodynamic variables.
Definition: acoustic.cpp:19
Initial conditions for single mode acoustic waves.
Container for error reports.
Base class for initial conditions.
Base class for equation of state.
AcousticInitCond(double d0, double p0, EquationOfState const &eos, double dd, double wavelength)
Class constructor.
Definition: acoustic.cpp:7