MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / error

Method error

cpp/dolfinx/la/petsc.cpp:35–51  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

33
34//-----------------------------------------------------------------------------
35void 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//-----------------------------------------------------------------------------
53std::vector<Vec>
54la::petsc::create_vectors(MPI_Comm comm,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected