Newer
Older
const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< -2, 0 >();
const RealType& hySquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, -2 >();
const IndexType& center = entity.getIndex();
const IndexType& east = neighborEntities.template getEntityIndex< 1, 0 >();
const IndexType& west = neighborEntities.template getEntityIndex< -1, 0 >();
const IndexType& north = neighborEntities.template getEntityIndex< 0, 1 >();
const IndexType& south = neighborEntities.template getEntityIndex< 0, -1 >();
return ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) * hxSquareInverse +
( u[ south ] - 2.0 * u[ center ] + u[ north ] ) * hySquareInverse;