CppNoddy  0.90
A COMPLETE LIST OF ALL EXAMPLES

## Files

file  Arc_circle.cpp
A simple arc-length continuation solving the equation

where is a parameter.

file  Arc_circle_vector.cpp
A simple arc-length continuation solving the vector equation

where is a parameter.

file  Arc_Shoot_FalknerSkan.cpp
Arc-length continue the Falkner-Skan equation

for varying values of the Hartree parameter – around the well known limit point.

file  Arc_Trans_Fold.cpp
Solve the nonlinear scalar residual problem

by arc-length continuation from the starting solution .

file  BVP_Berman.cpp
Solving the Berman suction-channel solution in the form

subject to and by applying the ODE_BVP class.

file  BVP_Blasius.cpp
Solving the Blasius equation

with and in the domain by applying the ODE_BVP class.

file  BVP_Harmonic.cpp
Solving the Harmonic equation

subject to and (OR ) by applying the ODE_BVP class.

file  BVP_JH_arc_NV.cpp
Arc length conitinuation of the equation for self-similar flow between two planar angled walls; the Jeffery-Hamel flow.

file  BVP_Karman.cpp
Solving the Karman rotating-disk equations for the flow above an infinite rotating disk:

with boundary conditions , and , .

Adaptively solve the Karman rotating-disk equations for the flow above an infinite rotating disk:

with boundary conditions , and , .

file  BVP_Karman_arc.cpp
Arc-length continuation of the Karman rotating-disk equations for the flow above an infinite rotating disk:

with boundary conditions , and , .

file  BVP_Karman_Jacobian.cpp
Solving the Karman rotating-disk equations for the flow above an infinite rotating disk by applying a user-provided Jacobian

with boundary conditions , and , .

file  BVP_nonIdentity.cpp
Solving the equation

subject to and .

file  BVP_Harmonic.cpp
Solving the Harmonic equation

subject to and (OR ) by applying the ODE_BVP class.

file  BVP_Troesch.cpp
Solving the Troesch equation

subject to and .

file  Shoot_Berman.cpp
Solving the fourth-order Berman (porous channel) similarity equation

where and is a pressure constant and is the Reynolds number based on the channel half-height and the wall suction.

file  Shoot_Blasius.cpp
Solving the Blasius equation

with and via Runge-Kutta and (scalar) Newton iteration.

file  Matrix_CompareNative.cpp
A quick check that the overhead associated with the matrix container class is less than 5% compared to a native array.

file  MatrixMult.cpp
Do some matrix multiplications and compare the native N^3 multiply with the BLAS implementation.

file  MatrixSolves.cpp
Example of the simple linear solvers implemented for dense, banded and sparse matrix objects.

file  MatrixSolves.cpp
Example of the simple linear solvers implemented for dense, banded and sparse matrix objects.

file  Vec_DenseVector.cpp
Some simple sanity checks for the NVector class with both double and complex types.

Just a quick and simple check that NVector operator overloading is functioning.

file  Vec_SparseVector.cpp
A superficial sanity check of one_norm and vector arithmetic for the sparse vector class.

file  IBVP_linear.cpp
Solving the linear equation

subject to and .

file  IBVP_nonlinear_fast.cpp
Solving the nonlinear problem

subject to , and , .

file  IBVP_nonlinear_slow.cpp
Solving the nonlinear problem

subject to , and , .

file  EVP_complex.cpp
Solves a 4x4 complex generalised eigenvalue problem

for the 4 eigenvalues , .

file  EVP_complex_sparse.cpp
Solves a 4x4 complex generalised eigenvalue problem

for the 4 eigenvalues , .

file  EVP_Harmonic.cpp
Solves the harmonic equation

as an eigenvalue problem for over the unit domain with homogeneous boundary conditions for , returning any eigenvalue(s) with absolute value less than 10.

file  EVP_Harmonic_easy.cpp
Solves the harmonic equation

as an eigenvalue problem for over the unit domain with homogeneous boundary conditions for , returning the smallest eigenvalue.

file  EVP_local_Harmonic.cpp
Solves the harmonic equation

as a LOCAL eigenvalue problem for over the unit domain with homogeneous boundary conditions for but using the nonlinear BVP solver to refine a guess at an eigenvalue.

file  EVP_OrrSommerfeld.cpp
Solves the following linear eigenvalue problem for values that satisfy :

subject to where , and .

file  EVP_OrrSommerfeld_easy.cpp
Solves the following linear eigenvalue problem for values that satisfy :

subject to where , and .

file  EVP_OrrSommerfeld_neutralcurve.cpp
Solves the following linear eigenvalue problem for values that satisfy :

subject to determining the values of and that lead to .

file  EVP_OrrSommerfeld_sparse.cpp
Solves the following linear eigenvalue problem for values that satisfy :

subject to where , and .

file  EVP_OrrSommerfeld.cpp
Solves the following linear eigenvalue problem for values that satisfy :

subject to where , and .

file  EVP_Rayleigh.cpp
Solves the Rayleigh problem for values that satisfy :

subject to ; it determines the critical wavenumber such that for .

file  EVP_real_sparse.cpp
Solves a 2x2 generalised eigenvalue problem

for the 2 eigenvalues , .

file  EVP_Shoot_Biharmonic.cpp
Solving a one-dimensional "Bi-harmonic" eigenvalue problem (EVP)

via Runge-Kutta and (vector) Newton iteration.

file  ExceptionChecks.cpp
We do some obviously dumb things to induce a handful of common failures.

file  NewtonIter.cpp
A vector Newton iteration to find a root of

by splitting it into a vector equation (real & imaginary parts).

Compute the integral

with varying schemes, then compare the result to the exact value

.

file  TrivialComplex.cpp
A pointless repeated computation test for timing the std::complex class.

file  HYP_acoustic_impedance.cpp
Solve the constant coefficient linear sound wave problem

for a right-propagating square pressure pulse in a medium with constant bulk modulus and density if and elsewhere.

file  HYP_acoustic_reflection.cpp
Solve the constant coefficient linear sound wave problem

for a right-propagating square pulse in a medium with constant bulk modulus and density and reflecting boundary conditions at both sides.

Solving the 1D nonlinear advection equation'

using a TVD Lax-Friedrichs scheme for .

Solve the shallow water equations in one dimension for an initial column of fluid

The result is compared to the same problem solved using Clawpack, evaluated at the single point x=0.5.

file  HYP_shallow_source_NV.cpp
Solve the shallow water equations in one dimension

where the momentum is fixed upstream, and the flow depth is fixed downstream and is the topography shape.

file  HYP_shallow_water_NV.cpp
Solve the shallow water equations in one dimension for an initial (small) hump of fluid

where and the boundaries are reflecting.

file  HYP_shocktube_Lax_NV.cpp
Solving the 1D Euler problem for gas dynamics

where

and .

file  HYP_shocktube_Sod.cpp
Solving the 1D Euler problem for gas dynamics

where

and .

file  HYP_2D_acoustic_NV.cpp
A linear acoustic pulse propagating towards a cylindrical region of higher (four times) bulk modulus.

file  HYP_2D_Euler_NV.cpp
Solving the Euler equations for a compressible gas with Sod-like initial conditions in a rectangular box , with no-momentum flux through the walls.

using a TVD Lax-Friedrichs scheme for .

Solving the 1D nonlinear advection equation'

using a TVD Lax-Friedrichs scheme for .

Solving the 2D nonlinear advection equation'

using a TVD Lax-Friedrichs scheme for .

Solving the 1D nonlinear advection equation'

using a TVD Lax-Friedrichs scheme for .

A radial dam-break problem for the 2D shallow water equations.

file  HYP_2D_RayTay_NV.cpp
Solving the Euler equations for a compressible gas including a buoyancy force in a rectangular box , with no-momentum flux through the walls.

file  HYP_2D_shallow_source.cpp
Two dimensional shallow water equations over topography.

file  IBVP_diffusion.cpp
Solving the heat diffusion equation

subject to and with initial condition .

file  IBVP_diffusion_nonlinear.cpp

with boundary conditions ; where .

file  IBVP_Karman.cpp
Solving the unsteady Karman rotating-disk equations for the flow above an infinite rotating disk in a rotating fluid:

with boundary conditions , and , .

Solving the nonlinear advection diffusion equation

subject to and with initial condition and a source term

for some constant parameters and .

file  IVP_Harmonic.cpp
Integrate the harmonic equation

with from to as an IVP, using an adaptive Runge-Kutta-Fehlberg routine.

file  IVP_Lorenz.cpp
Integrate the Lorenz equations

forward in time using an adaptive Runge-Kutta-Fehlberg routine.

file  1DNodeMesh.cpp
A simple check of the OneD_Node_Mesh container that stores nodal data over a given mesh.

file  1DNodeMesh_Airy.cpp
Solves the Airy equation

on the negative real axis over the range [-10,0] then pushes the data into a OneD_GenMesh object and integrates the result.

file  2DNodeMesh.cpp
A simple check of the TwoD_Node_Mesh container that stores nodal data over a given mesh.

file  Poisson_C.cpp
Solving a Cartesian Poisson problem:

with

where .

file  Poisson_m.cpp
Solving a Poisson problem in the meridional plane of a cylinder:

with

where .

file  Poisson_Stokes.cpp
Solving a Poisson-like problem in the meridional plane of a cylinder for the Stokes streamfunction

with

where and

The global problem is solved (in one step) and result is compared to the exact solution

.

file  MatrixSolves.cpp
Example of the simple linear solvers implemented for dense, banded and sparse matrix objects.

## Detailed Description

• The example programs here include:
• - Two-dimensional parabolic problems ( eg., unsteady boundary layer equations).
• - Initial-boundary-value problems ( eg., the heat equation and the unsteady Karman rotating-disk equations).
• - One-dimensional hyperbolic problems ( eg., the acoustic, shallow water, compressible Euler equations ).
• - Two-dimensional hyperbolic problems ( eg., the acoustic, shallow water, compressible Euler equations ).
• - Boundary-value ODE problems ( eg., the Blasius, Berman, Biharmonic equations).
• - Boundary-value problems involving limit/saddle-node points (eg., Karman disk, Falkner-Skan equations, solved via
• arc-length continuation methods).
• - Initial-value problems ( eg., the Lorenz equations ).
• - Poisson problems in Cartesian and cylindrical geometries.
• - One-dimensional eigenvalue problems ( eg., the harmonic equation, the Orr-Sommerfeld equation ).