CppNoddy  0.92
Loading...
Searching...
No Matches
Classes | Functions | Variables
CppNoddy::Example Namespace Reference

Classes

class  Acoustic_1d
 Define the system. More...
 
class  Acoustic_1d_ref
 Define the system. More...
 
class  Arc_problem
 Define the residual for arc-length continuation of a circle. More...
 
class  BC_lower
 
class  BC_upper
 
class  Berman_equation
 Define the Berman equation by inheriting Equation base class. More...
 
class  Berman_left_BC
 
class  Berman_residual
 Define a residual function using the boundary conditions for the Berman equation. More...
 
class  Berman_right_BC
 
class  Biharmonic_equation
 Define the biharmonic eigenvalue equation by inheriting Equation base class. More...
 
class  Biharmonic_residual
 Define a residual function using the boundary conditions for the biharmonic_equation. More...
 
class  Blasius_equation
 Define the Blasius equation by inheriting Equation base class. More...
 
class  Blasius_left_BC
 
class  Blasius_residual
 Define a residual function using the boundary conditions for the Blasius profile. More...
 
class  Blasius_right_BC
 
class  Cube_root_problem
 The problem to be solved, here z^3 -1 in complex form. More...
 
class  dd_BC
 
class  Diff_both_BC
 
class  Diff_equation
 
class  diffusion_double
 
class  Diffusion_equations
 
class  Diffusion_left_BC
 Define the boundary conditions. More...
 
class  Diffusion_right_BC
 
class  Euler_1d
 Define the system. More...
 
class  FS_eqn
 Define the Falkner-Skan equation. More...
 
class  FS_residual
 Define a residual function using the boundary conditions for the Blasius profile. More...
 
class  harmonic_both_BC
 
class  harmonic_equation
 Define the harmonic equation by inheriting the Equation base class. More...
 
class  Harmonic_equation
 Define the harmonic equation by inheriting the Equation base class. More...
 
class  Harmonic_left_BC
 
class  Harmonic_right_BC
 
class  Karman_equations
 Define the Karman equations. More...
 
class  Karman_left_BC
 Define the boundary conditions. More...
 
class  Karman_right_BC
 
class  Lorenz_equations
 Define the Lorenz equations by inheriting Equation base class. More...
 
class  Neutral_residual
 
class  Nlin_adv_equation
 
class  Nlin_adv_left_BC
 
class  Nlin_adv_right_BC
 
class  NlinAdv
 Define the system. More...
 
class  Nonidentity_equation
 Define the harmonic equation by inheriting the Equation base class. More...
 
class  Nonidentity_left_BC
 
class  Nonidentity_right_BC
 
class  nonlinear
 
class  OS_bvp_equation
 Define the OSE for the local refinement procedure. More...
 
class  OS_bvp_left_BC
 
class  OS_bvp_right_BC
 
class  OS_evp_both_BC
 
class  OS_evp_equation
 Define the OS equation for the global QZ EVP. More...
 
class  Shallow_1d_rad
 Define the system. More...
 
class  Shallow_2d_rad
 Define the system. More...
 
class  Shallow_2d_source
 Define the system. More...
 
class  Troesch_equation
 Define the harmonic equation by inheriting the Equation base class. More...
 
class  Troesch_left_BC
 
class  Troesch_right_BC
 
class  VCube_root_problem
 Defines the problem: here z^3 -1 = 0, in vector form using real and imaginary parts. More...
 

Functions

double source (const double &x, const double &y, const double &t)
 
const D_complex eye (0., 1.0)
 
const double delta (0.5)
 
D_complex z (double x)
 
D_complex zx (double x)
 
D_complex zxx (double x)
 
double U (double y)
 Globally define the base flow. More...
 
double Udd (double y)
 Globally define the base flow curvature. More...
 
int MAX_REFINE (3)
 
D_complex U (const D_complex &y)
 
D_complex Udd (const D_complex &y)
 
void Qfn (const double &x, double &f)
 The function that defines the integrand. More...
 
void test (unsigned n)
 The test will fail if it requires more than a set number of subintervals in the integration to converge to the exact value to within the specified tol. More...
 
D_complex Cfn (const D_complex &z)
 A std::complex function for z^3 - 1. More...
 
double K (4.0)
 bulk modulus More...
 
double rho_big (4.0)
 higher density More...
 
double rho_small (1.0)
 lower density More...
 
double rho (const double &x)
 Density function for the medium. More...
 
void Q_init (const double &x, DenseVector< double > &q)
 Set the initial state of the system. More...
 
double K (2.0)
 bulk modulus More...
 
double rho (2.0)
 higher density More...
 
double g (1.0)
 gravitational acceleration More...
 
double A (1.0)
 initial hump amplitude More...
 
double gamma (1.4)
 Adiabatic index – ratio of specific heats. More...
 
void Q_init (const double &x, const double &y, DenseVector< double > &q)
 Set the initial state of the system. More...
 
double g (9.81)
 gravitational acceleration More...
 
double A (0.2)
 hump amplitude More...
 
double z (const double &x, const double &y)
 Topography shape. More...
 
double A (10.0)
 
double sigma (100.0)
 
double W_inf (0.0)
 
double W_disk (1.0)
 
const double eps (2.0)
 
double source (const double &y, const double &t)
 
double source_fn (const std::pair< double, double > &coord)
 
double boundary_fn (const std::pair< double, double > &coord)
 

Variables

double s
 relative rotation rate More...
 
double Re
 Globally define the Reynolds number and wavenumber. More...
 
double alpha
 
double wave_speed
 The phase speed of the instability. More...
 
OneD_Node_Mesh< D_complex, D_complexbaseflow
 
bool failed = false
 

Function Documentation

◆ A() [1/3]

double CppNoddy::Example::A ( 0.  2)

hump amplitude

◆ A() [2/3]

double CppNoddy::Example::A ( 1.  0)

initial hump amplitude

Referenced by CppNoddy::Example::Diffusion_equations::residual_fn(), and z().

◆ A() [3/3]

double CppNoddy::Example::A ( 10.  0)

◆ boundary_fn()

double CppNoddy::Example::boundary_fn ( const std::pair< double, double > &  coord)

Definition at line 26 of file PoissonCartesian_petscd_mumps.cpp.

26 {
27 double x = coord.first; double y = coord.second;
28 return x*x*y*y;
29 }

◆ Cfn()

D_complex CppNoddy::Example::Cfn ( const D_complex z)
inline

A std::complex function for z^3 - 1.

Definition at line 13 of file TrivialComplex.cpp.

14 {
15 return z * z * z - 1.;
16 }

References z().

◆ delta()

const double CppNoddy::Example::delta ( 0.  5)

◆ eps()

const double CppNoddy::Example::eps ( 2.  0)

Referenced by source().

◆ eye()

const D_complex CppNoddy::Example::eye ( 0.  ,
1.  0 
)

Referenced by z(), zx(), and zxx().

◆ g() [1/2]

double CppNoddy::Example::g ( 1.  0)

◆ g() [2/2]

double CppNoddy::Example::g ( 9.  81)

gravitational acceleration

◆ gamma()

double CppNoddy::Example::gamma ( 1.  4)

Adiabatic index – ratio of specific heats.

Referenced by CppNoddy::Example::Euler_1d::flux_fn(), and CppNoddy::Example::Euler_1d::max_charac_speed().

◆ K() [1/2]

double CppNoddy::Example::K ( 2.  0)

bulk modulus

◆ K() [2/2]

double CppNoddy::Example::K ( 4.  0)

◆ MAX_REFINE()

int CppNoddy::Example::MAX_REFINE ( )

◆ Q_init() [1/2]

void CppNoddy::Example::Q_init ( const double &  x,
const double &  y,
DenseVector< double > &  q 
)

Set the initial state of the system.

Definition at line 46 of file HYP2DLinearAdvectionXY.cpp.

47 {
48 if ( ( std::abs( x ) < 0.25 ) && ( std::abs( y ) < 0.25 ) )
49 {
50 q[ 0 ] = 1.0;
51 }
52 else
53 {
54 q[ 0 ] = 0.0;
55 }
56 }

◆ Q_init() [2/2]

void CppNoddy::Example::Q_init ( const double &  x,
DenseVector< double > &  q 
)

Set the initial state of the system.

Definition at line 71 of file HYPAcousticImpedance.cpp.

72 {
73 if ( ( x < -1.5 ) && ( x > -2.5 ) )
74 {
75 q[ p ] = 1.0;
76 q[ u ] = q[ p ] / sqrt( K * rho( x ) );
77 }
78 else
79 {
80 q[ p ] = q[ u ] = 0.0;
81 }
82 }

References K(), p, rho, and u.

◆ Qfn()

void CppNoddy::Example::Qfn ( const double &  x,
double &  f 
)

The function that defines the integrand.

Definition at line 19 of file Quadrature.cpp.

20 {
21 f = std::cos( x ) * std::exp( -x / 4. );
22 }
@ f
Definition: BVPBerman.cpp:15

References f.

◆ rho() [1/2]

double CppNoddy::Example::rho ( 2.  0)

higher density

◆ rho() [2/2]

double CppNoddy::Example::rho ( const double &  x)

Density function for the medium.

Definition at line 30 of file HYPAcousticImpedance.cpp.

31 {
32 if ( std::abs( x ) < 1.0 )
33 {
34 return rho_small;
35 }
36 else
37 {
38 return rho_big;
39 }
40 }
double rho_small(1.0)
lower density

References rho_big(), and rho_small().

◆ rho_big()

double CppNoddy::Example::rho_big ( 4.  0)

higher density

Referenced by rho().

◆ rho_small()

double CppNoddy::Example::rho_small ( 1.  0)

lower density

Referenced by CppNoddy::Example::Acoustic_1d::max_charac_speed(), and rho().

◆ sigma()

double CppNoddy::Example::sigma ( 100.  0)

◆ source() [1/2]

double CppNoddy::Example::source ( const double &  x,
const double &  y,
const double &  t 
)

Definition at line 26 of file IBVPLinear.cpp.

27 {
28 return - 2 * std::exp( -x*t ) + ( 1 - y * y ) * ( x + t ) * std::exp( -x*t );
29 }

Referenced by CppNoddy::Example::diffusion_double::residual_fn(), CppNoddy::Example::nonlinear::residual_fn(), and CppNoddy::Example::Nlin_adv_equation::residual_fn().

◆ source() [2/2]

double CppNoddy::Example::source ( const double &  y,
const double &  t 
)

Definition at line 32 of file IBVPNonlinearAdvDiffusion.cpp.

33 {
34 return ( 1 + y + eps * y * ( 1 - y ) * std::exp( -t ) ) * eps * y * ( 1 - y ) * std::exp( -t )
35 - 2 * eps * std::exp( - t ) / Re;
36 }
double Re
Globally define the Reynolds number and wavenumber.
const double eps(2.0)

References eps(), and Re.

◆ source_fn()

double CppNoddy::Example::source_fn ( const std::pair< double, double > &  coord)

Definition at line 21 of file PoissonCartesian_petscd_mumps.cpp.

21 {
22 double x = coord.first; double y = coord.second;
23 return 2*(x*x + y*y);
24 }

◆ test()

void CppNoddy::Example::test ( unsigned  n)

The test will fail if it requires more than a set number of subintervals in the integration to converge to the exact value to within the specified tol.

Definition at line 27 of file Quadrature.cpp.

28 {
29 if ( n > 16777216 )
30 {
31 failed = true;
32 }
33 }

References failed.

◆ U() [1/2]

D_complex CppNoddy::Example::U ( const D_complex y)

Definition at line 23 of file EVPRayleigh_lapack.cpp.

24 {
25 return std::sin( y );
26 }

◆ U() [2/2]

double CppNoddy::Example::U ( double  y)

Globally define the base flow.

Definition at line 36 of file EVPOrrSommerfeldEasy_lapack.cpp.

37 {
38 return 1.0 - y * y;
39 };

◆ Udd() [1/2]

D_complex CppNoddy::Example::Udd ( const D_complex y)

Definition at line 28 of file EVPRayleigh_lapack.cpp.

29 {
30 return - std::sin( y );
31 }

◆ Udd() [2/2]

double CppNoddy::Example::Udd ( double  y)

Globally define the base flow curvature.

Definition at line 41 of file EVPOrrSommerfeldEasy_lapack.cpp.

42 {
43 return -2.0;
44 };

Referenced by CppNoddy::Example::OS_evp_equation::residual_fn(), and CppNoddy::Example::OS_bvp_equation::residual_fn().

◆ W_disk()

double CppNoddy::Example::W_disk ( 1.  0)

◆ W_inf()

double CppNoddy::Example::W_inf ( 0.  0)

◆ z() [1/2]

double CppNoddy::Example::z ( const double &  x,
const double &  y 
)

Topography shape.

Definition at line 22 of file HYP2DShallowSource.cpp.

23 {
24 // to compare with our 1D formulation, we'll make it independent
25 // of the transverse y-coordinate
26 double rsq( ( x - 10 ) * ( x - 10 ) + 0.0 * y * y );
27 return A * std::exp( - 0.5 * rsq );
28 }
double A(1.0)
initial hump amplitude

References A().

◆ z() [2/2]

D_complex CppNoddy::Example::z ( double  x)

Definition at line 29 of file EVPHarmonicComplex_lapack.cpp.

29 {
30 return x + eye*delta*x*(1-x);
31 }
const double delta(0.5)
const D_complex eye(0., 1.0)

References delta(), and eye().

Referenced by Cfn(), CppNoddy::Example::Harmonic_right_BC< _Type >::Harmonic_right_BC(), CppNoddy::Example::Karman_equations::jacobian(), CppNoddy::Example::Nonidentity_equation< _Type, _Xtype >::matrix0(), CppNoddy::Example::Diffusion_equations::matrix0(), CppNoddy::Example::Nlin_adv_equation::matrix1(), CppNoddy::Example::nonlinear::matrix2(), CppNoddy::Example::Nonidentity_right_BC< _Type >::Nonidentity_right_BC(), CppNoddy::Example::Harmonic_right_BC< _Type >::residual_fn(), CppNoddy::Example::Nonidentity_right_BC< _Type >::residual_fn(), CppNoddy::Example::Troesch_left_BC< _Type >::residual_fn(), CppNoddy::Example::Troesch_right_BC< _Type >::residual_fn(), CppNoddy::Example::Harmonic_equation< _Type, _Xtype >::residual_fn(), CppNoddy::Example::Nonidentity_equation< _Type, _Xtype >::residual_fn(), CppNoddy::Example::Troesch_equation< _Type, _Xtype >::residual_fn(), CppNoddy::Example::Harmonic_left_BC< _Type >::residual_fn(), CppNoddy::Example::OS_evp_both_BC::residual_fn(), CppNoddy::Example::OS_bvp_left_BC::residual_fn(), CppNoddy::Example::OS_bvp_right_BC::residual_fn(), CppNoddy::Example::Biharmonic_equation::residual_fn(), CppNoddy::Example::Cube_root_problem::residual_fn(), CppNoddy::Example::OS_evp_equation::residual_fn(), CppNoddy::Example::OS_bvp_equation::residual_fn(), CppNoddy::Example::Berman_left_BC::residual_fn(), CppNoddy::Example::Berman_right_BC::residual_fn(), CppNoddy::Example::Blasius_left_BC::residual_fn(), CppNoddy::Example::Blasius_right_BC::residual_fn(), CppNoddy::Example::Karman_left_BC::residual_fn(), CppNoddy::Example::Karman_right_BC::residual_fn(), CppNoddy::Example::dd_BC::residual_fn(), CppNoddy::Example::BC_lower::residual_fn(), CppNoddy::Example::BC_upper::residual_fn(), CppNoddy::Example::harmonic_both_BC::residual_fn(), CppNoddy::Example::Diff_both_BC::residual_fn(), CppNoddy::Example::Diffusion_left_BC::residual_fn(), CppNoddy::Example::Diffusion_right_BC::residual_fn(), CppNoddy::Example::Nlin_adv_left_BC::residual_fn(), CppNoddy::Example::Nlin_adv_right_BC::residual_fn(), CppNoddy::Example::Arc_problem::residual_fn(), CppNoddy::Example::FS_eqn::residual_fn(), CppNoddy::Example::FS_residual::residual_fn(), CppNoddy::Example::Berman_equation::residual_fn(), CppNoddy::Example::Blasius_equation::residual_fn(), CppNoddy::Example::Karman_equations::residual_fn(), CppNoddy::Example::diffusion_double::residual_fn(), CppNoddy::Example::nonlinear::residual_fn(), CppNoddy::Example::Neutral_residual::residual_fn(), CppNoddy::Example::VCube_root_problem::residual_fn(), CppNoddy::Example::Diffusion_equations::residual_fn(), CppNoddy::Example::Nlin_adv_equation::residual_fn(), CppNoddy::Example::Lorenz_equations::residual_fn(), CppNoddy::Example::harmonic_equation::residual_fn(), CppNoddy::Example::Diff_equation::residual_fn(), and CppNoddy::Example::Shallow_2d_source::source_fn().

◆ zx()

D_complex CppNoddy::Example::zx ( double  x)

Definition at line 33 of file EVPHarmonicComplex_lapack.cpp.

33 {
34 return 1.0 + eye*delta*(1-2.*x);
35 }

References delta(), and eye().

◆ zxx()

D_complex CppNoddy::Example::zxx ( double  x)

Definition at line 37 of file EVPHarmonicComplex_lapack.cpp.

37 {
38 return -eye*2.*delta;
39 }

References delta(), and eye().

Variable Documentation

◆ alpha

double CppNoddy::Example::alpha

◆ baseflow

OneD_Node_Mesh<D_complex, D_complex> CppNoddy::Example::baseflow

Definition at line 19 of file EVPRayleigh_lapack.cpp.

◆ failed

bool CppNoddy::Example::failed = false

Definition at line 16 of file Quadrature.cpp.

Referenced by test().

◆ Re

double CppNoddy::Example::Re

◆ s

double CppNoddy::Example::s

◆ wave_speed

double CppNoddy::Example::wave_speed

The phase speed of the instability.

Definition at line 34 of file EVPOrrSommerfeldNeutralCurve_lapack.cpp.

Referenced by CppNoddy::Example::Neutral_residual::residual_fn().

© 2012

R.E. Hewitt