Skip to content
Snippets Groups Projects
Commit ac827a18 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing tnl-quickstart.

parent 75704c85
No related branches found
No related tags found
No related merge requests found
const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< -2 >(); const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< -2 >();
const IndexType& center = entity.getIndex(); const IndexType& center = entity.getIndex();
const IndexType& east = neighbourEntities.template getEntityIndex< 1 >(); const IndexType& east = neighborEntities.template getEntityIndex< 1 >();
const IndexType& west = neighbourEntities.template getEntityIndex< -1 >(); const IndexType& west = neighborEntities.template getEntityIndex< -1 >();
return ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) * hxSquareInverse; return ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) * hxSquareInverse;
\ No newline at end of file
const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< -2, 0 >(); const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< -2, 0 >();
const RealType& hySquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, -2 >(); const RealType& hySquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, -2 >();
const IndexType& center = entity.getIndex(); const IndexType& center = entity.getIndex();
const IndexType& east = neighbourEntities.template getEntityIndex< 1, 0 >(); const IndexType& east = neighborEntities.template getEntityIndex< 1, 0 >();
const IndexType& west = neighbourEntities.template getEntityIndex< -1, 0 >(); const IndexType& west = neighborEntities.template getEntityIndex< -1, 0 >();
const IndexType& north = neighbourEntities.template getEntityIndex< 0, 1 >(); const IndexType& north = neighborEntities.template getEntityIndex< 0, 1 >();
const IndexType& south = neighbourEntities.template getEntityIndex< 0, -1 >(); const IndexType& south = neighborEntities.template getEntityIndex< 0, -1 >();
return ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) * hxSquareInverse + return ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) * hxSquareInverse +
( u[ south ] - 2.0 * u[ center ] + u[ north ] ) * hySquareInverse; ( u[ south ] - 2.0 * u[ center ] + u[ north ] ) * hySquareInverse;
\ No newline at end of file
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
const RealType& hySquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, -2, 0 >(); const RealType& hySquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, -2, 0 >();
const RealType& hzSquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, 0, -2 >(); const RealType& hzSquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, 0, -2 >();
const IndexType& center = entity.getIndex(); const IndexType& center = entity.getIndex();
const IndexType& east = neighbourEntities.template getEntityIndex< 1, 0, 0 >(); const IndexType& east = neighborEntities.template getEntityIndex< 1, 0, 0 >();
const IndexType& west = neighbourEntities.template getEntityIndex< -1, 0, 0 >(); const IndexType& west = neighborEntities.template getEntityIndex< -1, 0, 0 >();
const IndexType& north = neighbourEntities.template getEntityIndex< 0, 1, 0 >(); const IndexType& north = neighborEntities.template getEntityIndex< 0, 1, 0 >();
const IndexType& south = neighbourEntities.template getEntityIndex< 0, -1, 0 >(); const IndexType& south = neighborEntities.template getEntityIndex< 0, -1, 0 >();
const IndexType& up = neighbourEntities.template getEntityIndex< 0, 0, 1 >(); const IndexType& up = neighborEntities.template getEntityIndex< 0, 0, 1 >();
const IndexType& down = neighbourEntities.template getEntityIndex< 0, 0, -1 >(); const IndexType& down = neighborEntities.template getEntityIndex< 0, 0, -1 >();
return ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) * hxSquareInverse + return ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) * hxSquareInverse +
( u[ south ] - 2.0 * u[ center ] + u[ north ] ) * hySquareInverse + ( u[ south ] - 2.0 * u[ center ] + u[ north ] ) * hySquareInverse +
( u[ up ] - 2.0 * u[ center ] + u[ down ] ) * hzSquareInverse; ( u[ up ] - 2.0 * u[ center ] + u[ down ] ) * hzSquareInverse;
\ No newline at end of file
const RealType& lambdaX = tau * entity.getMesh().template getSpaceStepsProducts< -2 >(); const RealType& lambdaX = tau * entity.getMesh().template getSpaceStepsProducts< -2 >();
const IndexType& center = entity.getIndex(); const IndexType& center = entity.getIndex();
const IndexType& east = neighbourEntities.template getEntityIndex< 1 >(); const IndexType& east = neighborEntities.template getEntityIndex< 1 >();
const IndexType& west = neighbourEntities.template getEntityIndex< -1 >(); const IndexType& west = neighborEntities.template getEntityIndex< -1 >();
matrixRow.setElement( 0, west, - lambdaX ); matrixRow.setElement( 0, west, - lambdaX );
matrixRow.setElement( 1, center, 2.0 * lambdaX ); matrixRow.setElement( 1, center, 2.0 * lambdaX );
matrixRow.setElement( 2, east, - lambdaX ); matrixRow.setElement( 2, east, - lambdaX );
\ No newline at end of file
const RealType& lambdaX = tau * entity.getMesh().template getSpaceStepsProducts< -2, 0 >(); const RealType& lambdaX = tau * entity.getMesh().template getSpaceStepsProducts< -2, 0 >();
const RealType& lambdaY = tau * entity.getMesh().template getSpaceStepsProducts< 0, -2 >(); const RealType& lambdaY = tau * entity.getMesh().template getSpaceStepsProducts< 0, -2 >();
const IndexType& center = entity.getIndex(); const IndexType& center = entity.getIndex();
const IndexType& east = neighbourEntities.template getEntityIndex< 1, 0 >(); const IndexType& east = neighborEntities.template getEntityIndex< 1, 0 >();
const IndexType& west = neighbourEntities.template getEntityIndex< -1, 0 >(); const IndexType& west = neighborEntities.template getEntityIndex< -1, 0 >();
const IndexType& north = neighbourEntities.template getEntityIndex< 0, 1 >(); const IndexType& north = neighborEntities.template getEntityIndex< 0, 1 >();
const IndexType& south = neighbourEntities.template getEntityIndex< 0, -1 >(); const IndexType& south = neighborEntities.template getEntityIndex< 0, -1 >();
matrixRow.setElement( 0, south, -lambdaY ); matrixRow.setElement( 0, south, -lambdaY );
matrixRow.setElement( 1, west, -lambdaX ); matrixRow.setElement( 1, west, -lambdaX );
matrixRow.setElement( 2, center, 2.0 * ( lambdaX + lambdaY ) ); matrixRow.setElement( 2, center, 2.0 * ( lambdaX + lambdaY ) );
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
const RealType& lambdaY = tau * entity.getMesh().template getSpaceStepsProducts< 0, -2, 0 >(); const RealType& lambdaY = tau * entity.getMesh().template getSpaceStepsProducts< 0, -2, 0 >();
const RealType& lambdaZ = tau * entity.getMesh().template getSpaceStepsProducts< 0, 0, -2 >(); const RealType& lambdaZ = tau * entity.getMesh().template getSpaceStepsProducts< 0, 0, -2 >();
const IndexType& center = entity.getIndex(); const IndexType& center = entity.getIndex();
const IndexType& east = neighbourEntities.template getEntityIndex< 1, 0, 0 >(); const IndexType& east = neighborEntities.template getEntityIndex< 1, 0, 0 >();
const IndexType& west = neighbourEntities.template getEntityIndex< -1, 0, 0 >(); const IndexType& west = neighborEntities.template getEntityIndex< -1, 0, 0 >();
const IndexType& north = neighbourEntities.template getEntityIndex< 0, 1, 0 >(); const IndexType& north = neighborEntities.template getEntityIndex< 0, 1, 0 >();
const IndexType& south = neighbourEntities.template getEntityIndex< 0, -1, 0 >(); const IndexType& south = neighborEntities.template getEntityIndex< 0, -1, 0 >();
const IndexType& up = neighbourEntities.template getEntityIndex< 0, 0, 1 >(); const IndexType& up = neighborEntities.template getEntityIndex< 0, 0, 1 >();
const IndexType& down = neighbourEntities.template getEntityIndex< 0, 0, -1 >(); const IndexType& down = neighborEntities.template getEntityIndex< 0, 0, -1 >();
matrixRow.setElement( 0, down, -lambdaZ ); matrixRow.setElement( 0, down, -lambdaZ );
matrixRow.setElement( 1, south, -lambdaY ); matrixRow.setElement( 1, south, -lambdaY );
matrixRow.setElement( 2, west, -lambdaX ); matrixRow.setElement( 2, west, -lambdaX );
......
...@@ -36,7 +36,7 @@ operator()( const MeshFunction& u, ...@@ -36,7 +36,7 @@ operator()( const MeshFunction& u,
*/ */
static_assert( MeshEntity::entityDimension == {meshDimension}, "Wrong mesh entity dimensions." ); static_assert( MeshEntity::entityDimension == {meshDimension}, "Wrong mesh entity dimensions." );
static_assert( MeshFunction::getEntitiesDimension() == {meshDimension}, "Wrong preimage function" ); static_assert( MeshFunction::getEntitiesDimension() == {meshDimension}, "Wrong preimage function" );
const typename MeshEntity::template NeighbourEntities< {meshDimension} >& neighbourEntities = entity.getNeighbourEntities(); const typename MeshEntity::template NeighborEntities< {meshDimension} >& neighborEntities = entity.getNeighborEntities();
{explicitScheme} {explicitScheme}
}} }}
...@@ -92,7 +92,7 @@ setMatrixElements( const PreimageFunction& u, ...@@ -92,7 +92,7 @@ setMatrixElements( const PreimageFunction& u,
* The following example is the Laplace operator approximated * The following example is the Laplace operator approximated
* by the Finite difference method. * by the Finite difference method.
*/ */
const typename MeshEntity::template NeighbourEntities< {meshDimension} >& neighbourEntities = entity.getNeighbourEntities(); const typename MeshEntity::template NeighborEntities< {meshDimension} >& neighborEntities = entity.getNeighborEntities();
const IndexType& index = entity.getIndex(); const IndexType& index = entity.getIndex();
typename Matrix::MatrixRow matrixRow = matrix.getRow( index ); typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
{semiimplicitScheme} {semiimplicitScheme}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment