Overture  Version 25
Interpolate.h
Go to the documentation of this file.
1 #ifndef Interpolate_h
2 #define Interpolate_h
3 
4 #include <Overture.h>
5 #include <NameList.h>
6 //#include <AMR++.h>
7 
9 
10 //extern InterpolateParameters defaultInterpolateParameters;
11 
13 {
14  public:
15 
16  bool debug;
17  bool timing;
18 
20  {
22  fullWeighting100, // full weighting along the x-axis
23  fullWeighting010, // full weighting along the y-axis
24  fullWeighting001, // full weighting along the z-axis
25  fullWeighting110, // full weighting in the x-y plane
26  fullWeighting101, // full weighting in the x-z plane
27  fullWeighting011, // full weighting in the y-z plane
28  fullWeighting111 // full weighting in 3D
29  };
30 
32  {
34  };
35 
36 
38  {
42  };
43 
44 
45 
46  Interpolate();
47 
48  Interpolate (const InterpolateParameters& interpParams_,
49  const bool timing=LogicalFalse);
50 
51  ~Interpolate();
52 
53  int initialize (const InterpolateParameters& interpParams_,
54  const bool timing=LogicalFalse);
55 
56 
57  int interpolateCoarseToFine (realArray& fineGridArray,
58  const Index Iv[3],
59  const realArray& coarseGridArray,
60  const IntegerArray& amrRefinementRatio_=Overture::nullIntArray());
61 
62 
63  int interpolateFineToCoarse (realArray& coarseGridArray,
64  const Index Iv[3],
65  const realArray& fineGridArray,
66  const IntegerArray& amrRefinementRatio_=Overture::nullIntArray());
67 
68 
69  // ******** here are the new versions using optimised functions ******************
70  // interpolate fine from coarse
71  int interpolateFineFromCoarse(realArray& fineGridArray,
72  const Index Iv[3],
73  const realArray& coarseGridArray,
74  const IntegerArray& amrRefinementRatio_=Overture::nullIntArray(),
75  const int update=0,
76  const int transferWidth=useDefaultTransferWidth );
77 
78  // interpolate fine from coarse where mask > 0
79  int interpolateFineFromCoarse(realArray& fineGridArray,
80  const intSerialArray& mask,
81  const Index Iv[3],
82  const realArray& coarseGridArray,
83  const IntegerArray& amrRefinementRatio_=Overture::nullIntArray(),
84  const int update=0,
85  const int transferWidth=useDefaultTransferWidth,
86  const MaskOptionEnum maskOption=maskGreaterThanZero );
87 
88  // interpolate coarse from fine
89  int interpolateCoarseFromFine(realArray& coarseGridArray,
90  const Index Iv[3],
91  const realArray& fineGridArray,
92  const IntegerArray& amrRefinementRatio_=Overture::nullIntArray(),
93  const InterpolateOptionEnum interpOption=injection,
94  const int update=0,
95  const int transferWidth=useDefaultTransferWidth );
96 
97  // interpolate coarse from fine where mask > 0
98  int interpolateCoarseFromFine(realArray& coarseGridArray,
99  const intSerialArray& mask,
100  const Index Iv[3],
101  const realArray& fineGridArray,
102  const IntegerArray& amrRefinementRatio_=Overture::nullIntArray(),
103  const InterpolateOptionEnum interpOption=injection,
104  const int update=0,
105  const int transferWidth=useDefaultTransferWidth,
106  const MaskOptionEnum maskOption=maskGreaterThanZero );
107 
108  protected:
109 
110 
111  RealArray coeff; //interpolation coefficients
116 
120 
121  int initializeCoefficients (const int maxRefinementRatio_,
122  const int interpolateOrder_,
123  const int numberOfDimensions_,
124  const int *interpolateOffset_);
125 
126  int computeIndexes (const realArray& uc,
127  int* lm, Index* Jf, Index* Jc, const Index* If,
128  const int* lmr, const int R, const int* A,
129  const int* r, const int* stride, const int* extra, const int* offset,
131 
132  int displayEverything (const int* r, const int* extra, const int* offset, const int* lm, const int* lmr,
133  const Index* Iv, const Index* If, const Index* Jf, const Index* Jc);
134 
135 };
136 
137 
138 #endif