@@ -208,14 +208,10 @@ void CIntegration::Time_Integration(CGeometry *geometry, CSolver **solver_contai
208208
209209}
210210
211- void CIntegration::SetDualTime_Solver (CGeometry *geometry, CSolver *solver, CConfig *config, unsigned short iMesh) {
211+ void CIntegration::SetDualTime_Geometry (CGeometry *geometry, CSolver *mesh_solver, const CConfig *config, unsigned short iMesh) {
212212
213213 SU2_OMP_PARALLEL
214214 {
215- /* --- Store old solution, volumes and coordinates (in case there is grid movement). ---*/
216-
217- solver->GetNodes ()->Set_Solution_time_n1 ();
218- solver->GetNodes ()->Set_Solution_time_n ();
219215
220216 geometry->nodes ->SetVolume_nM1 ();
221217 geometry->nodes ->SetVolume_n ();
@@ -225,6 +221,19 @@ void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CCon
225221 geometry->nodes ->SetCoord_n ();
226222 }
227223
224+ if ((iMesh==MESH_0) && config->GetDeform_Mesh ()) mesh_solver->SetDualTime_Mesh ();
225+
226+ } // end SU2_OMP_PARALLEL
227+ }
228+
229+ void CIntegration::SetDualTime_Solver (const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh) {
230+
231+ SU2_OMP_PARALLEL
232+ {
233+ /* --- Store old solution ---*/
234+ solver->GetNodes ()->Set_Solution_time_n1 ();
235+ solver->GetNodes ()->Set_Solution_time_n ();
236+
228237 SU2_OMP_MASTER
229238 solver->ResetCFLAdapt ();
230239 SU2_OMP_BARRIER
@@ -239,113 +248,5 @@ void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CCon
239248 solver->GetNodes ()->SetLocalCFL (iPoint, config->GetCFL (iMesh));
240249 }
241250
242- /* --- Store old aeroelastic solutions ---*/
243- SU2_OMP_MASTER
244- if (config->GetGrid_Movement () && config->GetAeroelastic_Simulation () && (iMesh == MESH_0)) {
245-
246- config->SetAeroelastic_n1 ();
247- config->SetAeroelastic_n ();
248-
249- /* --- Also communicate plunge and pitch to the master node. Needed for output in case of parallel run ---*/
250-
251- #ifdef HAVE_MPI
252- su2double plunge, pitch, *plunge_all = NULL , *pitch_all = NULL ;
253- unsigned short iMarker, iMarker_Monitoring;
254- unsigned long iProcessor, owner, *owner_all = NULL ;
255-
256- string Marker_Tag, Monitoring_Tag;
257- int nProcessor = size;
258-
259- /* --- Only if master node allocate memory ---*/
260-
261- if (rank == MASTER_NODE) {
262- plunge_all = new su2double[nProcessor];
263- pitch_all = new su2double[nProcessor];
264- owner_all = new unsigned long [nProcessor];
265- }
266-
267- /* --- Find marker and give it's plunge and pitch coordinate to the master node ---*/
268-
269- for (iMarker_Monitoring = 0 ; iMarker_Monitoring < config->GetnMarker_Monitoring (); iMarker_Monitoring++) {
270-
271- for (iMarker = 0 ; iMarker < config->GetnMarker_All (); iMarker++) {
272-
273- Monitoring_Tag = config->GetMarker_Monitoring_TagBound (iMarker_Monitoring);
274- Marker_Tag = config->GetMarker_All_TagBound (iMarker);
275- if (Marker_Tag == Monitoring_Tag) { owner = 1 ; break ;
276- } else {
277- owner = 0 ;
278- }
279-
280- }
281- plunge = config->GetAeroelastic_plunge (iMarker_Monitoring);
282- pitch = config->GetAeroelastic_pitch (iMarker_Monitoring);
283-
284- /* --- Gather the data on the master node. ---*/
285-
286- SU2_MPI::Gather (&plunge, 1 , MPI_DOUBLE, plunge_all, 1 , MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm ());
287- SU2_MPI::Gather (&pitch, 1 , MPI_DOUBLE, pitch_all, 1 , MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm ());
288- SU2_MPI::Gather (&owner, 1 , MPI_UNSIGNED_LONG, owner_all, 1 , MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm ());
289-
290- /* --- Set plunge and pitch on the master node ---*/
291-
292- if (rank == MASTER_NODE) {
293- for (iProcessor = 0 ; iProcessor < (unsigned long )nProcessor; iProcessor++) {
294- if (owner_all[iProcessor] == 1 ) {
295- config->SetAeroelastic_plunge (iMarker_Monitoring, plunge_all[iProcessor]);
296- config->SetAeroelastic_pitch (iMarker_Monitoring, pitch_all[iProcessor]);
297- break ;
298- }
299- }
300- }
301-
302- }
303-
304- if (rank == MASTER_NODE) {
305- delete [] plunge_all;
306- delete [] pitch_all;
307- delete [] owner_all;
308- }
309- #endif
310- }
311- SU2_OMP_BARRIER
312-
313251 } // end SU2_OMP_PARALLEL
314-
315- }
316-
317- void CIntegration::SetStructural_Solver (CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh) {
318-
319- bool fsi = config->GetFSI_Simulation ();
320-
321- /* --- Update the solution according to the integration scheme used ---*/
322-
323- switch (config->GetKind_TimeIntScheme_FEA ()) {
324- case (CD_EXPLICIT):
325- break ;
326- case (NEWMARK_IMPLICIT):
327- if (fsi) solver_container[FEA_SOL]->ImplicitNewmark_Relaxation (geometry, config);
328- break ;
329- case (GENERALIZED_ALPHA):
330- solver_container[FEA_SOL]->GeneralizedAlpha_UpdateSolution (geometry, config);
331- solver_container[FEA_SOL]->GeneralizedAlpha_UpdateLoads (geometry, config);
332- break ;
333- }
334-
335- /* --- Store the solution at t+1 as solution at t, both for the local points and for the halo points ---*/
336-
337- solver_container[FEA_SOL]->GetNodes ()->Set_Solution_time_n ();
338- solver_container[FEA_SOL]->GetNodes ()->SetSolution_Vel_time_n ();
339- solver_container[FEA_SOL]->GetNodes ()->SetSolution_Accel_time_n ();
340-
341- /* --- If FSI problem, save the last Aitken relaxation parameter of the previous time step ---*/
342-
343- if (fsi) {
344-
345- su2double WAitk=0.0 ;
346-
347- WAitk = solver_container[FEA_SOL]->GetWAitken_Dyn ();
348- solver_container[FEA_SOL]->SetWAitken_Dyn_tn1 (WAitk);
349-
350- }
351252}
0 commit comments