CG  Version 25
DeformingBodyMotion.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 #ifndef DEFORMING_BODY_MOTION_H
3 #define DEFORMING_BODY_MOTION_H
4 
5 // Master class for keeping track of deforming bodies in flow:
6 // The particular physics of the object is determined by
7 // a separate class that handles the evolution of the body
8 // under the surface stresses arising from the fluid:
9 //
10 // 1. ElasticFilament -- an elastic 1d filament in 2D flow
11 //
12 // NOT AVAILABLE YET:
13 //
14 // 2. ElasticShell -- Shell model in 3D
15 // 3. ElasticBody -- 2D or 3D elastic body
16 //
17 
18 #include "Overture.h"
19 #include "HyperbolicMapping.h"
20 #include "GenericGraphicsInterface.h"
21 #include "GridEvolution.h"
22 #include "DBase.hh"
23 using namespace DBase;
24 
25 // Forward defs:
26 class GenericGraphicsInterface;
27 class MappingInformation;
28 class DeformingGrid;
29 class GridFunction;
30 class Parameters;
31 
32 // Forward defs for the physicsObjects
33 class ElasticFilament;
34 
35 
36 
37 //................................
39 {
40 
41 public:
42 
44 {
46  //elasticRod,
47  // elasticShell,
50  unknownBody
51 };
52 
54 {
57  initialAcceleration
58 };
59 
60 
61 
63  int numberOfTimeLevels = 3,
64  GenericGraphicsInterface *pGIDebug00 =NULL,
65  int debug00 =0);
66 
68 
69 // apply correction at time t using new values of the forces at time t.
70 int correct( real t1, real t2,
71  GridFunction & cgf1,GridFunction & cgf2 );
72 
73 // define faces and grids that form the deforming body
74 int defineBody( int numberOfFaces, IntegerArray & boundaryFaces );
75 
76 int getAccelerationBC( const real time0, const int grid,
77  const Index &I1, const Index &I2, const Index &I3,
78  realSerialArray & bcAcceleration);
79 
80 // return the order of accuracy used to compute the acceleration
81 int getAccelerationOrderOfAccuracy() const;
82 
83 // return the initial state (position, velocity, acceleration)
84 int getInitialState( InitialStateOptionEnum stateOption,
85  const real time,
86  const int grid, const Index &I1, const Index &I2, const Index &I3,
87  realSerialArray & state );
88 
89 int getNumberOfGrids();
90 
91 
92 int getVelocity( const real time0,
93  const int grid,
94  CompositeGrid & cg,
95  realArray & gridVelocity);
96 
97 
98 int getVelocityBC( const real time0, const int grid, const Index &I1, const Index &I2, const Index &I3,
99  realSerialArray & bcVelocity);
100 
101 // return the order of accuracy used to compute the velocity
102 int getVelocityOrderOfAccuracy() const;
103 
104 
105 
106 //..Grid position, velocity & boundary acceleration
107 
108 int initialize(CompositeGrid & cg, real t=0. );
109 
110 int initializeGrid(CompositeGrid & cg, real t=0. );
111 
112 int initializePast( real time00, real dt00, CompositeGrid & cg);
113 
114 // integrate the BODY to a new time
115 int integrate( real t1, real t2, real t3,
116  GridFunction & cgf1,GridFunction & cgf2,GridFunction & cgf3,
117  realCompositeGridFunction & stress );
118 
119 void printFilamentHyperbolicDimensions(CompositeGrid & cg00, int gridToMove00);
120 
121 int regenerateComponentGrids( const real newT, CompositeGrid & cg);
122 
123 void registerDeformingComponentGrid( const int grid, CompositeGrid & cg);
124 
125 // set the order of accuracy used to compute the acceleration
126 int setAccelerationOrderOfAccuracy( int order );
127 
128 // set the order of accuracy used to compute the velocity
129 int setVelocityOrderOfAccuracy( int order );
130 
131 int setType( const DeformingBodyType bodyType );
132 
133 // interactive update
134 int update(CompositeGrid & cg, GenericGraphicsInterface & gi );
135 int update( GenericGraphicsInterface & gi );
136 
137 
138 // user defined deforming surface:
139 int userDefinedDeformingSurface(real t1, real t2, real t3,
140  GridFunction & cgf1,
141  GridFunction & cgf2,
142  GridFunction & cgf3,
143  int option );
144 
145 
146 protected:
147 
148 int advanceElasticShell(real t1, real t2, real t3,
149  GridFunction & cgf1,
150  GridFunction & cgf2,
151  GridFunction & cgf3,
152  realCompositeGridFunction & stress,
153  int option );
154 
155 
156  int getFace( int grid ) const;
157 
158  int getPastLevelGrid( const int level,
159  const int grid,
160  CompositeGrid & cg,
161  realArray & gridVelocity);
162 
163  void simpleGetVelocity( const real vTime,
164  const int grid00,
165  CompositeGrid & cg,
166  realArray & gridVelocity);
167 
168 
169 
170  ElasticFilament *pElasticFilament; // the Mapping for an elastic filament
171  DeformingGrid *pDeformingGrid; // The "grid" associated with the elastic filament
172 
173  int debug;
174  GenericGraphicsInterface *pGIDebug;
175  MappingInformation *pMapInfoDebug;
176 
177  Parameters & parameters; // parameters from the DomainSolver
178 
179  mutable DataBase deformingBodyDataBase; // save DeformingBodyMotion parameters in here
180 
181 };
182 
183 #endif
184