@@ -472,7 +472,7 @@ class CConfig {
472472 string CustomObjFunc; /* !< \brief User-defined objective function. */
473473 string CustomOutputs; /* !< \brief User-defined functions for outputs. */
474474 unsigned short nDV, /* !< \brief Number of design variables. */
475- nObj, nObjW; /* ! \brief Number of objective functions. */
475+ nObj, nObjW; /* !< \brief Number of objective functions. */
476476 unsigned short * nDV_Value; /* !< \brief Number of values for each design variable (might be different than 1 if we allow arbitrary movement). */
477477 unsigned short nFFDBox; /* !< \brief Number of ffd boxes. */
478478 unsigned short nTurboMachineryKind; /* !< \brief Number turbomachinery types specified. */
@@ -489,20 +489,14 @@ class CConfig {
489489 string *FFDTag; /* !< \brief Parameters of the design variable. */
490490 string *TagFFDBox; /* !< \brief Tag of the FFD box. */
491491 unsigned short GeometryMode; /* !< \brief Geometry mode (analysis or gradient computation). */
492- unsigned short MGCycle; /* !< \brief Kind of multigrid cycle. */
493492 unsigned short FinestMesh; /* !< \brief Finest mesh for the full multigrid approach. */
494493 unsigned short nFFD_Fix_IDir,
495494 nFFD_Fix_JDir, nFFD_Fix_KDir; /* !< \brief Number of planes fixed in the FFD. */
496- unsigned short nMG_PreSmooth, /* !< \brief Number of MG pre-smooth parameters found in config file. */
497- nMG_PostSmooth, /* !< \brief Number of MG post-smooth parameters found in config file. */
498- nMG_CorrecSmooth; /* !< \brief Number of MG correct-smooth parameters found in config file. */
499495 short *FFD_Fix_IDir,
500496 *FFD_Fix_JDir, *FFD_Fix_KDir; /* !< \brief Exact sections. */
501- unsigned short *MG_PreSmooth, /* !< \brief Multigrid Pre smoothing. */
502- *MG_PostSmooth, /* !< \brief Multigrid Post smoothing. */
503- *MG_CorrecSmooth; /* !< \brief Multigrid Jacobi implicit smoothing of the correction. */
504497 su2double *LocationStations; /* !< \brief Airfoil sections in wing slicing subroutine. */
505498
499+ MG_CYCLE Kind_MGCycle; /* !< \brief Kind of multigrid cycle. */
506500 ENUM_MULTIZONE Kind_MZSolver; /* !< \brief Kind of multizone solver. */
507501 INC_DENSITYMODEL Kind_DensityModel; /* !< \brief Kind of the density model for incompressible flows. */
508502 CHT_COUPLING Kind_CHT_Coupling; /* !< \brief Kind of coupling method used at CHT interfaces. */
@@ -1132,6 +1126,10 @@ class CConfig {
11321126 unsigned long rampMUSCLCoeff[3 ]; /* !< \brief ramp MUSCL value coefficients for the COption class. */
11331127 } RampMUSCLParam;
11341128 su2double rampMUSCLValue; /* !< \brief Current value of the MUSCL ramp */
1129+ CMGOptions MGOptions;
1130+ /* --- Multigrid options ---*/
1131+ unsigned short nMG_PreSmooth_p{0 }, nMG_PostSmooth_p{0 }, nMG_CorrecSmooth_p{0 };
1132+ unsigned short *MG_PreSmooth_p{nullptr }, *MG_PostSmooth_p{nullptr }, *MG_CorrecSmooth_p{nullptr };
11351133
11361134 ENUM_STREAMWISE_PERIODIC Kind_Streamwise_Periodic; /* !< \brief Kind of Streamwise periodic flow (pressure drop or massflow) */
11371135 bool Streamwise_Periodic_Temperature; /* !< \brief Use real periodicity for Energy equation or otherwise outlet source term. */
@@ -2908,7 +2906,7 @@ class CConfig {
29082906 */
29092907 void SetMGLevels (unsigned short val_nMGLevels) {
29102908 nMGLevels = val_nMGLevels;
2911- if (MGCycle == FULLMG_CYCLE ) {
2909+ if (Kind_MGCycle == MG_CYCLE::FULL ) {
29122910 SetFinestMesh (val_nMGLevels);
29132911 }
29142912 }
@@ -2925,7 +2923,7 @@ class CConfig {
29252923 * \note This variable is used in a recursive way to perform the different kind of cycles
29262924 * \return 0 or 1 depending of we are dealing with a V or W cycle.
29272925 */
2928- unsigned short GetMGCycle (void ) const { return MGCycle ; }
2926+ MG_CYCLE GetMGCycle (void ) const { return Kind_MGCycle ; }
29292927
29302928 /* !
29312929 * \brief Get the king of evaluation in the geometrical module.
@@ -3847,34 +3845,9 @@ class CConfig {
38473845 su2double GetNacelleLocation (unsigned short val_index) const { return nacelle_location[val_index]; }
38483846
38493847 /* !
3850- * \brief Get the number of pre-smoothings in a multigrid strategy.
3851- * \param[in] val_mesh - Index of the grid.
3852- * \return Number of smoothing iterations.
3848+ * \brief Get the multigrid options struct.
38533849 */
3854- unsigned short GetMG_PreSmooth (unsigned short val_mesh) const {
3855- if (nMG_PreSmooth == 0 ) return 1 ;
3856- return MG_PreSmooth[val_mesh];
3857- }
3858-
3859- /* !
3860- * \brief Get the number of post-smoothings in a multigrid strategy.
3861- * \param[in] val_mesh - Index of the grid.
3862- * \return Number of smoothing iterations.
3863- */
3864- unsigned short GetMG_PostSmooth (unsigned short val_mesh) const {
3865- if (nMG_PostSmooth == 0 ) return 0 ;
3866- return MG_PostSmooth[val_mesh];
3867- }
3868-
3869- /* !
3870- * \brief Get the number of implicit Jacobi smoothings of the correction in a multigrid strategy.
3871- * \param[in] val_mesh - Index of the grid.
3872- * \return Number of implicit smoothing iterations.
3873- */
3874- unsigned short GetMG_CorrecSmooth (unsigned short val_mesh) const {
3875- if (nMG_CorrecSmooth == 0 ) return 0 ;
3876- return MG_CorrecSmooth[val_mesh];
3877- }
3850+ const CMGOptions& GetMGOptions () const { return MGOptions; }
38783851
38793852 /* !
38803853 * \brief plane of the FFD (I axis) that should be fixed.
@@ -6833,12 +6806,24 @@ class CConfig {
68336806 */
68346807 su2double GetDamp_Res_Restric (void ) const { return Damp_Res_Restric; }
68356808
6809+ /* !
6810+ * \brief Set the damping factor for the residual restriction (used by adaptive MG damping).
6811+ * \param[in] val - New damping factor value.
6812+ */
6813+ void SetDamp_Res_Restric (su2double val) { Damp_Res_Restric = val; }
6814+
68366815 /* !
68376816 * \brief Value of the damping factor for the correction prolongation.
68386817 * \return Value of the damping factor.
68396818 */
68406819 su2double GetDamp_Correc_Prolong (void ) const { return Damp_Correc_Prolong; }
68416820
6821+ /* !
6822+ * \brief Set the damping factor for the correction prolongation (used by adaptive MG damping).
6823+ * \param[in] val - New damping factor value.
6824+ */
6825+ void SetDamp_Correc_Prolong (su2double val) { Damp_Correc_Prolong = val; }
6826+
68426827 /* !
68436828 * \brief Value of the position of the Near Field (y coordinate for 2D, and z coordinate for 3D).
68446829 * \return Value of the Near Field position.
0 commit comments