Newer
Older
const RealType& lambdaX = tau * entity.getMesh().template getSpaceStepsProducts< -2, 0 >();
const RealType& lambdaY = tau * 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 >();
matrixRow.setElement( 0, south, -lambdaY );
matrixRow.setElement( 1, west, -lambdaX );
matrixRow.setElement( 2, center, 2.0 * ( lambdaX + lambdaY ) );
matrixRow.setElement( 3, east, -lambdaX );
matrixRow.setElement( 4, north, -lambdaY );