Skip to content

Commit 7548083

Browse files
committed
fixes and update ref file
1 parent 9b28e74 commit 7548083

3 files changed

Lines changed: 20 additions & 17 deletions

File tree

SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class CDiscAdjFEASolver final : public CSolver {
9292
}
9393
}
9494

95-
void UpdateTotal() {
95+
void Store() {
9696
/*--- Clears the old values such that on the next time step the total is
9797
* incremented instead of updated. ---*/
9898
for (auto i = 0u; i < size; ++i) OldSens[i] = 0.0;

SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,21 +346,24 @@ void CDiscAdjFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_cont
346346

347347
void CDiscAdjFEASolver::SetSensitivity(CGeometry *geometry, CConfig *config, CSolver*){
348348

349-
E.UpdateTotal();
350-
Nu.UpdateTotal();
351-
Rho.UpdateTotal();
352-
Rho_DL.UpdateTotal();
353-
if (de_effects) EField.UpdateTotal();
354-
if (fea_dv) DV.UpdateTotal();
349+
const bool time_domain = config->GetTime_Domain();
350+
351+
/*--- Store the final material sensitivities for the time step to increment them on the next time step. ---*/
352+
if (time_domain) {
353+
E.Store();
354+
Nu.Store();
355+
Rho.Store();
356+
Rho_DL.Store();
357+
if (de_effects) EField.Store();
358+
if (fea_dv) DV.Store();
359+
}
355360

356361
/*--- Extract the topology optimization density sensitivities. ---*/
357362

358363
direct_solver->ExtractAdjoint_Variables(geometry, config);
359364

360365
/*--- Extract the geometric sensitivities ---*/
361366

362-
const bool time_domain = config->GetTime_Domain();
363-
364367
for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) {
365368

366369
auto Coord = geometry->nodes->GetCoord(iPoint);
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
INDEX GRAD
2-
0 -3.461460667601001e-03
3-
1 -1.841786311588662e-03
4-
2 -7.915536257748965e-04
5-
3 -2.739622082729719e-04
6-
4 -2.734869133461108e-04
7-
5 -7.881162428890194e-04
8-
6 -1.828978290516676e-03
9-
7 -3.427219398258311e-03
2+
0 -3.461460667601000e-03
3+
1 -1.841786311588663e-03
4+
2 -7.915536257748967e-04
5+
3 -2.739622082729717e-04
6+
4 -2.734869133461104e-04
7+
5 -7.881162428890206e-04
8+
6 -1.828978290516677e-03
9+
7 -3.427219398258316e-03

0 commit comments

Comments
 (0)