The SolutionInvalidity will contain all the information about the occurrence(s) of solution invalidity. More...
#include <SolutionInvalidity.h>
Classes | |
struct | InvalidCounts |
Struct used in _counts for storing invalid occurrences. More... | |
struct | TimestepCounts |
Struct used in InvalidCounts for storing the time history of invalid occurrences. More... | |
Public Types | |
using | SolutionInvalidityRegistry = moose::internal::SolutionInvalidityRegistry |
Public Member Functions | |
SolutionInvalidity (MooseApp &app) | |
Create a new SolutionInvalidity. More... | |
void | flagInvalidSolutionInternal (const InvalidSolutionID _invalid_solution_id) |
Increments solution invalid occurrences for each solution id. More... | |
bool | hasInvalidSolutionWarning () const |
Whether or not an invalid solution was encountered that was a warning. More... | |
bool | hasInvalidSolutionError () const |
Whether or not an invalid solution was encountered that was an error. More... | |
bool | hasInvalidSolution () const |
Whether or not any invalid solution was encountered (error or warning). More... | |
void | resetSolutionInvalidTimeStep () |
Reset the number of solution invalid occurrences back to zero for the current time step. More... | |
void | resetSolutionInvalidCurrentIteration () |
Reset the number of solution invalid occurrences back to zero. More... | |
void | solutionInvalidAccumulation () |
Pass the number of solution invalid occurrences from current iteration to cumulative counters. More... | |
void | solutionInvalidAccumulationTimeStep (const unsigned int timestep_index) |
Pass the number of solution invalid occurrences from current iteration to cumulative time iteration counters. More... | |
void | computeTotalCounts () |
Compute the total number of solution invalid occurrences. More... | |
const std::vector< InvalidCounts > & | counts () const |
Access the private solution invalidity counts. More... | |
void | print (const ConsoleStream &console) const |
Print the summary table of Solution Invalid warnings. More... | |
void | printHistory (const ConsoleStream &console, unsigned int ×tep_interval_size) const |
Print the time history table of Solution Invalid warnings. More... | |
void | printDebug (InvalidSolutionID _invalid_solution_id) const |
Immediately print the section and message for debug purpose. More... | |
void | syncIteration () |
Sync iteration counts to main processor. More... | |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
Protected Attributes | |
const ConsoleStream | _console |
An instance of helper class to write streams to the Console objects. More... | |
const Parallel::Communicator & | _communicator |
Private Types | |
typedef VariadicTable< std::string, unsigned long int, unsigned long int, unsigned long int, std::string > | FullTable |
typedef VariadicTable< std::string, std::string, unsigned long int, unsigned long int > | TimeTable |
Private Member Functions | |
FullTable | summaryTable () const |
Build a VariadicTable for solution invalidity. More... | |
TimeTable | transientTable (unsigned int &time_interval) const |
Build a VariadicTable for solution invalidity history. More... | |
Private Attributes | |
std::mutex | _invalid_mutex |
Mutex for locking access to the invalid counts TODO: These can be changed to shared_mutexes. More... | |
SolutionInvalidityRegistry & | _solution_invalidity_registry |
Create a registry to keep track of the names and occurrences of the solution invalidity. More... | |
std::vector< InvalidCounts > | _counts |
Store the solution invalidity counts. More... | |
bool | _has_synced |
Whether or not we've synced (can check counts/existance of warnings or errors) More... | |
bool | _has_solution_warning |
Whether or not we have a warning (only after a sync) More... | |
bool | _has_solution_error |
Whether or not we have an invalid solution (only after a sync) More... | |
Friends | |
void | dataStore (std::ostream &, SolutionInvalidity &, void *) |
void | dataLoad (std::istream &, SolutionInvalidity &, void *) |
The SolutionInvalidity will contain all the information about the occurrence(s) of solution invalidity.
Definition at line 37 of file SolutionInvalidity.h.
|
private |
Definition at line 142 of file SolutionInvalidity.h.
Definition at line 40 of file SolutionInvalidity.h.
|
private |
Definition at line 147 of file SolutionInvalidity.h.
SolutionInvalidity::SolutionInvalidity | ( | MooseApp & | app | ) |
Create a new SolutionInvalidity.
Definition at line 27 of file SolutionInvalidity.C.
void SolutionInvalidity::computeTotalCounts | ( | ) |
Compute the total number of solution invalid occurrences.
Definition at line 107 of file SolutionInvalidity.C.
|
inline |
Access the private solution invalidity counts.
Definition at line 105 of file SolutionInvalidity.h.
Referenced by syncIteration(), and to_json().
void SolutionInvalidity::flagInvalidSolutionInternal | ( | const InvalidSolutionID | _invalid_solution_id | ) |
Increments solution invalid occurrences for each solution id.
Definition at line 38 of file SolutionInvalidity.C.
bool SolutionInvalidity::hasInvalidSolution | ( | ) | const |
Whether or not any invalid solution was encountered (error or warning).
This must be called after a sync.
Definition at line 62 of file SolutionInvalidity.C.
Referenced by SolutionInvalidityOutput::shouldOutput().
bool SolutionInvalidity::hasInvalidSolutionError | ( | ) | const |
Whether or not an invalid solution was encountered that was an error.
This must be called after a sync.
Definition at line 55 of file SolutionInvalidity.C.
Referenced by FEProblemBase::acceptInvalidSolution(), and hasInvalidSolution().
bool SolutionInvalidity::hasInvalidSolutionWarning | ( | ) | const |
Whether or not an invalid solution was encountered that was a warning.
This must be called after a sync.
Definition at line 48 of file SolutionInvalidity.C.
Referenced by hasInvalidSolution().
void SolutionInvalidity::print | ( | const ConsoleStream & | console | ) | const |
Print the summary table of Solution Invalid warnings.
console | The output stream to output to |
Definition at line 120 of file SolutionInvalidity.C.
void SolutionInvalidity::printDebug | ( | InvalidSolutionID | _invalid_solution_id | ) | const |
Immediately print the section and message for debug purpose.
Definition at line 206 of file SolutionInvalidity.C.
Referenced by SolutionInvalidInterface::flagInvalidSolutionInternal().
void SolutionInvalidity::printHistory | ( | const ConsoleStream & | console, |
unsigned int & | timestep_interval_size | ||
) | const |
Print the time history table of Solution Invalid warnings.
console | The output stream to output to |
Definition at line 127 of file SolutionInvalidity.C.
Referenced by SolutionInvalidityOutput::output().
void SolutionInvalidity::resetSolutionInvalidCurrentIteration | ( | ) |
Reset the number of solution invalid occurrences back to zero.
Definition at line 68 of file SolutionInvalidity.C.
Referenced by NonlinearSystemBase::jacobianSetup(), and NonlinearSystemBase::residualSetup().
void SolutionInvalidity::resetSolutionInvalidTimeStep | ( | ) |
Reset the number of solution invalid occurrences back to zero for the current time step.
Definition at line 76 of file SolutionInvalidity.C.
Referenced by NonlinearSystem::solve().
void SolutionInvalidity::solutionInvalidAccumulation | ( | ) |
Pass the number of solution invalid occurrences from current iteration to cumulative counters.
Definition at line 86 of file SolutionInvalidity.C.
Referenced by NonlinearSystemBase::computeJacobianInternal(), LinearSystem::computeLinearSystemInternal(), and NonlinearSystemBase::computeResidualInternal().
Pass the number of solution invalid occurrences from current iteration to cumulative time iteration counters.
Definition at line 93 of file SolutionInvalidity.C.
Referenced by NonlinearSystem::solve().
|
private |
Build a VariadicTable for solution invalidity.
Definition at line 213 of file SolutionInvalidity.C.
Referenced by print().
void SolutionInvalidity::syncIteration | ( | ) |
Sync iteration counts to main processor.
Definition at line 135 of file SolutionInvalidity.C.
Referenced by SolverSystem::checkInvalidSolution(), NonlinearSystemBase::computeJacobianInternal(), LinearSystem::computeLinearSystemInternal(), NonlinearSystemBase::computeResidualInternal(), dataStore(), and SolutionInvalidityOutput::shouldOutput().
|
private |
Build a VariadicTable for solution invalidity history.
Definition at line 257 of file SolutionInvalidity.C.
Referenced by printHistory().
|
friend |
Definition at line 377 of file SolutionInvalidity.C.
|
friend |
Definition at line 348 of file SolutionInvalidity.C.
|
inherited |
An instance of helper class to write streams to the Console objects.
Definition at line 31 of file ConsoleStreamInterface.h.
Referenced by IterationAdaptiveDT::acceptStep(), MeshOnlyAction::act(), SetupDebugAction::act(), MaterialOutputAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), PerfGraph::addToExecutionList(), SimplePredictor::apply(), SystemBase::applyScalingFactors(), MultiApp::backup(), FEProblemBase::backupMultiApps(), CoarsenedPiecewiseLinear::buildCoarsenedGrid(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), MeshDiagnosticsGenerator::checkElementVolumes(), FEProblemBase::checkExceptionAndStopSolve(), SolverSystem::checkInvalidSolution(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonMatchingEdges(), MeshDiagnosticsGenerator::checkNonPlanarSides(), FEProblemBase::checkProblemIntegrity(), ReferenceResidualConvergence::checkRelativeConvergence(), MeshDiagnosticsGenerator::checkSidesetsOrientation(), MeshDiagnosticsGenerator::checkWatertightNodesets(), MeshDiagnosticsGenerator::checkWatertightSidesets(), IterationAdaptiveDT::computeAdaptiveDT(), TransientBase::computeConstrainedDT(), DefaultMultiAppFixedPointConvergence::computeCustomConvergencePostprocessor(), NonlinearSystemBase::computeDamping(), FixedPointIterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInitialDT(), IterationAdaptiveDT::computeInterpolationDT(), LinearSystem::computeLinearSystemTags(), FEProblemBase::computeLinearSystemTags(), NonlinearSystemBase::computeScaling(), Problem::console(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), MultiApp::createApp(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MFEMSteady::execute(), MessageFromInput::execute(), SteadyBase::execute(), Eigenvalue::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MeshGeneratorSystem::executeMeshGenerators(), ElementQualityChecker::finalize(), FEProblemBase::finishMultiAppStep(), MeshRepairGenerator::fixOverlappingNodes(), CoarsenBlockGenerator::generate(), MeshGenerator::generateInternal(), VariableCondensationPreconditioner::getDofToCondense(), InversePowerMethod::init(), NonlinearEigen::init(), FEProblemBase::initialAdaptMesh(), DefaultMultiAppFixedPointConvergence::initialize(), EigenExecutionerBase::inversePowerIteration(), FEProblemBase::joinAndFinalize(), TransientBase::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), FEProblemBase::logAdd(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseBaseErrorInterface::mooseDeprecated(), MooseBaseErrorInterface::mooseInfo(), MooseBaseErrorInterface::mooseWarning(), MooseBaseErrorInterface::mooseWarningNonPrefixed(), ReferenceResidualConvergence::nonlinearConvergenceSetup(), ReporterDebugOutput::output(), PerfGraphOutput::output(), SolutionInvalidityOutput::output(), MaterialPropertyDebugOutput::output(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), PseudoTimestep::outputPseudoTimestep(), Console::outputReporters(), DefaultMultiAppFixedPointConvergence::outputResidualNorm(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), AB2PredictorCorrector::postSolve(), ActionWarehouse::printActionDependencySets(), BlockRestrictionDebugOutput::printBlockRestrictionMap(), printDebug(), EigenExecutionerBase::printEigenvalue(), SecantSolve::printFixedPointConvergenceHistory(), SteffensenSolve::printFixedPointConvergenceHistory(), PicardSolve::printFixedPointConvergenceHistory(), FixedPointSolve::printFixedPointConvergenceReason(), PerfGraphLivePrint::printLiveMessage(), MaterialPropertyDebugOutput::printMaterialMap(), PerfGraphLivePrint::printStats(), NEML2Action::printSummary(), AutomaticMortarGeneration::projectPrimaryNodesSinglePair(), AutomaticMortarGeneration::projectSecondaryNodesSinglePair(), CoarsenBlockGenerator::recursiveCoarsen(), SolutionTimeAdaptiveDT::rejectStep(), MultiApp::restore(), FEProblemBase::restoreMultiApps(), FEProblemBase::restoreSolutions(), NonlinearSystemBase::setInitialSolution(), MooseApp::setupOptions(), Checkpoint::shouldOutput(), SubProblem::showFunctorRequestors(), SubProblem::showFunctors(), FullSolveMultiApp::showStatusMessage(), FEProblemSolve::solve(), FixedPointSolve::solve(), EigenProblem::solve(), NonlinearSystem::solve(), LinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), LStableDirk4::solve(), AStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), FixedPointSolve::solveStep(), PerfGraphLivePrint::start(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), TransientBase::takeStep(), TerminateChainControl::terminate(), Convergence::verboseOutput(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().
|
private |
Store the solution invalidity counts.
Definition at line 156 of file SolutionInvalidity.h.
Referenced by computeTotalCounts(), counts(), dataLoad(), dataStore(), flagInvalidSolutionInternal(), resetSolutionInvalidCurrentIteration(), resetSolutionInvalidTimeStep(), solutionInvalidAccumulation(), solutionInvalidAccumulationTimeStep(), summaryTable(), syncIteration(), and transientTable().
|
private |
Whether or not we have an invalid solution (only after a sync)
Definition at line 163 of file SolutionInvalidity.h.
Referenced by hasInvalidSolutionError(), and syncIteration().
|
private |
Whether or not we have a warning (only after a sync)
Definition at line 161 of file SolutionInvalidity.h.
Referenced by hasInvalidSolutionWarning(), and syncIteration().
|
private |
Whether or not we've synced (can check counts/existance of warnings or errors)
Definition at line 159 of file SolutionInvalidity.h.
Referenced by computeTotalCounts(), hasInvalidSolutionError(), hasInvalidSolutionWarning(), resetSolutionInvalidTimeStep(), summaryTable(), syncIteration(), and transientTable().
|
mutableprivate |
Mutex for locking access to the invalid counts TODO: These can be changed to shared_mutexes.
Definition at line 135 of file SolutionInvalidity.h.
Referenced by flagInvalidSolutionInternal().
|
private |
Create a registry to keep track of the names and occurrences of the solution invalidity.
Definition at line 153 of file SolutionInvalidity.h.
Referenced by dataLoad(), dataStore(), printDebug(), summaryTable(), syncIteration(), and transientTable().