AdvDiffSolver flow-solver upgrade + alternating-Schwarz ROM for SteadyNS#62
Open
dreamer2368 wants to merge 29 commits into
Open
AdvDiffSolver flow-solver upgrade + alternating-Schwarz ROM for SteadyNS#62dreamer2368 wants to merge 29 commits into
dreamer2368 wants to merge 29 commits into
Conversation
…for steady ns solver test.
…o decrease error level.
Closed
| // External ports connecting to meshes outside the subset are excluded; | ||
| // their port attributes (formerly interior to the global domain) are | ||
| // registered into bdr_attributes as new global boundary attributes of the subset mesh. | ||
| // Subset mesh boundaries that lay on the global boundary inherit the |
dylan-copeland
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR bundles two related lines of work that have been developed sequentially. Both target the component-wise solver stack; the second sits on top of the first. Together they reflect the methodology demonstrated in our recent paper: https://onlinelibrary.wiley.com/doi/full/10.1002/nme.70314.
1.
AdvDiffSolverupdate (originally branchadvdiff_update)Generalizes the flow solver inside
AdvDiffSolverand hardens the sampling workflow so that failed parameter choices no longer abort sample generation.Flow solver generalization
AdvDiffSolvernow accepts eitherStokesSolverorSteadyNSSolveras its flow solver, selected byadv-diff/flow_solver/type(stokesorsteady-ns). The memberstokes_solveris renamedflow_solver.adv-diff/flow_solver/orderoption lets the flow solver use a different discretization order from the advection-diffusion solver.GetFlowFieldnow returns whether the flow solver converged, so the caller can react.SetParameterizedProblemreturns successMultiBlockSolver::SetParameterizedProblemand all overrides (PoissonSolver,StokesSolver,LinElastSolver,UnsteadyNSSolver,AdvDiffSolver) now returnbool.GenerateSamplesuses this signal: on random sampling, ifSetParameterizedProblemfails, the workflow draws a new parameter set and retries instead of crashing. On non-random sampling, the failure is fatal as before.BuildROM,SingleRun, andPrintEQPCoordsassert success.Separate ROM solver tolerances
solver/...namespace torom_solver/...(max_iter,relative_tolerance,absolute_tolerance,print_level,use_restart,initial_random_perturbation,jacobian/...). This decouples ROM and FOM solver settings, which were previously coupled and forced compromises during testing. Test inputs (steady_ns.base.yml,steady_ns.component.yml) updated to provide the new keys.Misc
utils/gmsh2mfem: added-rs/--refine-serialoption for serial uniform refinement at conversion time.2. Alternating-Schwarz ROM for SteadyNS (branch
schwarz)Adds an alternating-Schwarz solve mode for the component-wise SteadyNS ROM, where the global N×N array is solved as overlapping M×M subdomain ROM problems iterated to convergence.
Subset topology
ComponentTopologyHandler(global, i0, j0, N, M, subset_to_orig)constructor extracts an M×M subset starting at(i0, j0)from an N×N global component topology, preserving internal ports and promoting subset-facing internal interfaces to boundaries. Tracks a subset→original mesh mapping.Meshsubset constructor also stores the subset-to-original mapping.Solver-side hooks
MultiBlockSolver,StokesSolver,SteadyNSSolver,LinElastSolverconstructors now accept an optional pre-builtTopologyHandler*, enabling sub-solvers to share/own a subset topology.MultiBlockSolver::IsBdrTypeDefined()andPrintConfiguration()helpers.StokesSolver::SetSubsetComplementaryFluxenforces incompressibility on a subset when all boundaries are velocity-Dirichlet (uses newsubset_fluxcoefficient namespace).LinElastSolverBC handling rewritten to switch explicitly onBoundaryType(now supportsZEROand treats undefined boundaries as homogeneous Neumann).Schwarz driver
src/steady_ns_solver_schwarz.cppimplementingSteadyNSSolver::SchwarzROM(M, N, problem, …, maxIter, threshold, plateau_track, plateau_range, use_restart, initial_tol). Builds(N-M+1)²overlapping sub-solvers, sets internal sub-boundaries to Dirichlet from the latest global iterate, and iterates with plateau detection. Optional relaxedinitial_tolon the first iterations to avoid early stagnation.SingleSchwarzRunworkflow entry point, gated onmain/solver: steady-ns. Configured via newschwarz/input section (local_size,global_size,maximum_iteration,threshold,plateau_track,plateau_range,initial_tolerance).SteadyNSTensorROM::SaveOperatoradded for diagnostics (writes linear op + per-subdomain tensor to HDF5).Misc
PrintBoundaryType()helper added toparameterized_problem.sketches/phyml_poisson.cppfor the PhyML demo (piecewise-kappa diffusion with Gaussian forcing).Test plan
rom_solver/*keys intest/inputs/steady_ns.*.yml.flow_solver/type: stokesreproduces previous behavior.flow_solver/type: steady-nsruns end-to-end.GenerateSamplesrandom mode recovers from aSetParameterizedProblemfailure.SingleSchwarzRunconverges on the SteadyNS component-wise example used during development; record converged error and iteration count.phyml_poissonsketch builds.