Skip to content

Commit 296e757

Browse files
committed
Make residual modifications in CSolver protected, too
1 parent d20b2c5 commit 296e757

1 file changed

Lines changed: 51 additions & 51 deletions

File tree

SU2_CFD/include/solvers/CSolver.hpp

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -437,45 +437,13 @@ class CSolver {
437437
unsigned short iMesh,
438438
unsigned short RunTime_EqSystem) { }
439439

440-
/*!
441-
* \brief Set the RMS and MAX residual to zero.
442-
*/
443-
inline void SetResToZero() {
444-
SU2_OMP_MASTER {
445-
for (auto& r : Residual_RMS) r = 0;
446-
for (auto& r : Residual_Max) r = 0;
447-
for (auto& p : Point_Max) p = 0;
448-
}
449-
END_SU2_OMP_MASTER
450-
SU2_OMP_BARRIER
451-
}
452-
453440
/*!
454441
* \brief Get the maximal residual, this is useful for the convergence history.
455442
* \param[in] val_var - Index of the variable.
456443
* \return Value of the biggest residual for the variable in the position <i>val_var</i>.
457444
*/
458445
inline su2double GetRes_RMS(unsigned short val_var) const { return Residual_RMS[val_var]; }
459446

460-
/*!
461-
* \brief Adds the maximal residual, this is useful for the convergence history (overload).
462-
* \param[in] val_var - Index of the variable.
463-
* \param[in] val_residual - Value of the residual to store in the position <i>val_var</i>.
464-
* \param[in] val_point - Value of the point index for the max residual.
465-
* \param[in] val_coord - Location (x, y, z) of the max residual point.
466-
*/
467-
inline void AddRes_Max(unsigned short val_var,
468-
su2double val_residual,
469-
unsigned long val_point,
470-
const su2double* val_coord) {
471-
if (val_residual > Residual_Max[val_var]) {
472-
Residual_Max[val_var] = val_residual;
473-
Point_Max[val_var] = val_point;
474-
for (unsigned short iDim = 0; iDim < nDim; iDim++)
475-
Point_Max_Coord[val_var][iDim] = val_coord[iDim];
476-
}
477-
}
478-
479447
/*!
480448
* \brief Get the maximal residual, this is useful for the convergence history.
481449
* \param[in] val_var - Index of the variable.
@@ -490,25 +458,6 @@ class CSolver {
490458
*/
491459
inline su2double GetRes_BGS(unsigned short val_var) const { return Residual_BGS[val_var]; }
492460

493-
/*!
494-
* \brief Adds the maximal residual for BGS subiterations.
495-
* \param[in] val_var - Index of the variable.
496-
* \param[in] val_residual - Value of the residual to store in the position <i>val_var</i>.
497-
* \param[in] val_point - Value of the point index for the max residual.
498-
* \param[in] val_coord - Location (x, y, z) of the max residual point.
499-
*/
500-
inline void AddRes_Max_BGS(unsigned short val_var,
501-
su2double val_residual,
502-
unsigned long val_point,
503-
const su2double* val_coord) {
504-
if (val_residual > Residual_Max_BGS[val_var]) {
505-
Residual_Max_BGS[val_var] = val_residual;
506-
Point_Max_BGS[val_var] = val_point;
507-
for (unsigned short iDim = 0; iDim < nDim; iDim++)
508-
Point_Max_Coord_BGS[val_var][iDim] = val_coord[iDim];
509-
}
510-
}
511-
512461
/*!
513462
* \brief Get the maximal residual for BGS subiterations.
514463
* \param[in] val_var - Index of the variable.
@@ -4367,4 +4316,55 @@ class CSolver {
43674316
SetResidual_RMS(geometry, config);
43684317
}
43694318

4319+
/*!
4320+
* \brief Set the RMS and MAX residual to zero.
4321+
*/
4322+
inline void SetResToZero() {
4323+
SU2_OMP_MASTER {
4324+
for (auto& r : Residual_RMS) r = 0;
4325+
for (auto& r : Residual_Max) r = 0;
4326+
for (auto& p : Point_Max) p = 0;
4327+
}
4328+
END_SU2_OMP_MASTER
4329+
SU2_OMP_BARRIER
4330+
}
4331+
4332+
/*!
4333+
* \brief Adds the maximal residual, this is useful for the convergence history (overload).
4334+
* \param[in] val_var - Index of the variable.
4335+
* \param[in] val_residual - Value of the residual to store in the position <i>val_var</i>.
4336+
* \param[in] val_point - Value of the point index for the max residual.
4337+
* \param[in] val_coord - Location (x, y, z) of the max residual point.
4338+
*/
4339+
inline void AddRes_Max(unsigned short val_var,
4340+
su2double val_residual,
4341+
unsigned long val_point,
4342+
const su2double* val_coord) {
4343+
if (val_residual > Residual_Max[val_var]) {
4344+
Residual_Max[val_var] = val_residual;
4345+
Point_Max[val_var] = val_point;
4346+
for (unsigned short iDim = 0; iDim < nDim; iDim++)
4347+
Point_Max_Coord[val_var][iDim] = val_coord[iDim];
4348+
}
4349+
}
4350+
4351+
/*!
4352+
* \brief Adds the maximal residual for BGS subiterations.
4353+
* \param[in] val_var - Index of the variable.
4354+
* \param[in] val_residual - Value of the residual to store in the position <i>val_var</i>.
4355+
* \param[in] val_point - Value of the point index for the max residual.
4356+
* \param[in] val_coord - Location (x, y, z) of the max residual point.
4357+
*/
4358+
inline void AddRes_Max_BGS(unsigned short val_var,
4359+
su2double val_residual,
4360+
unsigned long val_point,
4361+
const su2double* val_coord) {
4362+
if (val_residual > Residual_Max_BGS[val_var]) {
4363+
Residual_Max_BGS[val_var] = val_residual;
4364+
Point_Max_BGS[val_var] = val_point;
4365+
for (unsigned short iDim = 0; iDim < nDim; iDim++)
4366+
Point_Max_Coord_BGS[val_var][iDim] = val_coord[iDim];
4367+
}
4368+
}
4369+
43704370
};

0 commit comments

Comments
 (0)