[bugfix] Fixed imcrementing the cell centroid.
Imcrementation should be done at the end of the loop body as otherwise the first cell is skipped and we are out of bounds for the last iteration. This patch move the increment to the correct location.
This commit is contained in:
parent
9cd515cb91
commit
45edfc8848
@ -39,7 +39,6 @@ tpfa_htrans_compute(const Grid* G, const double *perm, double *htrans)
|
||||
|
||||
for (int c =0, i = 0; c < numCells(*G); c++) {
|
||||
K = perm + (c * d * d);
|
||||
cc = increment(cc, 1, d);
|
||||
|
||||
typedef typename Cell2FacesTraits<Grid>::Type::row_type FaceRow;
|
||||
FaceRow faces = c2f[c];
|
||||
@ -67,6 +66,8 @@ tpfa_htrans_compute(const Grid* G, const double *perm, double *htrans)
|
||||
htrans[i] /= denom;
|
||||
htrans[i] = fabs(htrans[i]);
|
||||
}
|
||||
// Move to next cell centroid.
|
||||
cc = increment(cc, 1, d);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user