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

Define the system. More...

Inheritance diagram for CppNoddy::Example::Shallow_2d_rad:
CppNoddy::TwoD_Hyperbolic_System CppNoddy::Uncopyable

Public Member Functions

 Shallow_2d_rad ()
 One dimemsional constant coefft acoustic problem. More...
 
void flux_fn_x (const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &f) const
 Define the vector flux. More...
 
void flux_fn_y (const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &f) const
 A virtual flux function for the y-derivative. More...
 
void Jac_flux_fn_x (const DenseVector< double > &x, const DenseVector< double > &q, DenseMatrix< double > &J) const
 A virtual function function to define the Jacobian of the x-flux function. More...
 
void Jac_flux_fn_y (const DenseVector< double > &x, const DenseVector< double > &q, DenseMatrix< double > &J) const
 A virtual function function to define the Jacobian of the y-flux function. More...
 
void max_charac_speed (const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &c) const
 Bound the wave speed. More...
 
- Public Member Functions inherited from CppNoddy::TwoD_Hyperbolic_System
 TwoD_Hyperbolic_System (const unsigned &order)
 
virtual ~TwoD_Hyperbolic_System ()
 An empty destructor, virtual since we have virtual methods. More...
 
virtual void flux_fn_x (const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &f) const
 A virtual flux function for the x-derivative. More...
 
virtual void flux_fn_y (const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &f) const
 A virtual flux function for the y-derivative. More...
 
virtual void Jac_flux_fn_x (const DenseVector< double > &x, const DenseVector< double > &q, DenseMatrix< double > &J) const
 A virtual function function to define the Jacobian of the x-flux function. More...
 
virtual void Jac_flux_fn_y (const DenseVector< double > &x, const DenseVector< double > &q, DenseMatrix< double > &J) const
 A virtual function function to define the Jacobian of the y-flux function. More...
 
virtual void max_charac_speed (const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &c) const
 A virtual method that is used to bound the characteristic speed in both directions. More...
 
virtual std::vector< bool > edge_values (const int &face_index, const DenseVector< double > &x, DenseVector< double > &q) const
 Define the edge boundary conditions. More...
 
virtual void edge_slopes (const int &face_index, const DenseVector< double > &x, DenseVector< double > &sigma_n) const
 Define the edge boundary condition slopes. More...
 
virtual void source_fn (const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &r) const
 
unsigned get_order ()
 

Additional Inherited Members

- Protected Attributes inherited from CppNoddy::TwoD_Hyperbolic_System
const unsigned ORDER_OF_SYSTEM
 The order of the system of equations. More...
 

Detailed Description

Define the system.

Definition at line 29 of file HYP2DRadialDamBreak.cpp.

Constructor & Destructor Documentation

◆ Shallow_2d_rad()

CppNoddy::Example::Shallow_2d_rad::Shallow_2d_rad ( )
inline

One dimemsional constant coefft acoustic problem.

Definition at line 35 of file HYP2DRadialDamBreak.cpp.

36 {}
A class to represent a two-dimensional hyperbolic system of equations.

Member Function Documentation

◆ flux_fn_x()

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

Define the vector flux.

Reimplemented from CppNoddy::TwoD_Hyperbolic_System.

Definition at line 39 of file HYP2DRadialDamBreak.cpp.

40 {
41 f[ h ] = q[ hu ];
42 f[ hu ] = q[ hu ] * q[ hu ] / q[ h ] + g * q[ h ] * q[ h ] / 2.;
43 f[ hv ] = q[ hu ] * q[ hv ] / q[ h ];
44 }
@ f
Definition: BVPBerman.cpp:15
double g(1.0)
gravitational acceleration

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

◆ flux_fn_y()

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

A virtual flux function for the y-derivative.

Parameters
xThe vector position
qThe unknowns
fThe flux function

Reimplemented from CppNoddy::TwoD_Hyperbolic_System.

Definition at line 46 of file HYP2DRadialDamBreak.cpp.

47 {
48 f[ h ] = q[ hv ];
49 f[ hu ] = q[ hu ] * q[ hv ] / q[ h ];
50 f[ hv ] = q[ hv ] * q[ hv ] / q[ h ] + g * q[ h ] * q[ h ] / 2.;
51 }

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

◆ Jac_flux_fn_x()

void CppNoddy::Example::Shallow_2d_rad::Jac_flux_fn_x ( const DenseVector< double > &  x,
const DenseVector< double > &  q,
DenseMatrix< double > &  J 
) const
inlinevirtual

A virtual function function to define the Jacobian of the x-flux function.

The default method uses first-order finite differencing to compute the Jacobian if not otherwise specified by the user.

Parameters
xThe vector position
qThe unknowns
JThe Jacobian of the flux function

cheap & nasty differencing

Reimplemented from CppNoddy::TwoD_Hyperbolic_System.

Definition at line 54 of file HYP2DRadialDamBreak.cpp.

55 {
56 J( 0, hu ) = 1;
57 J( 1, h ) = - q[ hu ] * q[ hu ] / ( q[ h ] * q[ h ] ) + g * q[ h ];
58 J( 1, hu ) = 2 * q[ hu ] / q[ h ];
59 J( 2, h ) = - q[ hu ] * q[ hv ] / ( q[ h ] * q[ h ] );
60 J( 2, hu ) = q[ hv ] / q[ h ];
61 J( 2, hv ) = q[ hu ] / q[ h ];
62 }

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

◆ Jac_flux_fn_y()

void CppNoddy::Example::Shallow_2d_rad::Jac_flux_fn_y ( const DenseVector< double > &  x,
const DenseVector< double > &  q,
DenseMatrix< double > &  J 
) const
inlinevirtual

A virtual function function to define the Jacobian of the y-flux function.

The default method uses first-order finite differencing to compute the Jacobian if not otherwise specified by the user.

Parameters
xThe vector position
qThe unknowns
JThe Jacobian of the flux function

cheap & nasty differencing

Reimplemented from CppNoddy::TwoD_Hyperbolic_System.

Definition at line 64 of file HYP2DRadialDamBreak.cpp.

65 {
66 J( 0, hv ) = 1;
67 J( 1, h ) = - q[ hu ] * q[ hv ] / ( q[ h ] * q[ h ] );
68 J( 1, hu ) = q[ hv ] / q[ h ];
69 J( 1, hv ) = q[ hu ] / q[ h ];
70 J( 2, h ) = - q[ hv ] * q[ hv ] / ( q[ h ] * q[ h ] ) + g * q[ h ];
71 J( 2, hv ) = 2 * q[ hv ] / q[ h ];
72 }

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

◆ max_charac_speed()

void CppNoddy::Example::Shallow_2d_rad::max_charac_speed ( const DenseVector< double > &  x,
const DenseVector< double > &  q,
DenseVector< double > &  c 
) const
inlinevirtual

Bound the wave speed.

Reimplemented from CppNoddy::TwoD_Hyperbolic_System.

Definition at line 75 of file HYP2DRadialDamBreak.cpp.

76 {
77 // wave speed
78 double cc = sqrt( g * q[ h ] );
79 // flow speed
80 double U = q[ hu ] / q[ h ];
81 double V = q[ hv ] / q[ h ];
82 // maximum shock speed
83 c[ 0 ] = std::max( std::abs( U + cc ), std::abs( U - cc ) );
84 c[ 1 ] = std::max( std::abs( V + cc ), std::abs( V - cc ) );
85 }
@ V
Definition: BVPKarman.cpp:20
@ U
Definition: BVPKarman.cpp:20

References CppNoddy::Example::g(), h, hu, hv, U, and V.


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

© 2012

R.E. Hewitt