CppNoddy  0.92
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CppNoddy::Example::Acoustic_1d_ref Class Reference

Define the system. More...

Inheritance diagram for CppNoddy::Example::Acoustic_1d_ref:
CppNoddy::OneD_Hyperbolic_System CppNoddy::Uncopyable

Public Member Functions

 Acoustic_1d_ref ()
 One dimemsional constant coefft acoustic problem. More...
 
void flux_fn (const double &x, const DenseVector< double > &q, DenseVector< double > &f) const
 Define the vector flux. More...
 
double max_charac_speed (const DenseVector< double > &q) const
 Bound the shock speed. More...
 
std::vector< bool > edge_values (const int face_index, const double &x, DenseVector< double > &q, const double &t) const
 edge conditions More...
 
- Public Member Functions inherited from CppNoddy::OneD_Hyperbolic_System
 OneD_Hyperbolic_System (const unsigned &order)
 
virtual ~OneD_Hyperbolic_System ()
 An empty destructor, virtual since we have virtual methods. More...
 
virtual void flux_fn (const double &x, const DenseVector< double > &q, DenseVector< double > &f) const
 A virtual flux function. More...
 
virtual void Jac_flux_fn (const double &x, const DenseVector< double > &q, DenseMatrix< double > &J) const
 A virtual function function to define the Jacobian of the flux function. More...
 
virtual double max_charac_speed (const DenseVector< double > &q) const
 A virtual method that is used to bound the shock speed and must be implemented by the user. More...
 
virtual bool_vec edge_values (const int face_index, const double &x, DenseVector< double > &q, const double &t=0.0) const
 Define the edge boundary conditions. More...
 
virtual void source_fn (const double &x, const DenseVector< double > &q, const DenseVector< double > &slope, DenseVector< double > &r) const
 
unsigned get_order ()
 

Additional Inherited Members

- Protected Attributes inherited from CppNoddy::OneD_Hyperbolic_System
const std::size_t ORDER_OF_SYSTEM
 The order of the system of equations. More...
 

Detailed Description

Define the system.

Definition at line 25 of file HYPAcousticReflection.cpp.

Constructor & Destructor Documentation

◆ Acoustic_1d_ref()

CppNoddy::Example::Acoustic_1d_ref::Acoustic_1d_ref ( )
inline

One dimemsional constant coefft acoustic problem.

Definition at line 31 of file HYPAcousticReflection.cpp.

32 {}
A class to represent a one dimensional hyperbolic system of equations.

Member Function Documentation

◆ edge_values()

std::vector< bool > CppNoddy::Example::Acoustic_1d_ref::edge_values ( const int  face_index,
const double &  x,
DenseVector< double > &  q,
const double &  t 
) const
inlinevirtual

edge conditions

Reimplemented from CppNoddy::OneD_Hyperbolic_System.

Definition at line 51 of file HYPAcousticReflection.cpp.

52 {
53 // reflection condition
54 std::vector<bool> inflow( q.size(), false );
55 q[ u ] = 0.0;
56 inflow[ u ] = true;
57 return inflow;
58 }
std::size_t size() const
A pass-thru definition to get the size of the vector.
Definition: DenseVector.h:330

References CppNoddy::DenseVector< _Type >::size(), and u.

◆ flux_fn()

void CppNoddy::Example::Acoustic_1d_ref::flux_fn ( const double &  x,
const DenseVector< double > &  q,
DenseVector< double > &  f 
) const
inlinevirtual

Define the vector flux.

Reimplemented from CppNoddy::OneD_Hyperbolic_System.

Definition at line 35 of file HYPAcousticReflection.cpp.

36 {
37 f[ p ] = K * q[ u ];
38 f[ u ] = q[ p ] / rho;
39 }
@ f
Definition: BVPBerman.cpp:15
double K(4.0)
bulk modulus

References f, CppNoddy::Example::K(), p, rho, and u.

◆ max_charac_speed()

double CppNoddy::Example::Acoustic_1d_ref::max_charac_speed ( const DenseVector< double > &  q) const
inlinevirtual

Bound the shock speed.

Reimplemented from CppNoddy::OneD_Hyperbolic_System.

Definition at line 42 of file HYPAcousticReflection.cpp.

43 {
44 // sound speeds
45 double c = sqrt( K / rho );
46 // maximum shock speed
47 return c;
48 }

References CppNoddy::Example::K(), and rho.


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

© 2012

R.E. Hewitt