2525 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
2626 */
2727
28-
2928#include " ../include/iteration/CIteration.hpp"
30- # include " ../include/solvers/CFEASolver.hpp "
29+
3130#include " ../include/output/COutput.hpp"
31+ #include " ../include/solvers/CFEASolver.hpp"
3232
33- CIteration::CIteration (const CConfig * config) {
33+ CIteration::CIteration (const CConfig* config) {
3434 rank = SU2_MPI::GetRank ();
3535 size = SU2_MPI::GetSize ();
3636
@@ -39,19 +39,13 @@ CIteration::CIteration(const CConfig *config) {
3939
4040 multizone = config->GetMultizone_Problem ();
4141 singlezone = !(config->GetMultizone_Problem ());
42-
4342}
4443
45- CIteration::~CIteration (void ) { }
46-
47- void CIteration::SetGrid_Movement (CGeometry **geometry,
48- CSurfaceMovement *surface_movement,
49- CVolumetricMovement *grid_movement,
50- CSolver ***solver,
51- CConfig *config,
52- unsigned long IntIter,
53- unsigned long TimeIter) {
44+ CIteration::~CIteration (void ) {}
5445
46+ void CIteration::SetGrid_Movement (CGeometry** geometry, CSurfaceMovement* surface_movement,
47+ CVolumetricMovement* grid_movement, CSolver*** solver, CConfig* config,
48+ unsigned long IntIter, unsigned long TimeIter) {
5549 unsigned short Kind_Grid_Movement = config->GetKind_GridMovement ();
5650 unsigned long nIterMesh;
5751 bool stat_mesh = true ;
@@ -64,44 +58,37 @@ void CIteration::SetGrid_Movement(CGeometry **geometry,
6458
6559 /* --- Perform mesh movement depending on specified type ---*/
6660 switch (Kind_Grid_Movement) {
61+ case RIGID_MOTION:
6762
68- case RIGID_MOTION:
69-
70- if (rank == MASTER_NODE)
71- cout << endl << " Performing rigid mesh transformation." << endl;
63+ if (rank == MASTER_NODE) cout << endl << " Performing rigid mesh transformation." << endl;
7264
73- /* --- Move each node in the volume mesh using the specified type
74- of rigid mesh motion. These routines also compute analytic grid
75- velocities for the fine mesh. ---*/
65+ /* --- Move each node in the volume mesh using the specified type
66+ of rigid mesh motion. These routines also compute analytic grid
67+ velocities for the fine mesh. ---*/
7668
77- grid_movement->Rigid_Translation (geometry[MESH_0], config, val_iZone, TimeIter);
78- grid_movement->Rigid_Plunging (geometry[MESH_0], config, val_iZone, TimeIter);
79- grid_movement->Rigid_Pitching (geometry[MESH_0], config, val_iZone, TimeIter);
80- grid_movement->Rigid_Rotation (geometry[MESH_0], config, val_iZone, TimeIter);
81-
82- /* --- Update the multigrid structure after moving the finest grid,
83- including computing the grid velocities on the coarser levels. ---*/
69+ grid_movement->Rigid_Translation (geometry[MESH_0], config, val_iZone, TimeIter);
70+ grid_movement->Rigid_Plunging (geometry[MESH_0], config, val_iZone, TimeIter);
71+ grid_movement->Rigid_Pitching (geometry[MESH_0], config, val_iZone, TimeIter);
72+ grid_movement->Rigid_Rotation (geometry[MESH_0], config, val_iZone, TimeIter);
8473
85- grid_movement->UpdateMultiGrid (geometry, config);
74+ /* --- Update the multigrid structure after moving the finest grid,
75+ including computing the grid velocities on the coarser levels. ---*/
8676
87- break ;
77+ grid_movement-> UpdateMultiGrid (geometry, config) ;
8878
89- /* --- Already initialized in the static mesh movement routine at driver level. ---*/
90- case STEADY_TRANSLATION:
91- case ROTATING_FRAME:
92- break ;
79+ break ;
9380
81+ /* --- Already initialized in the static mesh movement routine at driver level. ---*/
82+ case STEADY_TRANSLATION:
83+ case ROTATING_FRAME:
84+ break ;
9485 }
9586
96- if (config->GetSurface_Movement (AEROELASTIC) ||
97- config->GetSurface_Movement (AEROELASTIC_RIGID_MOTION)) {
98-
87+ if (config->GetSurface_Movement (AEROELASTIC) || config->GetSurface_Movement (AEROELASTIC_RIGID_MOTION)) {
9988 /* --- Apply rigid mesh transformation to entire grid first, if necessary ---*/
10089 if (IntIter == 0 ) {
10190 if (Kind_Grid_Movement == AEROELASTIC_RIGID_MOTION) {
102-
103- if (rank == MASTER_NODE)
104- cout << endl << " Performing rigid mesh transformation." << endl;
91+ if (rank == MASTER_NODE) cout << endl << " Performing rigid mesh transformation." << endl;
10592
10693 /* --- Move each node in the volume mesh using the specified type
10794 of rigid mesh motion. These routines also compute analytic grid
@@ -122,33 +109,28 @@ void CIteration::SetGrid_Movement(CGeometry **geometry,
122109
123110 /* --- Use the if statement to move the grid only at selected dual time step iterations. ---*/
124111 else if (IntIter % config->GetAeroelasticIter () == 0 ) {
125-
126- if (rank == MASTER_NODE)
127- cout << endl << " Solving aeroelastic equations and updating surface positions." << endl;
112+ if (rank == MASTER_NODE) cout << endl << " Solving aeroelastic equations and updating surface positions." << endl;
128113
129114 /* --- Solve the aeroelastic equations for the new node locations of the moving markers(surfaces) ---*/
130115
131116 solver[MESH_0][FLOW_SOL]->Aeroelastic (surface_movement, geometry[MESH_0], config, TimeIter);
132117
133118 /* --- Deform the volume grid around the new boundary locations ---*/
134119
135- if (rank == MASTER_NODE)
136- cout << " Deforming the volume grid due to the aeroelastic movement." << endl;
120+ if (rank == MASTER_NODE) cout << " Deforming the volume grid due to the aeroelastic movement." << endl;
137121 grid_movement->SetVolume_Deformation (geometry[MESH_0], config, true );
138122
139123 /* --- Update the grid velocities on the fine mesh using finite
140124 differencing based on node coordinates at previous times. ---*/
141125
142- if (rank == MASTER_NODE)
143- cout << " Computing grid velocities by finite differencing." << endl;
126+ if (rank == MASTER_NODE) cout << " Computing grid velocities by finite differencing." << endl;
144127 geometry[MESH_0]->SetGridVelocity (config, TimeIter);
145128
146129 /* --- Update the multigrid structure after moving the finest grid,
147130 including computing the grid velocities on the coarser levels. ---*/
148131
149132 grid_movement->UpdateMultiGrid (geometry, config);
150133 }
151-
152134 }
153135
154136 if (config->GetSurface_Movement (FLUID_STRUCTURE)) {
@@ -157,77 +139,61 @@ void CIteration::SetGrid_Movement(CGeometry **geometry,
157139
158140 /* --- Deform the volume grid around the new boundary locations ---*/
159141
160- if (rank == MASTER_NODE && Screen_Output)
161- cout << " Deforming the volume grid." << endl;
142+ if (rank == MASTER_NODE && Screen_Output) cout << " Deforming the volume grid." << endl;
162143 grid_movement->SetVolume_Deformation (geometry[MESH_0], config, true , false );
163144
164145 nIterMesh = grid_movement->Get_nIterMesh ();
165146 stat_mesh = (nIterMesh == 0 );
166147
167148 if (!adjoint && !stat_mesh) {
168- if (rank == MASTER_NODE && Screen_Output)
169- cout << " Computing grid velocities by finite differencing." << endl;
149+ if (rank == MASTER_NODE && Screen_Output) cout << " Computing grid velocities by finite differencing." << endl;
170150 geometry[MESH_0]->SetGridVelocity (config, TimeIter);
171- }
172- else if (stat_mesh) {
173- if (rank == MASTER_NODE && Screen_Output)
174- cout << " The mesh is up-to-date. Using previously stored grid velocities." << endl;
151+ } else if (stat_mesh) {
152+ if (rank == MASTER_NODE && Screen_Output)
153+ cout << " The mesh is up-to-date. Using previously stored grid velocities." << endl;
175154 }
176155
177156 /* --- Update the multigrid structure after moving the finest grid,
178157 including computing the grid velocities on the coarser levels. ---*/
179158
180159 grid_movement->UpdateMultiGrid (geometry, config);
181-
182160 }
183161
184- if (config->GetSurface_Movement (EXTERNAL) ||
185- config->GetSurface_Movement (EXTERNAL_ROTATION)) {
186-
162+ if (config->GetSurface_Movement (EXTERNAL) || config->GetSurface_Movement (EXTERNAL_ROTATION)) {
187163 /* --- Apply rigid rotation to entire grid first, if necessary ---*/
188164
189165 if (Kind_Grid_Movement == EXTERNAL_ROTATION) {
190- if (rank == MASTER_NODE)
191- cout << " Updating node locations by rigid rotation." << endl;
166+ if (rank == MASTER_NODE) cout << " Updating node locations by rigid rotation." << endl;
192167 grid_movement->Rigid_Rotation (geometry[MESH_0], config, val_iZone, TimeIter);
193168 }
194169
195170 /* --- Load new surface node locations from external files ---*/
196171
197- if (rank == MASTER_NODE)
198- cout << " Updating surface locations from file." << endl;
172+ if (rank == MASTER_NODE) cout << " Updating surface locations from file." << endl;
199173 surface_movement->SetExternal_Deformation (geometry[MESH_0], config, val_iZone, TimeIter);
200174
201175 /* --- Deform the volume grid around the new boundary locations ---*/
202176
203- if (rank == MASTER_NODE)
204- cout << " Deforming the volume grid." << endl;
177+ if (rank == MASTER_NODE) cout << " Deforming the volume grid." << endl;
205178 grid_movement->SetVolume_Deformation (geometry[MESH_0], config, true );
206179
207180 /* --- Update the grid velocities on the fine mesh using finite
208181 differencing based on node coordinates at previous times. ---*/
209182
210183 if (!adjoint) {
211- if (rank == MASTER_NODE)
212- cout << " Computing grid velocities by finite differencing." << endl;
184+ if (rank == MASTER_NODE) cout << " Computing grid velocities by finite differencing." << endl;
213185 geometry[MESH_0]->SetGridVelocity (config, TimeIter);
214186 }
215187
216188 /* --- Update the multigrid structure after moving the finest grid,
217189 including computing the grid velocities on the coarser levels. ---*/
218190
219191 grid_movement->UpdateMultiGrid (geometry, config);
220-
221192 }
222-
223193}
224194
225- void CIteration::SetMesh_Deformation (CGeometry **geometry,
226- CSolver **solver,
227- CNumerics ***numerics,
228- CConfig *config,
195+ void CIteration::SetMesh_Deformation (CGeometry** geometry, CSolver** solver, CNumerics*** numerics, CConfig* config,
229196 unsigned short kind_recording) {
230-
231197 if (!config->GetDeform_Mesh ()) return ;
232198
233199 /* --- Perform the elasticity mesh movement ---*/
@@ -250,113 +216,45 @@ void CIteration::SetMesh_Deformation(CGeometry **geometry,
250216
251217 /* --- Continue recording. ---*/
252218 if (ActiveTape) AD::StartRecording ();
219+ }
253220
221+ void CIteration::Preprocess (COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
222+ CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
223+ CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
224+ unsigned short val_iInst) {}
225+ void CIteration::Iterate (COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
226+ CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
227+ CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
228+ unsigned short val_iInst) {}
229+ void CIteration::Solve (COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
230+ CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
231+ CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
232+ unsigned short val_iInst) {}
233+ void CIteration::Update (COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
234+ CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
235+ CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
236+ unsigned short val_iInst) {}
237+ void CIteration::Predictor (COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
238+ CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
239+ CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
240+ unsigned short val_iInst) {}
241+ void CIteration::Relaxation (COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
242+ CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
243+ CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
244+ unsigned short val_iInst) {}
245+ bool CIteration::Monitor (COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
246+ CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
247+ CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
248+ unsigned short val_iInst) {
249+ return false ;
254250}
255251
256- void CIteration::Preprocess (COutput *output,
257- CIntegration ****integration,
258- CGeometry ****geometry,
259- CSolver *****solver,
260- CNumerics ******numerics,
261- CConfig **config,
262- CSurfaceMovement **surface_movement,
263- CVolumetricMovement ***grid_movement,
264- CFreeFormDefBox*** FFDBox,
265- unsigned short val_iZone,
266- unsigned short val_iInst) { }
267- void CIteration::Iterate (COutput *output,
268- CIntegration ****integration,
269- CGeometry ****geometry,
270- CSolver *****solver,
271- CNumerics ******numerics,
272- CConfig **config,
273- CSurfaceMovement **surface_movement,
274- CVolumetricMovement ***grid_movement,
275- CFreeFormDefBox*** FFDBox,
276- unsigned short val_iZone,
277- unsigned short val_iInst) { }
278- void CIteration::Solve (COutput *output,
279- CIntegration ****integration,
280- CGeometry ****geometry,
281- CSolver *****solver,
282- CNumerics ******numerics,
283- CConfig **config,
284- CSurfaceMovement **surface_movement,
285- CVolumetricMovement ***grid_movement,
286- CFreeFormDefBox*** FFDBox,
287- unsigned short val_iZone,
288- unsigned short val_iInst) { }
289- void CIteration::Update (COutput *output,
290- CIntegration ****integration,
291- CGeometry ****geometry,
292- CSolver *****solver,
293- CNumerics ******numerics,
294- CConfig **config,
295- CSurfaceMovement **surface_movement,
296- CVolumetricMovement ***grid_movement,
297- CFreeFormDefBox*** FFDBox,
298- unsigned short val_iZone,
299- unsigned short val_iInst) { }
300- void CIteration::Predictor (COutput *output,
301- CIntegration ****integration,
302- CGeometry ****geometry,
303- CSolver *****solver,
304- CNumerics ******numerics,
305- CConfig **config,
306- CSurfaceMovement **surface_movement,
307- CVolumetricMovement ***grid_movement,
308- CFreeFormDefBox*** FFDBox,
309- unsigned short val_iZone,
310- unsigned short val_iInst) { }
311- void CIteration::Relaxation (COutput *output,
312- CIntegration ****integration,
313- CGeometry ****geometry,
314- CSolver *****solver,
315- CNumerics ******numerics,
316- CConfig **config,
317- CSurfaceMovement **surface_movement,
318- CVolumetricMovement ***grid_movement,
319- CFreeFormDefBox*** FFDBox,
320- unsigned short val_iZone,
321- unsigned short val_iInst) { }
322- bool CIteration::Monitor (COutput *output,
323- CIntegration ****integration,
324- CGeometry ****geometry,
325- CSolver *****solver,
326- CNumerics ******numerics,
327- CConfig **config,
328- CSurfaceMovement **surface_movement,
329- CVolumetricMovement ***grid_movement,
330- CFreeFormDefBox*** FFDBox,
331- unsigned short val_iZone,
332- unsigned short val_iInst) { return false ; }
333-
334- void CIteration::Output (COutput *output,
335- CGeometry ****geometry,
336- CSolver *****solver,
337- CConfig **config,
338- unsigned long InnerIter,
339- bool StopCalc,
340- unsigned short val_iZone,
341- unsigned short val_iInst) {
342-
343- output->SetResult_Files (geometry[val_iZone][INST_0][MESH_0],
344- config[val_iZone],
345- solver[val_iZone][INST_0][MESH_0],
252+ void CIteration::Output (COutput* output, CGeometry**** geometry, CSolver***** solver, CConfig** config,
253+ unsigned long InnerIter, bool StopCalc, unsigned short val_iZone, unsigned short val_iInst) {
254+ output->SetResult_Files (geometry[val_iZone][INST_0][MESH_0], config[val_iZone], solver[val_iZone][INST_0][MESH_0],
346255 InnerIter);
347-
348256}
349- void CIteration::Postprocess (COutput *output,
350- CIntegration ****integration,
351- CGeometry ****geometry,
352- CSolver *****solver,
353- CNumerics ******numerics,
354- CConfig **config,
355- CSurfaceMovement **surface_movement,
356- CVolumetricMovement ***grid_movement,
357- CFreeFormDefBox*** FFDBox,
358- unsigned short val_iZone,
359- unsigned short val_iInst) { }
360-
361-
362-
257+ void CIteration::Postprocess (COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
258+ CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
259+ CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
260+ unsigned short val_iInst) {}
0 commit comments