|
DOLFINx 0.12.0.0
DOLFINx C++
|
PETSc error handling helpers shared across DOLFINx's PETSc wrappers. More...
Functions | |
| void | error (PetscErrorCode error_code, std::string_view petsc_function, std::source_location loc=std::source_location::current()) |
| Print error message for a PETSc call that returned an error and throw a std::runtime_error. | |
| void | check (PetscErrorCode ierr, std::string_view petsc_function, std::source_location loc=std::source_location::current()) |
| Throw a std::runtime_error via error() if ierr indicates a PETSc call failed. | |
| void | set_option (std::string option) |
| Set a PETSc option in the PETSc options/parameter database. The option must not be prefixed by '-', e.g. | |
| template<typename T> requires requires(const T& value) { std::format("{}", value); } | |
| void | set_option (std::string option, const T &value) |
| Set a PETSc option that takes a value in the PETSc options/parameter database. The option must not be prefixed by '-', e.g. | |
| void | clear_option (std::string option) |
| Clear a PETSc option from the PETSc options/parameter database. | |
| void | clear_options () |
| Clear the PETSc global options/parameter database. | |
PETSc error handling helpers shared across DOLFINx's PETSc wrappers.
|
inline |
Throw a std::runtime_error via error() if ierr indicates a PETSc call failed.
| [in] | ierr | PETSc error code returned by petsc_function |
| [in] | petsc_function | Name of the PETSc function that returned ierr |
| [in] | loc | Call site of the failed PETSc call (captured automatically; do not pass explicitly) |
| void error | ( | PetscErrorCode | error_code, |
| std::string_view | petsc_function, | ||
| std::source_location | loc = std::source_location::current() ) |
Print error message for a PETSc call that returned an error and throw a std::runtime_error.
| [in] | error_code | PETSc error code |
| [in] | petsc_function | Name of the PETSc function that returned error_code |
| [in] | loc | Call site of the failed PETSc call (captured automatically; do not pass explicitly) |
| void set_option | ( | std::string | option | ) |
Set a PETSc option in the PETSc options/parameter database. The option must not be prefixed by '-', e.g.
common::petsc::set_option("mat_mumps_icntl_14", 40);
| void set_option | ( | std::string | option, |
| const T & | value ) |
Set a PETSc option that takes a value in the PETSc options/parameter database. The option must not be prefixed by '-', e.g.
common::petsc::set_option("mat_mumps_icntl_14", 40);