Skip to content
Open
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
2 changes: 1 addition & 1 deletion include/bout/petsc_operators.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ private:
const UniqueMat temp{new Mat{nullptr}};
BOUT_DO_PETSC(MatCreate(BoutComm::get(), temp.get()));
BOUT_DO_PETSC(MatSetType(*temp, MATMPIAIJ));
BOUT_DO_PETSC(MatSetSizes(*temp, out_mapping->localSize(), PETSC_DECIDE,
BOUT_DO_PETSC(MatSetSizes(*temp, out_mapping->localSize(), in_mapping->localSize(),
out_mapping->globalSize(), in_mapping->globalSize()));

PetscInt col_start{0};
Expand Down
8 changes: 4 additions & 4 deletions src/mesh/petsc_operators.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

PetscIndexMapping::~PetscIndexMapping() {
if (mat_stored_to_petsc != nullptr) {
MatDestroy(&mat_stored_to_petsc);
BOUT_DO_PETSC(MatDestroy(&mat_stored_to_petsc));
}
if (mat_petsc_to_stored != nullptr) {
MatDestroy(&mat_petsc_to_stored);
BOUT_DO_PETSC(MatDestroy(&mat_petsc_to_stored));
}
}

Expand Down Expand Up @@ -176,7 +176,7 @@ Field3D toField3D(const PetscCellVector& vec, const Field3D& prototype) {

Field3D PetscOperators::meshGetField3D(Mesh* mesh, const std::string& name) {
Field3D result;
if (mesh->get(result, name) != 0) {
if (mesh->get(result, name, 0.0, false) != 0) {
throw BoutException("PetscOperators requires field '{}'", name);
}
return result;
Expand Down Expand Up @@ -450,7 +450,7 @@ PetscCellOperator makeNeumannOperator(const PetscCellMappingPtr& mapping,
bout::petsc::UniqueMat temp{new Mat{nullptr}};
BOUT_DO_PETSC(MatCreate(BoutComm::get(), temp.get()));
BOUT_DO_PETSC(MatSetType(*temp, MATMPIAIJ));
BOUT_DO_PETSC(MatSetSizes(*temp, n_local, PETSC_DECIDE, n_global, n_global));
BOUT_DO_PETSC(MatSetSizes(*temp, n_local, n_local, n_global, n_global));
BOUT_DO_PETSC(MatMPIAIJSetPreallocation(*temp, 1, nullptr, 1, nullptr));

const PetscScalar one = 1.0;
Expand Down
Loading