CppNoddy  0.92
Loading...
Searching...
No Matches
Types.h
Go to the documentation of this file.
1/// \file Types.h
2/// Some standard typedefs. These are kept for legacy reasons. I've tried
3/// to remove them from the code, which means things are a little more
4/// verbose, but perhaps also a little less obfuscated.
5
6/*! \mainpage Overview
7 *
8 * \section intro0 Introduction
9 * \subsection intro1 What is it?
10 *
11 *
12 * A simple (aka Noddy) collection of object orientated numerical routines written in C++,
13 * aimed at undergraduate projects and starting graduate students.
14 * In the current version, the test/example cases solve (amongst others):
15 *
16 *
17 * - Two-dimensional parabolic problems
18 * ( eg., the unsteady boundary-layer equations ).
19 * - Boundary-value ODE problems
20 * ( eg., the Karman rotating-disk, Blasius boundary-layer and other similarity solutions ).
21 * - Arc-length continuation of problems involving limit points
22 * ( eg., the Karman rotating disk equations, Falkner-Skan equation,
23 * the plane Poiseuille flow linear neutral curve. ).
24 * - One-dimensional eigenvalue problems ( eg., the (bi-)harmonic equation, Orr-Sommerfeld equation ) solved
25 * both directly and via local methods.
26 * - One-dimensional hyperbolic problems
27 * ( eg., Sod's shocktube problem,
28 * linear acoustic waves with reflection in non-uniform medium,
29 * shallow water eqiations ).
30 * - Two-dimensional hyperbolic problems
31 * ( eg., compressible Euler problems,
32 * linear acoustic waves,
33 * shallow water eqiations ).
34 * - Initial-boundary-value problems
35 * ( eg., the heat diffusion equation in 1D, and the unsteady Karman rotating-disk equations ).
36 * - Initial-value problems ( eg., the Lorenz equations ).
37 * - Poisson problems in Cartesian and cylindrical geometries.
38 *
39 *
40 *
41 * A breakdown of examples into groups is found under the 'Modules' link above.
42 * Alternatively, a complete list of examples can be found at this link \link Tests \endlink
43 *
44 * The library provides:
45
46 * - Both \link #CppNoddy::DenseVector dense vector \endlink and \link #CppNoddy::SparseVector sparse vector \endlink classes (including the usual vector operations).
47 * - \link #CppNoddy::DenseMatrix Dense \endlink, \link #CppNoddy::BandedMatrix banded \endlink and \link #CppNoddy::SparseMatrix sparse \endlink matrix classes.
48 * - A class for \link #CppNoddy::ODE_IVP ODE IVPs \endlink with 4th-order Runge-Kutta(-Fehlberg) method(s).
49 * - A class for \link #CppNoddy::ODE_BVP ODE BVPs \endlink with second-order finite-difference methods and adaptive refinement.
50 * - A class for \link #CppNoddy::ODE_EVP ODE EVPs \endlink with second-order finite-difference methods.
51 * - A class for \link #CppNoddy::PDE_IBVP IBVPs \endlink with second-order methods in both `space'
52 and `time'.
53 * - A class for \link #CppNoddy::PDE_double_IBVP Two dimensional parabolic problems \endlink with a second-order box scheme.
54 * - Classes for both \link #CppNoddy::OneD_TVDLF_Mesh 1-D \endlink and \link #CppNoddy::TwoD_TVDLF_Mesh 2-D \endlink hyperbolic problems via central scheme algorithms.
55 * - 2-D Poisson objects (\link #CppNoddy::Poisson_Cartesian Cartesian \endlink and
56 * \link #CppNoddy::Poisson_meridional axisymmetric \endlink cylindrical polars).
57 * - \link #CppNoddy::Newton vector \endlink Newton iteration classes.
58 * - Arc-length continuation solvers exist for Residual objects and boundary value problems.
59 * - An ability to link to selected BLAS, LAPACK and PETSc routines via a simplified API
60 * (these currently include the real/complex generalised eigenproblem solvers,
61 * dense/banded/sparse LU solvers.).
62 *
63 * \subsection intro2 What is it for?
64 * It exists for two reasons:
65 * - It's an introduction/framework for final-year undergraduate project students or graduate students.
66 * - Just for fun.
67 *
68 * \section get0 Getting and running it
69 *
70 * You need a machine with a recent C++ compiler and 'git' to clone the latest version.
71 * The build system uses 'meson'. The source is hosted on Github
72 * and can be obtained using 'git' via
73 *
74 * git clone git://github.com/hewitt/CppNoddy.git
75 *
76 * A minimal install can be achieved via
77 *
78 * meson --buildtype=debugoptimized build
79 *
80 * cd build
81 *
82 * ninja
83 *
84 * The self-tests can be executed via
85 *
86 * ninja tests
87 *
88 *
89 * Optionally you can link to PETSc (for sparse matrix problems) and SLEPc (for sparse matrix eigenvalue problems) via
90 *
91 * meson configure -Dpetscz=true -Dslepc=true
92 *
93 * for complex arithmetic, or
94 *
95 * meson configure -Dpetscd=true -Dslepc=true
96 *
97 * for real arithmetic.
98 * If PETSc/SLEPc are not installed system-wide, you will need to set PKG_CONFIG_PATH to point to PETSc.pc and SLEPc.pc via
99 *
100 * export PKG_CONFIG_PATH=$PETSC_DIR/$PETSC_ARCH/lib/pkgconfig:$SLEPC/$PETSC_ARCH/lib/pkgconfig
101 *
102 * assuming a bash shell. The environment variables $PETSC_DIR/$SLEPC_DIR point to the base locations of the respective source trees, whilst $PETSC_ARCH is the name of the build directory (assumed to be the same in both cases). Suggested configure options for PETSc are
103 *
104 * ./configure --download-superlu_dist --download-mpich --download-metis --download-parmetis --download-cmake --download-scalapack --download-mumps --with-scalar-type=complex
105 *
106 * for complex arithmetic or use --with-scalar-type=real for real arithmetic.
107 *
108 * See the \link Tests \endlink for a starting point.
109 *
110 * \section best0 Is it fast/accurate?
111 *
112 * The matrix classes have native solvers that are naive unoptimised Gaussian elimination algorithms. These routines will only be practical (if at all!) for rather `small' matrix/band sizes and do not scale well. If the problem is of even moderate size, then you should link to your local LAPACK/PETSc routines. LAPACK/PETSc/SLEPc libraries are not shipped with CppNoddy, you have to install them separately yourself if they are not available by default.
113 *
114 * The code is not especially optimised, in fact in many places the code is deliberately un-optimised for greater transparency; it is not intended for 'heavy duty' problems. The only sanity checks applied are those listed in the test/example codes \link Tests \endlink.
115 *
116 * \section flames0 It made my machine burst into flames
117 *
118 * I never said it wouldn't ;-) The code comes with no guarantees.
119 *
120 * \section add0 I think it needs a CppNoddy::foo<bar> class
121 *
122 * Feel free to add something. If you're an undergraduate looking for a final-year project or an MSc. student and have an idea of something to include (or wish to redesign something that I did in a stupid way), then let me know.
123 *
124 *
125 * \htmlonly
126<p style="text-align: center;"
127<!-- Creative Commons License -->
128<a href="http://creativecommons.org/licenses/GPL/2.0/">
129<img alt="CC-GNU GPL" border="0" src="http://creativecommons.org/images
130/public/cc-GPL-a.png" /></a><br />
131This software is licenced under the <a href="http://creativecommons.org/licenses/GPL/2.0/">CC-GNU GPL</a>.
132<!-- /Creative Commons License -->
133<!--
134<rdf:RDF xmlns="http://web.resource.org/cc/"
135 xmlns:dc="http://purl.org/dc/elements/1.1/"
136 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
137<Work rdf:about="">
138 <license rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
139 <dc:type rdf:resource="http://purl.org/dc/dcmitype/Software" />
140</Work>
141<License rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
142 <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
143 <permits rdf:resource="http://web.resource.org/cc/Distribution" />
144 <requires rdf:resource="http://web.resource.org/cc/Notice" />
145 <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
146 <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
147 <requires rdf:resource="http://web.resource.org/cc/SourceCode" />
148</License>
149</rdf:RDF>
150-->
151<br/>
152&#169; Content created by R.E. Hewitt, 2007.
153</p>
154
155 * \endhtmlonly
156 */
157
158#ifndef TYPES_H
159#define TYPES_H
160
161#include <complex>
162#include <cmath>
163#include <sys/stat.h>
164
165#include <DenseVector.h>
166#include <DenseMatrix.h>
167#include <BandedMatrix.h>
168
169
170/// A collection of OO numerical routines aimed at simple
171/// (typical) applied problems in continuum mechanics.
172namespace CppNoddy {
173
174 /// A complex double precision number using std::complex
175 typedef std::complex<double> D_complex;
176
177}
178
179#endif // NTYPES_H
A matrix class that constructs a BANDED matrix.
A matrix class that constructs a DENSE matrix as an STL Vector of DenseVectors.
Specification for a templated DenseVector class – a dense, dynamic, vector object.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...
std::complex< double > D_complex
A complex double precision number using std::complex.
Definition: Types.h:98

© 2012

R.E. Hewitt