Skip the pointer arithmetic.
Bard was right that the iterator_range returns the underlying native pointers. Therefore can write the computation much more natural.
This commit is contained in:
parent
1b6bbb035e
commit
9cf21d87ee
@ -66,7 +66,7 @@ double faceArea(const UnstructuredGrid& grid, int face_index)
|
|||||||
int faceTag(const UnstructuredGrid& grid,
|
int faceTag(const UnstructuredGrid& grid,
|
||||||
boost::iterator_range<const int*>::const_iterator face)
|
boost::iterator_range<const int*>::const_iterator face)
|
||||||
{
|
{
|
||||||
return grid.cell_facetag[&(*face)-&(*(cell2Faces(grid)[0].begin()))];
|
return grid.cell_facetag[face-cell2Faces(grid)[0].begin()];
|
||||||
}
|
}
|
||||||
|
|
||||||
SparseTableView cell2Faces(const UnstructuredGrid& grid)
|
SparseTableView cell2Faces(const UnstructuredGrid& grid)
|
||||||
|
Loading…
Reference in New Issue
Block a user