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

Define the system. More...

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

Public Member Functions

 Shallow_1d_rad ()
 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...
 
void source_fn (const double &x, const DenseVector< double > &q, const DenseVector< double > &slope, DenseVector< double > &r) const
 
- 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 HYPRadialDamBreak.cpp.

Constructor & Destructor Documentation

◆ Shallow_1d_rad()

CppNoddy::Example::Shallow_1d_rad::Shallow_1d_rad ( )
inline

One dimemsional constant coefft acoustic problem.

Definition at line 31 of file HYPRadialDamBreak.cpp.

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

Member Function Documentation

◆ flux_fn()

void CppNoddy::Example::Shallow_1d_rad::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 HYPRadialDamBreak.cpp.

36 {
37 f[ h ] = q[ hu ];
38 f[ hu ] = q[ hu ] * q[ hu ] / q[ h ] + g * q[ h ] * q[ h ] / 2;
39 }
@ f
Definition: BVPBerman.cpp:15
double g(1.0)
gravitational acceleration

References f, CppNoddy::Example::g(), h, and hu.

◆ max_charac_speed()

double CppNoddy::Example::Shallow_1d_rad::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 HYPRadialDamBreak.cpp.

43 {
44 // sound speeds
45 const double c( sqrt( g * q[ h ] ) );
46 // flow speed
47 const double u( q[ hu ] / q[ h ] );
48 // maximum shock speed
49 return std::max( std::abs( u + c ), std::abs( u - c ) );
50 }

References CppNoddy::Example::g(), h, hu, and u.

◆ source_fn()

void CppNoddy::Example::Shallow_1d_rad::source_fn ( const double &  x,
const DenseVector< double > &  q,
const DenseVector< double > &  slope,
DenseVector< double > &  r 
) const
inlinevirtual

Reimplemented from CppNoddy::OneD_Hyperbolic_System.

Definition at line 52 of file HYPRadialDamBreak.cpp.

53 {
54 r[ h ] = -q[ hu ] / x;
55 r[ hu ] = -q[ hu ] * q[ hu ] / ( q[ h ] * x );
56 }

References h, and hu.


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

© 2012

R.E. Hewitt