Skip to content
Snippets Groups Projects
Commit f2ca01b8 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by Lars Bilke
Browse files

[MaL] Petsc; Assert non-negative indices in DirBC

Negative indices mean ghost nodes for which the nodes
owning partition is responsible.
Might be helpful when implementing new BCs.
parent 5c09e5cb
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,16 @@ void applyKnownSolution(PETScMatrix& A, PETScVector& b, PETScVector& x,
{
A.finalizeAssembly();
#ifndef NDEBUG
if (std::any_of(vec_knownX_id.begin(), vec_knownX_id.end(),
[](PetscInt const i) { return i < 0; }))
{
OGS_FATAL(
"Found negative indices in the vector of Dirichlet boundary "
"conditions.");
}
#endif // NDEBUG
A.setRowsColumnsZero(vec_knownX_id);
A.finalizeAssembly();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment