Skip to content

Commit

Permalink
PrescribedGradientBCWeak: Explicitly add zeros on diagonal (Required by
Browse files Browse the repository at this point in the history
PETSc).
  • Loading branch information
Erik Svenning committed Sep 1, 2016
1 parent 5508953 commit 138cc76
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/oofemlib/prescribedgradientbcweak.C
Expand Up @@ -503,6 +503,14 @@ void PrescribedGradientBCWeak :: assembleGPContrib(SparseMtrx &answer, TimeStep
contribT.clear();
contribT.beTranspositionOf(contrib);
answer.assemble(disp_cols, trac_rows, contribT);


// Assemble zeros on diagonal (required by PETSc solver)
FloatMatrix KZero(1,1);
KZero.zero();
for( int i : trac_rows) {
answer.assemble(IntArray({i}), IntArray({i}), KZero);
}
}

void PrescribedGradientBCWeak :: giveLocationArrays(std :: vector< IntArray > &rows, std :: vector< IntArray > &cols, CharType type,
Expand Down

0 comments on commit 138cc76

Please sign in to comment.