Skip to content

Commit e099ca2

Browse files
committed
small fix
1 parent 7932a50 commit e099ca2

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

SU2_CFD/include/solvers/CFEASolver.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,7 @@ class CFEASolver : public CSolver {
527527
* \param[in] numerics - Implementation of numerical method.
528528
* \param[in] of_comp_mode - Mode to compute just the objective function.
529529
*/
530-
inline void Postprocessing(CGeometry *geometry,
531-
CConfig *config,
532-
CNumerics **numerics,
533-
bool of_comp_mode) final;
530+
void Postprocessing(CGeometry *geometry, CConfig *config, CNumerics **numerics, bool of_comp_mode) final;
534531

535532
/*!
536533
* \brief Routine to solve the Jacobian-Residual linearized system.

SU2_CFD/src/solvers/CFEASolver.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,14 +1916,12 @@ void CFEASolver::Postprocessing(CGeometry *geometry, CConfig *config, CNumerics
19161916
/*--- Compute the objective function. ---*/
19171917

19181918
const auto kindObjFunc = config->GetKind_ObjFunc();
1919-
1920-
if (((kindObjFunc == REFERENCE_GEOMETRY) || (kindObjFunc == REFERENCE_NODE)) &&
1921-
((config->GetDV_FEA() == YOUNG_MODULUS) || (config->GetDV_FEA() == DENSITY_VAL))) {
1922-
1923-
Stiffness_Penalty(geometry, numerics, config);
1924-
}
1919+
const bool penalty = ((kindObjFunc == REFERENCE_GEOMETRY) || (kindObjFunc == REFERENCE_NODE)) &&
1920+
((config->GetDV_FEA() == YOUNG_MODULUS) || (config->GetDV_FEA() == DENSITY_VAL));
19251921

19261922
if (of_comp_mode) {
1923+
if (penalty) Stiffness_Penalty(geometry, numerics, config);
1924+
19271925
switch (kindObjFunc) {
19281926
case REFERENCE_GEOMETRY: Compute_OFRefGeom(geometry, config); break;
19291927
case REFERENCE_NODE: Compute_OFRefNode(geometry, config); break;
@@ -1939,6 +1937,7 @@ void CFEASolver::Postprocessing(CGeometry *geometry, CConfig *config, CNumerics
19391937
Compute_NodalStress(geometry, numerics, config);
19401938

19411939
/*--- Compute functions for monitoring and output. ---*/
1940+
if (penalty) Stiffness_Penalty(geometry, numerics, config);
19421941
Compute_OFRefNode(geometry, config);
19431942
Compute_OFCompliance(geometry, config);
19441943
if (config->GetRefGeom()) Compute_OFRefGeom(geometry, config);

0 commit comments

Comments
 (0)