-----------------------------------------------------------------------------
| 33 | |
| 34 | //----------------------------------------------------------------------------- |
| 35 | void la::petsc::error(PetscErrorCode error_code, const std::string& filename, |
| 36 | const std::string& petsc_function) |
| 37 | { |
| 38 | // Fetch PETSc error description |
| 39 | const char* desc; |
| 40 | PetscErrorMessage(error_code, &desc, nullptr); |
| 41 | |
| 42 | // Log detailed error info |
| 43 | spdlog::info("PETSc error in '{}', '{}'", filename.c_str(), |
| 44 | petsc_function.c_str()); |
| 45 | spdlog::info("PETSc error code '{}' '{}'", static_cast<int>(error_code), |
| 46 | desc); |
| 47 | throw std::runtime_error("Failed to successfully call PETSc function '" |
| 48 | + petsc_function + "'. PETSc error code is: " |
| 49 | + std ::to_string(error_code) + ", " |
| 50 | + std::string(desc)); |
| 51 | } |
| 52 | //----------------------------------------------------------------------------- |
| 53 | std::vector<Vec> |
| 54 | la::petsc::create_vectors(MPI_Comm comm, |
nothing calls this directly
no outgoing calls
no test coverage detected