Overture  Version 25
ExposedPoints.h
Go to the documentation of this file.
1 #ifndef EXPOSED_POINTS_H
2 #define EXPOSED_POINTS_H
3 
4 #include "Overture.h"
5 
6 // This class is used to interpolate "exposed" points for moving grid computations.
7 
8 // forward declarations:
9 class OGFunction;
11 
12 
14 {
15 
16 public:
17 
18  // There are different types of exposed points
20  {
23  };
24 
26  {
27  canInterpolateQuality1=0, // best quality, interpolates to correct order
28  canInterpolateQuality2, // 2nd best best quality, interpolates to correct order minus 1
29  canInterpolateQuality3, // 3rd best quality, interpolates to correct order minus 2
30  canInterpolateWithExtrapolation, // bad quality -- should replace by a better quality result
31  canInterpolateQualityBad, // bad quality -- should replace by a better quality result
32  canInterpolateQualityVeryBad, // worst quality-- should replace by a better quality result
33  canNotInterpolate, // unable to interpolate at all
35  };
36 
39 
40 
41 // set whether or not to interpolate exposed interpolation points (kkc 110323)
42 void setFillExposedInterpolationPoints(bool trueOrFalse);
43 
44 // return the total number of exposed points (if grid=-1), otherwise return the number of exposed points on a grid
45 int getNumberOfExposedPoints(const int grid=-1 ) const;
46 
47 // build the lists of exposed points; determine how to interpolate
48 int initialize(CompositeGrid& cg1, CompositeGrid & cg2,
49  int stencilWidth = -1 );
50 
51 // interpolate values at the exposed points
53  OGFunction *TZFlow =NULL,
54  real t =0. );
55 
56 // indicate whether interpolation neighbours are already assigned.
57 void setAssumeInterpolationNeighboursAreAssigned( const bool trueOrFalse=true );
58 
59 // choose the type of exposed points that are wanted (do this before calling initialize)
60 void setExposedPointType( const ExposedPointTypeEnum type );
61 
62 // Set the width the interpolation stencil.
63 int setInterpolationWidth( int width );
64 
65 // Set the number of valid ghost points that can be used when interpolating from a grid function
66 int setNumberOfValidGhostPoints( int numValidGhost );
67 
68 // Choose the interpolation option
69 int setInterpolationOption( int option );
70 
71 static int debug;
72 static int info;
73 
74 protected:
75 
77 
78 int isInitialized; // is set to 1 after initialization.
79 int ipogIsInitialized; // set to 1 when the ipog object is initialized
80 
82 int assumeInterpolationNeighboursAreAssigned; // default for stencilWidth=5
85 
86 int useIPOG; // if true use ipog in serial too
87 InterpolatePointsOnAGrid *ipog; // new way for parallel
89 
93 
94 int *numDonor;
95 
97 
103 
105 
107 
108 static FILE *debugFile;
109 
110 static int
112  const int grid2,
113  const int numToCheck, IntegerArray & ia, IntegerArray & ibg, RealArray & r2,
114  IntegerArray & interpolationQuality,
115  IntegerArray & interpoleeGrid,
116  IntegerArray & interpoleeLocation,
117  IntegerArray & interpolationPoint,
118  IntegerArray & variableInterpolationWidth,
119  RealArray & interpolationCoordinates );
120 
121 static int
122 checkForBetterQualityInterpolation( CompositeGrid & cg1, const int gridI, const int numToCheck,
123  IntegerArray & ia, IntegerArray & ic,
124  const RealArray & x,
125  IntegerArray & interpolationQuality,
126  IntegerArray & interpoleeGrid,
127  IntegerArray & interpoleeLocation,
128  IntegerArray & interpolationPoint,
129  IntegerArray & variableInterpolationWidth,
130  RealArray & interpolationCoordinates );
131 
132 static int
134  RealArray & uInterpolated_,
135  int *numDonor, const IntegerArray & ia_, const IntegerArray *ib,
136  const IntegerArray & interpoleeGrid_,
137  const IntegerArray & interpoleeLocation_,
138  const IntegerArray & interpolationPoint_,
139  const IntegerArray & variableInterpolationWidth_,
140  const RealArray & interpolationCoordinates_,
141  const Range & R0 =nullRange,
142  const Range & R1 =nullRange,
143  const Range & R2 =nullRange,
144  const Range & R3 =nullRange,
145  const Range & R4 =nullRange );
146 
147 };
148 
149 
150 
151 #endif