Skip to content

Commit 2eceeda

Browse files
committed
simplify more
1 parent 74b174f commit 2eceeda

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,41 +70,39 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr
7070
}
7171

7272
if (TimeIter == 0) {
73-
/*--- Push solution back one or two levels. ---*/
73+
/*--- Push solution back one level. ---*/
7474

7575
if (dual_time) {
7676
for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) {
7777
for (auto iSol = 0ul; iSol < nSolvers; ++iSol) {
7878
solver[iZone][iInst][iMesh][solversToProcess[iSol]]->GetNodes()->Set_Solution_time_n();
79-
if (dual_time_2nd)
80-
solver[iZone][iInst][iMesh][solversToProcess[iSol]]->GetNodes()->Set_Solution_time_n1();
8179
}
8280
if (grid_IsMoving) {
8381
geometries[iMesh]->nodes->SetCoord_n();
84-
if (dual_time_2nd)
85-
geometries[iMesh]->nodes->SetCoord_n1();
8682
}
8783
if (config[iZone]->GetDynamic_Grid()) {
8884
geometries[iMesh]->nodes->SetVolume_n();
89-
if (dual_time_2nd)
90-
geometries[iMesh]->nodes->SetVolume_nM1();
9185
}
9286
}
9387
}
9488

95-
/*--- If required load another time step. ---*/
89+
/*--- If required load another time step. Push the previous time step to n-1 and the
90+
loaded time step to n. ---*/
9691

9792
if (dual_time_2nd) {
9893
LoadUnsteady_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 1);
9994

10095
for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) {
10196
for (auto iSol = 0ul; iSol < nSolvers; ++iSol) {
97+
solver[iZone][iInst][iMesh][solversToProcess[iSol]]->GetNodes()->Set_Solution_time_n1();
10298
solver[iZone][iInst][iMesh][solversToProcess[iSol]]->GetNodes()->Set_Solution_time_n();
10399
}
104100
if (grid_IsMoving) {
101+
geometries[iMesh]->nodes->SetCoord_n1();
105102
geometries[iMesh]->nodes->SetCoord_n();
106103
}
107104
if (config[iZone]->GetDynamic_Grid()) {
105+
geometries[iMesh]->nodes->SetVolume_nM1();
108106
geometries[iMesh]->nodes->SetVolume_n();
109107
}
110108
}

SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,20 @@ void CDiscAdjHeatIteration::Preprocess(COutput* output, CIntegration**** integra
5757
}
5858

5959
if (TimeIter == 0) {
60-
/*--- Push solution back one or two levels. ---*/
60+
/*--- Push solution back one level. ---*/
6161
if (dual_time) {
6262
for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) {
6363
solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n();
64-
if (dual_time_2nd) solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n1();
6564
}
6665
}
6766

68-
/*--- If required load another time step. ---*/
67+
/*--- If required load another time step. Push the previous time step to n-1 and the
68+
loaded time step to n. ---*/
6969
if (dual_time_2nd) {
7070
LoadUnsteady_Solution(geometry, solver, config, val_iZone, val_iInst, Direct_Iter - 1);
7171

7272
for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) {
73+
solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n1();
7374
solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n();
7475
}
7576
}

0 commit comments

Comments
 (0)