Skip to content

Commit

Permalink
Preallocate for diagonal entry in adjacency matrix (for ordering).
Browse files Browse the repository at this point in the history
  • Loading branch information
jedbrown committed Apr 26, 2011
1 parent fe0834b commit 98144c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fs/impls/cont/cont.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static dErr dMeshPopulateOrderedSet_Private(dMesh mesh,dMeshESH orderedSet,dMesh
for (dInt i=0; i<ents_s; i++) {
dInt cnt = 0;
for (dInt j=adjoff[i]; j<adjoff[i+1]; j++) cnt += (ordering[j] >= 0);
nnz[i] = cnt;
nnz[i] = cnt + 1; // The 1 is for the diagonal
}
/* Create matrix for number of owned entities */
err = MatCreateSeqAIJ(PETSC_COMM_SELF,ents_s,ents_s,0,nnz,&madj);dCHK(err);
Expand Down

0 comments on commit 98144c5

Please sign in to comment.