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  

AD.cc

00001 // Example for initialization of AdaptiveData
00002 // You must run the WT example first!!!!
00003 
00004 # include "UniformData.hpp"
00005 # include "AdaptiveData.hpp"
00006 # include "Function.hpp"
00007 
00008 int debugRefine ;
00009 
00010 int main() {
00011  Wavelets WC("Interpolet",4) ;
00012  
00013  int L[2]={7,7}, a[2]={0},e[2]={1<<L[0],1<<L[1]} ;
00014  UniformData<2> A(a,e,&WC) ; 
00015  A.ReadUDF("../../Data/Test/C") ;
00016 
00017  // adaptive data structures
00018  AdaptiveGrid<2> G(&WC,false) ; // the grid
00019  AdaptiveData<2> D(&G) ;        // the data (must be linked to a grid) 
00020  D.SetRefine() ;                // D shall be refined whenever the grid is refined
00021 
00022  D.FromUniform (&A, L) ;           // load wavelet coefficients in adaptive data structure, this initializes G as a uniform grid!
00023  
00024  // dump some information on the grid
00025  std::cout << "The AdaptiveGrid has " << G.Size() << " degrees of freedom\n" ;
00026  std::cout << "The various levels contain the following numbers of degrees of freedom\n" ;
00027  G.PrintCounterArray() ;
00028 
00029  // 
00030  // adaptive Refinement: 
00031  // the refined grid shall consist of all indices l,t for which the absolute value of the 
00032  // respective wavelet coefficient of D is larger or equal than 1e-4 (plus some neighbours)
00033  // 
00034  AdaptivityCriterion R(AdaptivityCriterion::L2_THRESHOLD,1e-4) ;
00035  G.Refine(&D,&R) ;
00036 
00037  // dump some information on the grid
00038  std::cout << "The AdaptiveGrid has " << G.Size() << " degrees of freedom\n" ;
00039  std::cout << "The various levels contain the following numbers of degrees of freedom\n" ;
00040  G.PrintCounterArray() ;
00041 
00042  // write the retained wavelet coefficients in files
00043  D.WriteSparse("../../Data/Test/C1.adp") ; // sparse format
00044  D.WriteUDF("../../Data/Test/C1",&A) ;     // UDF; no inverse transform
00045  D.WriteUDF("../../Data/Test/A1",&A,&D) ;  // UDF; WITH inverse transform, 
00046                                            // i.e. nodal values of compressed functions
00047 }

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