OGS
NumLib::AssemblyException Struct Reference

Detailed Description

Thrown by a local assembler that cannot compute its contribution, e.g., because a local nonlinear solver did not converge.

This is not a fatal error for the Picard and the Newton nonlinear solver of NumLib::NonlinearSolver. Both catch it, abort the current nonlinear iteration and report the time step as not converged, so that the time stepping algorithm may repeat the step with a smaller time step size.

Todo
NumLib::PETScNonlinearSolver does not handle it. There the assembly runs inside a callback called by PETSc's SNESSolve(), out of which a C++ exception cannot be thrown, so a process using the PETScSNES nonlinear solver still ends the run.

The exception must be thrown either on all MPI ranks or on none of them. Ranks that continue while another one aborts run into the collective calls of the linear solve, and the simulation deadlocks instead of failing. Assemblers based on ProcessLib::AssemblyMixin get that behaviour from BaseLib::MPI::allRanksThrowOrNone(); a hand-written assembler has to establish it itself.

Definition at line 31 of file Exceptions.h.

#include <Exceptions.h>

Inheritance diagram for NumLib::AssemblyException:
[legend]
Collaboration diagram for NumLib::AssemblyException:
[legend]

Public Member Functions

 AssemblyException (std::string const &reason)

Constructor & Destructor Documentation

◆ AssemblyException()

NumLib::AssemblyException::AssemblyException ( std::string const & reason)
inlineexplicit

Definition at line 33 of file Exceptions.h.

34 : std::runtime_error{"Error in process' assembly: " + reason} {};

The documentation for this struct was generated from the following file: