CG  Version 25
ElasticFilament.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 #ifndef ELASTIC_FILAMENT_H
3 #define ELASTIC_FILAMENT_H
4 
5 // Subclass of DeformingBodyMotion:
6 // * For keeping track of a 1d filament in 2d flow.
7 // ---> for the soapfilm-filament flow of Zhang et al.
8 //
9 #include "Overture.h"
10 #include "FilamentMapping.h"
11 #include "HyperbolicMapping.h"
12 
13 // Forward Defs:
14 class GenericGraphicsInterface;
15 class SplineMapping;
16 //class DeformingGridGenerationInformation;
17 
18 class TravelingWaveParameters; // for keeping debug filament data
19 
21 {
22 public:
23 
24  ElasticFilament(int nFilamentPoints=17, // was=81
25  int nEndPoints=3);
27 
28  //XXXXXX CHANGE -- set appropriate properties here: bending mod, dens etc
35  };
36 
43  };
44 
45  FilamentDynamicsType filamentDynamicsType; // default=PRESCRIBED_DYNAMICS
46 
47  void setProperties( enum FilamentPropertyFlag flag, real value);
48  void setProperties( enum FilamentPropertyFlag flag, int value);
49  void getProperties( enum FilamentPropertyFlag flag, real &value);
50  void getProperties( enum FilamentPropertyFlag flag, int &value);
51 
52  void initialize();
53  void initializeSurfaceData(double time);
54 
55  //int getGridGenerationInformation( DeformingGridGenerationInformation & dggi);
56  HyperbolicMapping *getHyperbolicMappingPointer();
57 
59  void regenerateBodyFittedMapping( HyperbolicMapping *pHyper00);
60 
61  // integrate to a new time
62  //int integrate( real tf, const realArray & surfaceStress, real t);
63  int integrate( real tf, const RealCompositeGridFunction & surfStress, real t);
64 private: //--AUX to integrate
65  void computePrescribedSurfaceData();
66  void computeSurfaceData();
67 public:
68 
69  // correct solution at time t using new values of the forces at time t.
70  //int correct( real t, const realArray & surfaceStress);
71 
72  //.. Evaluate current surface at time=time0--> extrap/interp if necessary
73  int evaluateSurfaceAtTime( real time0 );
74  void copyBodyFittedMapping( HyperbolicMapping &copyMap,
75  aString *pNewMappingName =NULL);
76 
77  void referenceMap( int gridToMove, CompositeGrid &cg); // DEBUG -- updates the grid?? 10/15/00
78  void replaceHyperbolicMapping( HyperbolicMapping *pNewHyper ); //OBSOLETE
79  HyperbolicMapping getHyperbolicMapping();
80  Mapping *getSurface();
81 
82  int update( GenericGraphicsInterface & gi );
83 
84 
85  //.....for boundary conditions in the flow solver
86  // int getVelocityBC( const real time0, const int grid, // not used
87  // CompositeGrid & cg, realArray & bcAcceleration);
88  //int getAccelerationBC( const real time0, const int grid, // not used
89  // CompositeGrid & cg, realArray & bcAcceleration);
90  //
91  int getVelocityBC( const real time0,
92  const Index &I1, const Index &I2, const Index &I3,
93  realSerialArray & bcVelocity);
94 
95  int getAccelerationBC( const real time0,
96  const Index &I1, const Index &I2, const Index &I3,
97  realSerialArray & bcAcceleration);
98 
99  //private: ------- AUX ROUTINES
100 
101  //Time stepping parameters & variables
102  int numberOfSteps; // for pred/correct
103  int maximumNumberToSave; // ...of internal stages in a tstepper
104  int numberSaved; // ...so far
105  RealArray time; // saved times
106  real tcomp; // Current time
107  int current; // current position in arrays
108 
109  //MATERIAL PROPERTIES
110  real mass; // total mass
111  real density; // density/unit lenght
112  real bendingMoment; // elastic bending moment
113  real el; // filament length
114 
115  //POSITION & STRESSES
116  realSerialArray xAll,vAll,accelAll; // Filament position & velocity
117  realSerialArray rhsAll; // Rhs of eq. for the filam.
118  realSerialArray x0, v0; // initial data
119  realSerialArray surfaceStress; // surface stress from fluid??
120 
121  //..AUX
122  void initializeFromFilamentMapping( FilamentMapping *pFilamCopy );
123 
124  FilamentMapping *pFilamentMapping;
126 
127  //.......OBSOLETE
128 
129  //DEBUG DATA
130  int debug; // DEBUG level
131  RealArray xDebug;
132 
133  //REPRESENTATION as splines & normal/tang vecs
136 
137  realSerialArray xFilament; // filament (x,y) values
138  realSerialArray x_t, x_tt, xr, xr_t, xr_tt;
139  //RealArray coreVelocity, coreAcceleration;
140 
141  // on thick filament
142  realSerialArray xThickFilament; // All of thickFilam->to Spline
143  realSerialArray surfaceVelocity; real surfaceVelocityTime;
145  realSerialArray stressThickFilament; // fluid stress on thick filam.
146 
147  //int nSplinePoints; // >= nFilamPts
148  //SplineMapping *pFilament; // The filament
149  //realArray normalVector, tangentVector; // Normal & Tangent
150 
151  //..Thick Filament
152  //real thickness; // thickness
153  //real endRadius; // radius of the end
154  //int nThickSplinePoints;
155  //SplineMapping *pThickFilament; // bdry with fluid
156 
157  //int nEndPoints;
158  //int nTotalThickFilamentPoints;
159  //realArray xTop,xBottom; // Pieces of the thick filam.
160  //realArray xLeadingEnd, xTrailingEnd; // - " -
161 
162 
163 };
164 #endif
165 
166