Skip to content

feat: Do not allow linear solver fail feature #3274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
061108a
add noLinSolveFail case
jafranc Aug 8, 2024
c618f46
Declaring flag for NoLinFail
jafranc Aug 8, 2024
299dbd2
bools are bad
jafranc Aug 9, 2024
c67857e
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
jafranc Aug 12, 2024
d05f393
Addressing Matteo's comment
jafranc Aug 12, 2024
6d22a04
Merge branch 'jafranc/feat/do-not-allow-non-cvg' of https://github.co…
jafranc Aug 12, 2024
1223010
merge LvArray head
jafranc Aug 12, 2024
e70834f
revert
Dec 20, 2024
0b19dc6
Merge remote-tracking branch 'origin/develop' into jafranc/feat/do-no…
Dec 20, 2024
fe8d1e3
doxygen fix
Dec 20, 2024
c1fe3c1
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Jan 8, 2025
1eb1cf7
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Jan 13, 2025
14a1d42
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Jan 16, 2025
02e8091
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Jan 22, 2025
f418c9c
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Jan 28, 2025
0f26140
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Feb 6, 2025
0654a5e
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Mar 5, 2025
9b1c4d8
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Mar 9, 2025
5fc289c
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Mar 18, 2025
3c55692
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Mar 19, 2025
7d074ae
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Mar 31, 2025
0da8934
Merge branch 'develop' into jafranc/feat/do-not-allow-non-cvg
paveltomin Apr 2, 2025
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
10 changes: 10 additions & 0 deletions src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ PhysicsSolverBase::PhysicsSolverBase( string const & name,
setRestartFlags( RestartFlags::WRITE_AND_READ ).
setDescription( "Write matrix, rhs, solution to screen ( = 1) or file ( = 2)." );

registerWrapper( viewKeyStruct::allowNonConvergedLinearSolverSolutionString(), &m_allowNonConvergedLinearSolverSolution ).
setApplyDefaultValue( 1 ).
setInputFlag( InputFlags::OPTIONAL ).
setRestartFlags( RestartFlags::WRITE_AND_READ ).
setDescription( "Cut time step if linear solution fail without going until max nonlinear iterations." );

addLogLevel< logInfo::Fields >();
addLogLevel< logInfo::LinearSolver >();
addLogLevel< logInfo::Solution >();
Expand Down Expand Up @@ -1078,6 +1084,10 @@ bool PhysicsSolverBase::solveNonlinearSystem( real64 const & time_n,

// Output the linear system solution for debugging purposes
debugOutputSolution( time_n, cycleNumber, newtonIter, m_solution );

// Do not allow non converged linear solver - cut time step
if( !m_allowNonConvergedLinearSolverSolution && m_linearSolverResult.status == LinearSolverResult::Status::NotConverged )
return false;
}

{
Expand Down
6 changes: 6 additions & 0 deletions src/coreComponents/physicsSolvers/PhysicsSolverBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ class PhysicsSolverBase : public ExecutableGroup

/// @return string for the writeLinearSystem wrapper
static constexpr char const * writeLinearSystemString() { return "writeLinearSystem"; }

/// @return string for the allowNonConvergedLinearSolverSolution wrapper
static constexpr char const * allowNonConvergedLinearSolverSolutionString() { return "allowNonConvergedLinearSolverSolution"; }
};

/**
Expand Down Expand Up @@ -1002,6 +1005,9 @@ class PhysicsSolverBase : public ExecutableGroup
/// timestep of the next cycle
real64 m_nextDt;

/// behavior in case of linear solver failure
integer m_allowNonConvergedLinearSolverSolution;

/// Number of cycles since last timestep cut
integer m_numTimestepsSinceLastDtCut;

Expand Down
Loading