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  

AdaptiveGrid Struct Template Reference

AdaptiveGrid<DIM> handles the information which multiscale coefficient with index (l,t) is associated to a particular entry of the vectors of AdaptiveData<DIM>.
Furthermore, some kind of pointers to neighbours with respect to all DIM coordinate directions, auxiliary data vectors used by e.g. the solvers and other rather basic stuff about the adaptive grid are stored. In this way, all these logical connectivities are kept only once. They are shared by all AdaptiveData associated to the same grid.

The internal structure of AdaptiveGrid<DIM> is tailored to allow for a very fast evaluation of tensorproducts of univariate oprations like a wavelet transform w.r.t the x-coordinate direction or the evaluation of a first derivative w.r.t. the y-coordinate direction. These functions require fast access to 1D 'lines', i.e. data associated to indices with common subindices (l1,..,li-1,li+1,...lDIM) and (t1,..,ti-1,ti+1,..,tDIM). The one-dimenional lines are essentially handled using the data structure AdaptiveLevels. More...

#include <AdaptiveGrid.hpp>

List of all members.

Public Types

typedef map<AdaptiveLevelsIndex* ,
AdaptiveLevels* , AdaptiveLevelsIndexCmp
ProjectionGrid
 data structure for access to AdaptiveLevels along one coordinate direction.

enum  { NUM_TMP = 13 }

Public Methods

 AdaptiveGrid ()
 default constructor.

 AdaptiveGrid (Wavelets *W, bool Init_tmp=true)
 see Init(.,.).

 ~AdaptiveGrid ()
 default destructor.

void Init (Wavelets *W, bool Init_tmp=true)
 
Parameters:
WC   copy pointer to filter coefficients
Init_tmp   == false: do not initialize/allocate AdaptiveData<DIM> tmp[..] required by e.g. the linear solvers.


void SetPeriodicConditions (int BC[DIM][2])
 Internally mark the coordinate directions with periodic BCs. Automatically called whenever boundary conditions for attached AdaptiveDatas are set.

void Set (Function *F, double c)
 Generates a level adaptive grid, all indices with are kept in the adaptive index set. All AdaptiveData attached to (*this) are either refined or resized.

void SetSparse (int sl)
 Specialization of Set(.) for simple sparse grids: ~and~ .

void SetFull (int *L)
 As above for full grids: .

void SetFull (int L)
 As above for full grids .

void SetAsSlice (AdaptiveGrid< DIM+1 > *G, int dir, int l, int t)
 Generate an adaptive grid as slice of a (DIM+1)-dimensional adaptive grid. The slice consists of all indices of *G whose <dir>th components of the level and spatial index are l and t, respectively. Refinement of attached AdaptiveData is NOT supported, just resize().

void Refine (AdaptiveData< DIM > *TestData, AdaptivityCriterion *R, AdaptiveData< DIM > *ActiveEntries=NULL)
 Refinement of (*this). For all coefficients of *TestData<DIM> it is checked whether they fulfill the refinement-criterion *R (the magnitude of the coefficients as well as the level determine). If so, the corresponding index and the neighbours in space and level are included in the refined index set. (Optional) the corresponding coefficient is set to one in *ActiveEntries (not the neigbours!). Thus, we can discriminate between 'truely' active components and just neighbours. The extent of the spatial neighbourhood is defined by Refine::REFINEBOUNDBOX. Currently, it is 1 which means all same-level indices of with are considered neighbours. After the generation of the new index set, all attached instances of AdaptiveData<DIM> are either refined or resized.

If the underlying basis functions of TestData are Lifting-Interpolets then the refined adaptive grid does not only fulfill the Interpolet cone-condition, but also the Lifting cone-condition. This is needed by subsequent INTERPOLET2LIFTING / LIFTING2INTERPOLET operations, but, nevertheless, makes the grids a little bit larger.
Note, one can directly set the TestData->Ext.islifting[] flags without need to perform a INTERPOLET2LIFTING operations. Carefull use of this quick and dirty trick saves the basis transforms.


size_t Size ()
 Return size of adaptive basis.

void PrintCounterArray ()
 Dump the numbers of active basis functions for all levels.

void DataMemory (int *reserved, int *used)
 Compute memory usage.

void LargestActiveLevel (int *L)
 Return largest active level in each direction.

void PrintLargestActiveLevel ()
 Print largest active level in each direction.

long* FindOrInsert (ProjectionGrid *PG, int dirTo, int *l, int *t)
 Find (and insert if necessary) index (l,t) and return pointer to the vector index for AdaptiveDataArray. CounterArray will neither be used nor updated.

long Insert (ProjectionGrid *PG, int dirTo, int *l, int *t)
 Insert (if necessary) index (l,t). Use and update the so called CounterArray for the new vector index. Returns the new vector index. This function is used to successively build up a ProjectionGrid.

void Insert (ProjectionGrid *PG, int dirTo, int *l, int *t, long vectorindex)
 Insert an index (l,t). vectorindex is the known index of the vector component for the AdaptiveDataArrays. This function is used for the generation of a ProjectionGrid from an existing one.

long Find (ProjectionGrid *PG, int dirTo, int *l, int *t)
 Find index (l,t). Returns the vector index for AdaptiveDataArray, and -1 if (l,t) is not contained in the index set.

size_t GeneratePG (ProjectionGrid *PGFrom, int dirFrom, ProjectionGrid *PGTo,int dirTo)
 Generate from *PGFrom the data structure for access to all AdaptiveLevels along coordinate direction dirTo.

void SMPLoadBalance ()
 load balancing for thread parallelization.

void ReadSparse (const char *name)
 read a sparse format file and initialize the adaptive grid (i.e. the index set for the active wavelets) according to the indices from the file. No numerical data is read.


Public Attributes

AdaptiveGrid<DIM-1>* FaceGrid [DIM][2]
 (DIM-1)-dimensional grids for the 2*DIM faces. Required, e.g., in AdaptiveData<DIM>::SetBoundaryValueFunction.

AdaptiveData<DIM>* tmp [NUM_TMP]
 valid if Init_tmp == true, aux. Data for BICGSolver (0..8) and other subroutines (9,10,11), NUM_TMP=13.

template<int DIM> struct AdaptiveGrid


The documentation for this struct was generated from the following files:
Generated at Mon Aug 19 10:02:32 2002 for AWFD by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001