Department of Scientific Computing   
Institute for Numerical Simulation   
University of Bonn   
Documentation
Download
Programming References
Bug Reports / Suggestions
FAQ
Authors
Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Wavelet.hpp

00001 // The version number for the automatically generated documentation is set in the Doxyfile
00012 #ifndef WAVELET_H
00013 # define WAVELET_H
00014 
00015 #include <iostream>
00016 #include <iomanip>
00017 using namespace std;
00018 
00019 #include <stdlib.h>
00020 #include <stdio.h>
00021 #include <assert.h>
00022 #include <math.h>
00023 #include <new.h>
00024 
00025 void out_of_memory() ;
00026 
00027 # include "OperatorAndTransformMatrix.hpp"
00028 
00029 // Operation IDs for (1D)applyOp,(1D)Quadrature, (nD) ApplyOp , (nD)TensorMatrixOperation and so on
00030 enum OperationIDs { 
00031        NOOPERATION, 
00032        FIRSTDERIVATIVE,
00033        STIFFNESS,
00034        //
00035        TRANSFORM,
00036        INVERSETRANSFORM,
00037        INTERPOLET2LIFTING,
00038        LIFTING2INTERPOLET,
00039        //
00040        PROJECTION,
00041        PROJECTIONINVERSETRANSFORM,
00042        TRANSFORMPROJECTION,
00043        //
00044        POLYQUAD,  
00045        INVERSEPOLYQUAD,
00046        NODALQUAD,
00047        INVERSENODALQUAD,
00048        //
00049        ONEPOINTQUAD,
00050        INVERSEONEPOINTQUAD,
00051        SHORTQUAD,
00052        INVERSESHORTQUAD,
00053        //
00054        FD11,
00055        FD12,
00056        FD14,
00057        FD16,
00058        FD22,
00059        FD24,
00060        FD12II,
00061        FD14II,
00062        FD22II,
00063        FD24II,
00064        FD2,
00065        FD3,
00066        FD40,
00067        FD5,
00068        FD60,
00069        FD80,
00070        FD401,
00071        FD601,
00072        FD801,
00073        //
00074        DIV,
00075        GRAD,
00076        DIVGRAD,
00077        DIVFD4,
00078        DIVFD6,
00079        GRADFD4,
00080        GRADFD6,
00081        DIVGRADFD4,
00082        DIVGRADFD6,
00083        DIVGRADFD4NOSTAB,
00084        DIVGRADNOSTAB,
00085        //
00086        RESTRICTPRESSURE,
00087        ONE_POINT_MULTIPLY,
00088        BOUND_MULTIPLY,
00089        SORTHB,
00090        //
00091        WENO3,
00092        WENO5,
00093        SMOOTH0,
00094        SMOOTH1,
00095        SMOOTH2,
00096        SMOOTH3,
00097        //
00098        FFT,
00099        IFFT,
00100        //
00101        PERIODIC
00102 } ;
00103 
00104 
00105 void GetGeneralBoundaryConditions(int BC[2] , int *BG) ;
00106 void BoundaryCorrection(int *BC, double *d, int l) ;
00107 
00108 // data structure to store the general non-uniform finite difference stencils
00109 // used in ApplyFD2
00110 struct FD2stencil {
00111   int    n;
00112   int    width[30] ;
00113   int    j    [30][10] ;
00114   double w    [30][10] ;
00115   void   Set   (int which, int wdth, int *js, double *ws) ;
00116   void   Mirror(int which, int from, double flip) ;
00117 } ;
00118 
00123 struct Wavelets {
00125   Wavelets()  {InterpoletFlag=LiftingFlag=false ;}
00130        Wavelets(const char *type,const int N) ;
00131       ~Wavelets() ;
00133   int  GetCoefficients (const char *type,const int N) ;
00134   int  GetCoefficients (const char *typ ,const char *leftright,const int N) ;
00135   int  GetICoefficients(const char *typ ,const char *leftright,const int N) ;
00136   
00139   //  \param allflag&1 != 0 print FD operator matrices <br>
00140   void Print(int allflag=0) ;
00141 
00143   double WaveletIntegral        (int l, int t, int *BC) ;
00145   double ScalingFunctionIntegral(int l, int s, int *BC) ;
00146 
00148   int  FDOp  (int op) ;
00149   //  return ID of given wavelet type
00150   int  TypeID(char *typ) ;
00151 
00153   int  N        ;      // Number of vanishing moments
00154   int  L,R      ;      // Sizes of Filter h:  h(-L),...,h(R)
00155   int  K0,K1    ;      // Number of BoundScalFunc without BC
00156   int  KW0,KW1  ;      // Number of Wavelets at 0.0 and 1.0 edge
00157   int  NBC      ;      // Number of implemented boundary conditions (less or equal than 3)
00158 
00159   char type[20] ;      // Type of Wavelet
00161   bool InterpoletFlag ;
00163   bool LiftingFlag ;
00164 
00165   int  MX       ;      // minimum size of vector to decompose
00166   int  MX1      ;      // MX for wavelets on the interval
00167   
00169   int  Level0   ;
00170 
00172   TransformMatrix HJ  ;
00174   TransformMatrix GJ  ;
00176   TransformMatrix HtJ ;
00178   TransformMatrix GtJ ;
00179 
00180   TransformMatrix W,IW,Phi           ; // for polynomial exact  quadraturues / evaluation of nodal values
00181 
00182   LiftingMatrix   Q ;
00183 
00184   
00185   Matrix2D OP0[2],OP1[2]             ; // for orthogonal projection between BC==-1 and BC==0
00186   Matrix2D ATau0[2],ATau1[2]         ; // for non-linearity
00187 
00188   // the following matrices are stored/handled in the old fashioned <PHI , tilde(PHI)> format
00189   // e.g. HJ is a 2^(l-1) x 2^l matrix 
00190   OperatorMatrix  Operators[2][2][2] ; // [op=0,1][IsWT=0,1][IsWF=0,1] 
00191   OperatorMatrix  MassMatrix,StiffnessMatrix ;
00192 
00194   OperatorMatrix  FDOperators[20]     ;
00195 
00196   // non-uniform f.d. stencils for ApplyFD2
00197   FD2stencil  FD2first,FD2second ;
00198 
00199   //***********************************
00200 
00201   doubleBuffer *Buffer ;
00202 
00203 private:
00204   void ReadInnerEntries(FILE *file,double *a,int *U,int *O) ; 
00205   void ReadFDMatrices  () ;
00206 
00207   Matrix2D IntegralsL ; // storage for integrals of boundary scaling functions (left/right side)
00208   Matrix2D IntegralsR ; // for the 3 different Boundary conditions: -1,0,1 
00209  
00210 };
00211 
00212 #endif

Generated at Mon Aug 19 10:02:32 2002 for AWFD by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001