Skip to content

feat: Improve error message when targetting wrong solver#3882

Merged
MelReyCG merged 11 commits intodevelopfrom
refactor/dudes/non-indicative-solver-ref
Oct 30, 2025
Merged

feat: Improve error message when targetting wrong solver#3882
MelReyCG merged 11 commits intodevelopfrom
refactor/dudes/non-indicative-solver-ref

Conversation

@arng40
Copy link
Copy Markdown
Contributor

@arng40 arng40 commented Oct 24, 2025

This PR aim to improve the error message when a coupled solver target wrong solver

Before :

***** LOCATION: path/to/physicsSolvers/multiphysics/CoupledSolver.hpp:89
***** Controlling expression (should be false): solver == nullptr
***** Rank 0: coupledFlowAndWells (isothm_mass_inj_table.xml, l.5): Could not find solver 'comp' of type geos::CompositionalMultiphaseBase

After :

***** LOCATION: path/to/physicsSolvers/multiphysics/CoupledSolver.hpp:118
***** Controlling expression (should be false): true
***** Rank 0: coupledFlowAndWells (isothm_mass_inj_table.xml, l.5): Could not find solver  named 'comp'.
Available flow solvers are [ compflow ].

** StackTrace of 7 frames **`

if we don"t have any flow solver we get :

***** LOCATION: path/to/physicsSolvers/multiphysics/CoupledSolver.hpp:118
***** Controlling expression (should be false): true
***** Rank 0: coupledFlowAndWells (isothm_mass_inj_table.xml, l.5): Could not find solver  named 'comp'.
No flow solver has been found.

@arng40 arng40 changed the title Improve error message when targetting wrong solver feat: Improve error message when targetting wrong solver Oct 27, 2025
{
std::ostringstream errorMessage;
errorMessage << GEOS_FMT( "{}: Could not find solver named '{}'.\n",
getDataContext(), solverName );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To target the solver attribute (xml line):

Suggested change
getDataContext(), solverName );
getWrapperDataContext( SolverType::coupledSolverAttributePrefix() ),
solverName );

then you can remove the string const & solverType parameter from throwSolversNotFound()

Copy link
Copy Markdown
Contributor

@MelReyCG MelReyCG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to remove useless

{

availableSolvers.emplace_back( group.getName());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 useless linebreaks

@arng40 arng40 added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI python-integration-test and removed python-integration-test labels Oct 29, 2025
@MelReyCG MelReyCG merged commit 2839ff5 into develop Oct 30, 2025
61 of 74 checks passed
@MelReyCG MelReyCG deleted the refactor/dudes/non-indicative-solver-ref branch October 30, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants