Overture  Version 25
InterpolateRefinements.h
Go to the documentation of this file.
1 #ifndef INTERPOLATE_REFINEMENTS_H
2 #define INTERPOLATE_REFINEMENTS_H
3 
4 #include "Overture.h"
5 #include "Interpolate.h"
6 
7 class ListOfParentChildSiblingInfo; // forward declaration.
8 
10 {
11  public:
12 
13  enum
14  {
16  };
17 
20 
21  // interpolate all values on a new adaptive grid from values on an old (different) adaptive grid.
24  int baseLevel = 1 );
25 
26  // interpolate ghost boundaries of refinements from grids at same level or below:
28  int levelToInterpolate = allLevels,
29  const Range & C = nullRange );
30 
33  int levelToInterpolate = allLevels,
34  const Range & C0 = nullRange );
35 
36  // interpolate coarse grid points covered by finer grids:
38  int levelToInterpolate= allLevels,
39  const Range & C = nullRange );
40 
43  int levelToInterpolate= allLevels,
44  const Range & C = nullRange );
45 
46  int get( const GenericDataBase & dir, const aString & name);
47 
48  int put( GenericDataBase & dir, const aString & name) const;
49 
50  // utility routines for Boxes:
51  static int getIndex( const BOX & box, Index Iv[3] );
52  static int getIndex( const BOX & box, int side, int axis, Index Iv[3]);
53  static Box intersects( const Box & box1, const Box & box2 );
54  static Box buildBox(Index Iv[3] );
55  static Box buildBaseBox( MappedGrid & mg );
56  // Build a box for the portion of the array u(Iv) that lives on a given processor
57  static Box buildBox(realArray & u, Index Iv[3] , int processor);
58 
59  int setOrderOfInterpolation( int order );
61 
62 
63  void printStatistics( FILE *file=NULL ) const;
64 
65  int debug;
66  static FILE *debugFile; // this allows other classes to write to the debugFile
67 
68  protected:
70 
75 
80 
81  bool boxWasAdjustedInPeriodicDirection(BOX & box, GridCollection & gc, int baseGrid, int level,
82  int & periodicDirection, int & periodShift );
83 
84  void openDebugFile();
85  int myid;
86 
87 };
88 
89 #endif