Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions include/bout/petsc_interface.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,27 @@
#include <type_traits>
#include <vector>

#include <bout/array.hxx>
#include <bout/assert.hxx>
#include <bout/bout_types.hxx>
#include <bout/boutcomm.hxx>
#include <bout/boutexception.hxx>
#include <bout/globalindexer.hxx>
#include <bout/mesh.hxx>
#include <bout/openmpwrap.hxx>
#include <bout/operatorstencil.hxx>
#include <bout/paralleltransform.hxx>
#include <bout/petsclib.hxx>
#include <bout/region.hxx>
#include <bout/traits.hxx>

#include <petscmat.h>
#include <petscsys.h>
#include <petscsystypes.h>
#include <petscvec.h>
#include <petscversion.h>

#include <utility>

/*!
* A class which wraps PETSc vector objects, allowing them to be
Expand Down Expand Up @@ -394,7 +403,6 @@ public:

private:
void setValues(BoutReal val, InsertMode mode) {
TRACE("PetscMatrix setting values at ({}, {})", petscRow, petscCol);
ASSERT3(positions.size() > 0);
std::vector<PetscScalar> values;
std::transform(weights.begin(), weights.end(), std::back_inserter(values),
Expand All @@ -405,7 +413,8 @@ public:
status = MatSetValues(*petscMatrix, 1, &petscRow, positions.size(),
positions.data(), values.data(), mode);
if (status != 0) {
throw BoutException("Error when setting elements of a PETSc matrix.");
throw BoutException("Error when setting elements of a PETSc matrix at ({}, {})",
petscRow, petscCol);
}
}
Mat* petscMatrix;
Expand Down
Loading
Loading