CG  Version 25
DeformingGrid.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //
3 // DeformingGrid:
4 // ==============
5 //
6 // Handles a single deforming component grid
7 // "Kinematics"= the non-physics aspects (=just grids)
8 //
9 //
10 // UNDER REVISION currently
11 
12 #ifndef DEFORMING_GRID_H
13 #define DEFORMING_GRID_H
14 
15 #include "Overture.h"
16 #include "GenericGraphicsInterface.h"
17 
18 //..Forward definitions
19 class HyperbolicMapping;
20 class GenericGraphicsInterface;
21 //class DeformingGridGenerationInformation;
22 
24 public:
25  //..Constructor / Destructor
26  DeformingGrid(int numberOfTimeLevels,
27  GenericGraphicsInterface *pGIDebug00 =NULL,
28  int debug00 =0);
29 
31 
32  //..Services
33  //-----from old "DeformingComponentGridInformation"
34  // int storeNewTimeLevel( const real newTime, HyperbolicMapping & mapping);
35 
36  //void getNewMapping( const real time0, //OBSOLETE
37  // Mapping & surface,
38  // HyperbolicMapping * &pNewMapping );
39 
40  void getNewMapping( const real time0, // without surface.
41  HyperbolicMapping * &pNewMapping );
42 
43  void getCurrentMap( real & time0, HyperbolicMapping* &pCurrentMapping );
44 
45  void getTimeLevelMapPointer( const int offset, real & time0,
46  HyperbolicMapping* &pMap);
47 
48 
49  void getCurrentGridArray( real & time0, realArray* &pCurrentGrid );
50  void getTimeLevelGridArrayPointer( const int offset,
51  real & time0,
52  realArray* &pGrid);
53 
54 
55  void regenerateGrid( HyperbolicMapping *pHyper,
56  const int grid,
57  CompositeGrid & cg);
58 
59  //
60  //------GRID VELOCITY & ACCELERATION
61  //
62 
63  //..User interface
64  void getVelocity( const real time0,
65  const int grid,
66  CompositeGrid & cg,
67  realArray & gridVelocity);
68 
69  void getAcceleration( const real time0,
70  const int grid,
71  CompositeGrid & cg,
72  realArray & gridVelocity);
73 
74 
75 
76  //..Internal routines
77  //....Compute vel. of gridpoints in THREE conseq.(in time) mappings
78  void computeGridVelocity( real vTime,
79  real t0, realArray const & map0,
80  real t1, realArray const & map1,
81  real t2, realArray const & map2,
82  realArray & gridVelocity,
83  Index & I1, Index & I2, Index & I3);
84 
85 
86 
87  //....Compute vel. of gridpoints in TWO conseq.(in time) mappings
88  void computeGridVelocity( real vTime,
89  real t0, realArray const & map0,
90  real t1, realArray const & map1,
91  realArray & gridVelocity,
92  Index & I1, Index & I2, Index & I3);
93 
94  //....Compute ACCEL. of gridpoints in THREE conseq.(in time) mappings
95  void computeGridAcceleration( real vTime,
96  real t0, realArray const & map0,
97  real t1, realArray const & map1,
98  real t2, realArray const & map2,
99  realArray & gridVelocity);
100 
101  //..Compute ACCEL. of gridpoints in TWO conseq.(in time) mappings
102  void computeGridAcceleration( real vTime,
103  real t0, realArray const & map0,
104  real t1, realArray const & map1,
105  realArray & gridVelocity);
106 
107 
108  //.............................................................................
109 
110  int grid; // the Component grid number of this DeformingGrid
111 
112  enum RemapType {
116  };
117 
118  //REGENERATION PARAMETERS -- moot, use params in pHyper on entry
120  //DeformingGridGenerationInformation *pGridGenerationInformation;
121 
122  //private:
123  //TIME HISTORY of grid points
127  real *timeHistory;
128  HyperbolicMapping *mappingHistoryList; // type should be more general
129  // --> just _Mapping_
130 
131  realArray *gridHistoryList; // keep also ghostbdries
132 
133  //protected:
134 
135  int numberOfDimensions; // 2 or 3 dimensional problem
136  int current; // position of current solution in arrays???
137  int numberOfSteps; // number of time steps taken
138  int numberSaved; // number of different times we have saved data
139  int maximumNumberToSave; // save at most this many previous time values
140 
141 
142  RealArray time; // arrays of times for which we know data.
143 
144  const Range R; // R=Range(0,2)
145 
146  // How many components & properties for those grids
148  //int numberOfComponentGrids;
149  //int numberOfMyGrids;
150 
151  //DEBUG DATA
152  int debug;
153  GenericGraphicsInterface *pGIDebug;
154  MappingInformation *pMapInfoDebug;
155 
156  //DEBUG CODE
157  void getPastLevelGrid( const int grid00, CompositeGrid & cg,
158  int iLevel, realArray & gridVelocity);
159 
160  void simpleGetVelocity( const real vTime,
161  const int grid00,
162  CompositeGrid & cg,
163  realArray & gridVelocity);
164 
165  void simpleGetVelocityAndPoints( const real vTime,
166  const int grid00,
167  CompositeGrid & cg,
168  realArray & gridVelocity,
169  realArray & xpoints1, realArray & xpoints2); //debug
170 
172  void createMappingName( real time00, aString & newMappingName);
173 
174 
175 };
176 
177 #endif