Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9a2d329
fix order
bigfooted Jul 29, 2026
06790fb
minor implicit line changes
bigfooted Jul 30, 2026
4cc6571
Merge branch 'develop' into fix_mg_implicit_lines
bigfooted Jul 31, 2026
3b9e9df
fix multigrid turbulence
bigfooted Aug 1, 2026
7e1f670
small flow solver update
bigfooted Aug 2, 2026
33f2eaf
small flow solver update
bigfooted Aug 2, 2026
3e0d528
Apply suggestions from code review
bigfooted Aug 4, 2026
feccac0
Merge branch 'develop' into feature_fullmg
bigfooted Aug 4, 2026
4922e7b
Apply suggestions from code review
bigfooted Aug 4, 2026
5d80679
precommit
bigfooted Aug 4, 2026
7a0db10
Apply suggestions from code review
bigfooted Aug 4, 2026
aca34af
Apply suggestions from code review
bigfooted Aug 4, 2026
5648a3c
fix cfl for full multigrid
bigfooted Aug 5, 2026
08a2f02
fix cfl for full multigrid
bigfooted Aug 5, 2026
aac6802
fix cfl for full multigrid
bigfooted Aug 5, 2026
56134c5
fix cfl for full multigrid
bigfooted Aug 5, 2026
335e2c2
extra scaling for warmup phaser
bigfooted Aug 5, 2026
006ecd5
cleanup implicit lines
bigfooted Aug 5, 2026
1b84b72
cleanup implicit lines with claude
bigfooted Aug 5, 2026
2c1edf0
cleanup implicit lines with claude
bigfooted Aug 5, 2026
38b9c11
Apply suggestion from @bigfooted
bigfooted Aug 5, 2026
e9f8b7c
remove debugging output
bigfooted Aug 5, 2026
98da9bc
Merge branch 'feature_fullmg' of https://github.com/su2code/su2 into …
bigfooted Aug 5, 2026
05e68d3
remove unused variable
bigfooted Aug 5, 2026
f7677dc
Potential fix for pull request finding 'CodeQL / Comparison of narrow…
bigfooted Aug 5, 2026
ab003cb
update euler tests
bigfooted Aug 6, 2026
36a5dbd
Merge branch 'feature_fullmg' of https://github.com/su2code/su2 into …
bigfooted Aug 6, 2026
f5b52a0
fix mg update, remove linear prolongation for now
bigfooted Aug 9, 2026
6792ff7
cleanup early exit for FMG warmup phase
bigfooted Aug 9, 2026
2a9fa0d
only show mg output when mglevel>0
bigfooted Aug 9, 2026
78a4861
Merge branch 'develop' into feature_fullmg
bigfooted Aug 9, 2026
4d831a9
some small optimizations
bigfooted Aug 9, 2026
0ce67e7
freeze preconditioner, 10 percent speed gain.
bigfooted Aug 11, 2026
2c48c63
continued multigrid improvement
bigfooted Aug 14, 2026
ae01006
fix implicit lines in 3D for a large part.
bigfooted Aug 18, 2026
80f3264
Merge branch 'develop' into feature_fullmg
bigfooted Aug 19, 2026
0529c94
fix mg+mpi interface issue
bigfooted Aug 19, 2026
c9bef82
Merge branch 'feature_fullmg' of https://github.com/su2code/su2 into …
bigfooted Aug 19, 2026
a029d61
pre-commit
bigfooted Aug 19, 2026
b880efa
base implicit line agglomeration on aspect ratio
bigfooted Aug 21, 2026
7be5d3d
change parmetis anisotropy
bigfooted Aug 21, 2026
46c167e
Merge branch 'develop' into feature_fullmg
bigfooted Aug 21, 2026
192c3e1
fix some openmp stuff
bigfooted Aug 21, 2026
cf0fa01
Merge branch 'develop' into feature_fullmg
bigfooted Aug 21, 2026
f539d34
Merge branch 'develop' into feature_fullmg
bigfooted Aug 26, 2026
0e5c36f
Merge branch 'feature_fullmg' of https://github.com/su2code/su2 into …
bigfooted Aug 26, 2026
4524b30
merge with develop
bigfooted Aug 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ class CConfig {
su2double Linear_Solver_Error; /*!< \brief Min error of the linear solver for the implicit formulation. */
su2double Deform_Linear_Solver_Error; /*!< \brief Min error of the linear solver for the implicit formulation. */
su2double Linear_Solver_Smoother_Relaxation; /*!< \brief Relaxation factor for iterative linear smoothers. */
unsigned long Linear_Solver_Iter; /*!< \brief Max iterations of the linear solver for the implicit formulation. */
unsigned long Linear_Solver_Iter;
unsigned long Linear_Solver_Prec_Freeze; /*!< \brief Reuse the finest-grid preconditioner for this many solves. */ /*!< \brief Max iterations of the linear solver for the implicit formulation. */
unsigned long Deform_Linear_Solver_Iter; /*!< \brief Max iterations of the linear solver for the implicit formulation. */
unsigned long Linear_Solver_Restart_Frequency; /*!< \brief Restart frequency of the linear solver for the implicit formulation. */
unsigned long Linear_Solver_Restart_Deflation; /*!< \brief Number of vectors used for deflated restarts. */
Expand Down Expand Up @@ -1098,6 +1099,7 @@ class CConfig {
su2double ParMETIS_tolerance; /*!< \brief Load balancing tolerance for ParMETIS. */
long ParMETIS_pointWgt; /*!< \brief Load balancing weight given to points. */
long ParMETIS_edgeWgt; /*!< \brief Load balancing weight given to edges. */
su2double ParMETIS_anisoWgt; /*!< \brief Strength of the anisotropy-aware ParMETIS edge weights. 0 disables them. */
unsigned short DirectDiff; /*!< \brief Direct Differentation mode. */
bool DiscreteAdjoint, /*!< \brief AD-based discrete adjoint mode. */
DiscreteAdjointDebug; /*!< \brief Discrete adjoint debug mode using tags. */
Expand Down Expand Up @@ -4380,6 +4382,12 @@ class CConfig {
*/
unsigned long GetLinear_Solver_Iter(void) const { return Linear_Solver_Iter; }

/*!
* \brief Number of consecutive linear solves that reuse one finest-grid preconditioner.
* \return Freeze period, 1 meaning rebuild on every solve.
*/
unsigned long GetLinear_Solver_Prec_Freeze(void) const { return Linear_Solver_Prec_Freeze; }

/*!
* \brief Get max number of iterations of the linear solver for the implicit formulation.
* \return Max number of iterations of the linear solver for the implicit formulation.
Expand Down Expand Up @@ -10166,6 +10174,11 @@ class CConfig {
*/
long GetParMETIS_EdgeWeight() const { return ParMETIS_edgeWgt; }

/*!
* \brief Get the strength of the anisotropy-aware ParMETIS edge weights (0 disables them).
*/
passivedouble GetParMETIS_AnisoWeight() const { return SU2_TYPE::GetValue(ParMETIS_anisoWgt); }

/*!
* \brief Find the marker index (if any) that is part of a given interface pair.
* \param[in] iInterface - Number of the interface pair being tested, starting at 0.
Expand Down
7 changes: 7 additions & 0 deletions Common/include/linear_algebra/CSysSolve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ class CSysSolve {
/*!< \brief Inner solver for nested preconditioning. */
std::unique_ptr<CSysSolve<ScalarType>> inner_solver;

/*--- Preconditioner freezing on coarse multigrid levels. The factorization lives in the
* CSysMatrix (not in the short-lived CPreconditioner object built in Solve), so simply
* skipping Build() reuses the previous one. This instance belongs to one solver on one
* grid level, so the counter is naturally per-level. See MG_COARSE_PREC_FREEZE. ---*/
mutable unsigned long precSolveCount = 0; /*!< \brief Linear solves done by this instance. */
mutable bool buildPrecThisSolve = true; /*!< \brief Decision for the current solve, shared by all threads. */

/*!
* \brief sign transfer function
* \param[in] x - value having sign prescribed
Expand Down
12 changes: 11 additions & 1 deletion Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
struct CMGOptions {
su2double MG_Smooth_Res_Threshold{0.0}; /*!< \brief RMS reduction threshold for MG smoothing early exit. */
su2double MG_Smooth_Coeff{0.0}; /*!< \brief Jacobi smoother coefficient for coarse-grid correction. */
unsigned long MG_Min_MeshSize{0}; /*!< \brief Minimum CVs on coarsest MG level. */
unsigned long MG_Min_MeshSize{0}; /*!< \brief Minimum CVs on coarsest MG level, per MPI rank. */
std::vector<unsigned short> MG_PreSmooth; /*!< \brief Multigrid pre-smoothing iterations per level. */
std::vector<unsigned short> MG_PostSmooth; /*!< \brief Multigrid post-smoothing iterations per level. */
std::vector<unsigned short> MG_CorrecSmooth; /*!< \brief Multigrid Jacobi correction-smoothing per level. */
Expand All @@ -1126,6 +1126,16 @@ struct CMGOptions {
su2double MG_Smooth_StagnationTol{0.0}; /*!< \brief Stagnation early exit: stop if current_rms >= prev_rms * tol. 0 = disabled. */
bool MG_Implicit_Lines{false}; /*!< \brief Enable implicit-lines agglomeration from walls. */
unsigned long MG_Implicit_Lines_MaxLength{20}; /*!< \brief Maximum nodes on a wall-normal implicit line (including wall seed). */
bool MG_Implicit_Lines_Isotropic{false}; /*!< \brief Use isotropic (vs anisotropic) agglomeration along implicit lines. */
unsigned long MG_Implicit_Lines_Max_Group{0}; /*!< \brief Max number of parallel implicit lines merged into one coarse
CV tangential to the wall. 0 = dimension-appropriate default
(2 in 2D, 4 in 3D). See CMultiGridGeometry::AgglomerateImplicitLines. */
su2double MG_Implicit_Lines_Min_AR{2.0}; /*!< \brief Smallest local cell aspect ratio for which a node still counts as
part of a stretched layer. Ends a line where the mesh stops being
stretched along it, and decides which boundaries carry a layer normal
to them. See CMultiGridGeometry::AgglomerateImplicitLines. */
unsigned long MG_Coarse_Prec_Freeze{1}; /*!< \brief On MG levels > 0, reuse the linear-solver preconditioner for this many consecutive solves. 1 = rebuild every solve. */
su2double MG_Correction_Limit{0.0}; /*!< \brief Max relative change of any solution component from one prolongated FAS correction. 0 = no limit. */
unsigned long MG_Startup_Iter{100}; /*!< \brief Iterations per mesh during FMG startup, and the length of each level's CFL ramp. 0 = no iteration budget. */
su2double MG_Startup_Convergence{-2.0}; /*!< \brief FMG: orders of magnitude (log10) that CONV_FIELD must drop on the
active level before promoting to the next finer one. Negative is a
Expand Down
34 changes: 33 additions & 1 deletion Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2065,12 +2065,36 @@ void CConfig::SetConfig_Options() {
addDoubleOption("MG_SMOOTH_STAGNATION_TOL", MGOptions.MG_Smooth_StagnationTol, 0.99);
/*!\brief MG_SMOOTH_COEFF\n DESCRIPTION: Smoothing coefficient for the correction prolongation Jacobi smoother. DEFAULT: 1.25 \ingroup Config*/
addDoubleOption("MG_SMOOTH_COEFF", MGOptions.MG_Smooth_Coeff, 1.25);
/*!\brief MG_MIN_MESHSIZE\n DESCRIPTION: Minimum number of CVs on the coarsest multigrid level. Levels that would produce fewer CVs are not created. DEFAULT: 50 \ingroup Config*/
/*!\brief MG_COARSE_PREC_FREEZE\n DESCRIPTION: On multigrid levels above MESH_0, reuse the linear-solver preconditioner
* (e.g. the ILU factorization) for this many consecutive linear solves instead of rebuilding it every time.
* 1 reproduces the previous behaviour exactly. DEFAULT: 1 \ingroup Config*/
addUnsignedLongOption("MG_COARSE_PREC_FREEZE", MGOptions.MG_Coarse_Prec_Freeze, 1);
/*!\brief LINEAR_SOLVER_PREC_FREEZE\n DESCRIPTION: Reuse the linear-solver preconditioner (e.g. the ILU factorization)
* for this many consecutive solves on the finest grid, instead of rebuilding it every time. Applies to MESH_0 and to
* single-grid runs; MG_COARSE_PREC_FREEZE covers the coarse levels. The fine-grid preconditioner drives the outer
* nonlinear convergence, so raise this one with more care. 1 rebuilds every solve. DEFAULT: 1 \ingroup Config*/
addUnsignedLongOption("LINEAR_SOLVER_PREC_FREEZE", Linear_Solver_Prec_Freeze, 1);
/*!\brief MG_CORRECTION_LIMIT\n DESCRIPTION: Largest relative change any solution component may undergo from a single
* prolongated multigrid correction, e.g. 0.1 caps it at 10%. The whole correction vector at a point is scaled by one
* factor so its direction is preserved. 0 disables the limiter (previous behaviour). DEFAULT: 0 \ingroup Config*/
addDoubleOption("MG_CORRECTION_LIMIT", MGOptions.MG_Correction_Limit, 0.0);
/*!\brief MG_MIN_MESHSIZE\n DESCRIPTION: Minimum number of CVs on the coarsest multigrid level, checked per MPI rank (i.e. on the smallest partition). Levels that would produce fewer CVs on any rank are not created. DEFAULT: 50 \ingroup Config*/
addUnsignedLongOption("MG_MIN_MESHSIZE", MGOptions.MG_Min_MeshSize, 500);
/*!\brief MG_IMPLICIT_LINES\n DESCRIPTION: Enable agglomeration along implicit lines from wall seeds. DEFAULT: NO \ingroup Config*/
addBoolOption("MG_IMPLICIT_LINES", MGOptions.MG_Implicit_Lines, false);
/*!\brief MG_IMPLICIT_LINES_MAX_LENGTH\n DESCRIPTION: Maximum number of nodes on a wall-normal implicit agglomeration line (including the wall seed node). DEFAULT: 20 \ingroup Config*/
addUnsignedLongOption("MG_IMPLICIT_LINES_MAX_LENGTH", MGOptions.MG_Implicit_Lines_MaxLength, 20);
/*!\brief MG_IMPLICIT_LINES_ISOTROPIC\n DESCRIPTION: Use isotropic agglomeration along implicit lines (4 cells per coarse CV) instead of anisotropic (2 cells per coarse CV). DEFAULT: NO \ingroup Config*/
addBoolOption("MG_IMPLICIT_LINES_ISOTROPIC", MGOptions.MG_Implicit_Lines_Isotropic, false);
/*!\brief MG_IMPLICIT_LINES_MAX_GROUP\n DESCRIPTION: Maximum number of parallel implicit lines merged tangential to
* the wall into one coarse CV (2D: always 2; 3D: e.g. 4 for a wall quad/hex corner, 3 for a triangular prism apex).
* 0 uses the dimension-appropriate default (2 in 2D, 4 in 3D). DEFAULT: 0 \ingroup Config*/
addUnsignedLongOption("MG_IMPLICIT_LINES_MAX_GROUP", MGOptions.MG_Implicit_Lines_Max_Group, 0);
/*!\brief MG_IMPLICIT_LINES_MIN_AR\n DESCRIPTION: Smallest local cell aspect ratio for which a node still counts as part
* of a stretched layer, measured from the ratio of dual-grid edge weights. Ends an implicit line where the mesh stops
* being stretched along it, instead of letting it run to the far field, and decides which boundaries carry a layer
* normal to them and may therefore seed lines. 1.0 disables both tests. DEFAULT: 2.0 \ingroup Config*/
addDoubleOption("MG_IMPLICIT_LINES_MIN_AR", MGOptions.MG_Implicit_Lines_Min_AR, 2.0);
/*!\brief MG_STARTUP_ITER\n DESCRIPTION: Max number of iterations spent on each mesh during the Full
* Multigrid (FMG) startup phase. DEFAULT: 100 \ingroup Config*/
addUnsignedLongOption("MG_STARTUP_ITER", MGOptions.MG_Startup_Iter, 100);
Expand Down Expand Up @@ -3053,6 +3077,14 @@ void CConfig::SetConfig_Options() {

/* DESCRIPTION: ParMETIS load balancing weight for edges (equiv. to neighbors) */
addLongOption("PARMETIS_EDGE_WEIGHT", ParMETIS_edgeWgt, 1);
/* DESCRIPTION: Strength of the anisotropy-aware ParMETIS edge weights. ParMETIS is otherwise given no edge weights at
* all, so every edge is equally cheap to cut and partition boundaries slice straight through the stretched cells of a
* boundary layer, splitting the wall-normal columns that implicit-line agglomeration and line-implicit smoothing rely
* on. Weighting an edge by the inverse of its length makes the short wall-normal edges expensive to cut and pushes the
* cuts into the tangential direction instead. On a mesh without stretching all edges are of similar length, the
* weights come out uniform, and the partitioning is the same as with no weights at all. 0 disables the weights.
* DEFAULT: 0 */
addDoubleOption("PARMETIS_ANISO_WEIGHT", ParMETIS_anisoWgt, 0.0);

/*--- options that are used in the Hybrid RANS/LES Simulations ---*/
/*!\par CONFIG_CATEGORY:Hybrid_RANSLES Options\ingroup Config*/
Expand Down
Loading
Loading