#ifndef CFD_STUFF
#define CFD_STUFF
#include "settings"
#include "array.h"

// Thomas-Algorithm (Tri-Diagonal Matrix-Algorithm)
// al,am,au - lower,middle,upper diagonal
//        u - unknowns
//        b - right hand side

void TDMA(const Array<real> &al,const Array<real> &am,
          const Array<real> &au,const Array<real> &u,
          const Array<real> &b);


// Successive Over-Relaxation 2D (Point Gauss-Seidel)
// using compass notation (e.g. sub "w" = "west" means: "x-dx")
// relax - relaxation factor, normally 0 < relax < 2
// resi  - residuals

void SOR2D(const Matrix<real> &aw, const Matrix<real> &ae,
           const Matrix<real> &as, const Matrix<real> &an,
           const Matrix<real> &ap,       Matrix<real> &u, 
           const Matrix<real> &q,        Matrix<real> &resi,
           real relax);

// L1-Norm of an Array
real L1Norm(const Array<real> &);

// RMS-value of all Array-elements
real RMS(const Array<real> &);


// Transfinite Interpolation,
// using Langrangian Polynomials
// The argument is a Matrix that carries the 
// boundary values in its first and last column and row

void TFInter(Matrix<real> &x);


// O-Grid Generator,
// solving Poisson's Equation with SOR

void OGrid_SOR(Matrix<real> &x, Matrix<real> &y,
               real eps, real relax,
               Matrix<real> &xi, Matrix<real> &eta);

#include "cfd.cc"
#endif
