Commit 3b1a4264 authored by Yury Hayeu's avatar Yury Hayeu Committed by Tomáš Oberhuber
Browse files

Fix geometry functions for new grid entity

parent 93b61dfc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,10 +15,10 @@ namespace TNL {
namespace Meshes {

// compatibility wrapper
template< typename Grid, int EntityDimension, typename Config >
template< typename Grid, int EntityDimension >
__cuda_callable__
typename Grid::PointType
getEntityCenter( const Grid& grid, const GridEntity< Grid, EntityDimension, Config >& entity )
getEntityCenter( const Grid& grid, const GridEntity< Grid, EntityDimension >& entity )
{
   return entity.getCenter();
}
+3 −3
Original line number Diff line number Diff line
@@ -25,10 +25,10 @@
namespace TNL {
namespace Meshes {

template< typename Grid, typename Config >
template< typename Grid >
__cuda_callable__
typename Grid::RealType
getEntityMeasure( const Grid& grid, const GridEntity< Grid, 0, Config >& entity )
getEntityMeasure( const Grid& grid, const GridEntity< Grid, 0 >& entity )
{
   // entity.getMeasure() returns 0.0 !!!
   return 1.0;
@@ -37,7 +37,7 @@ getEntityMeasure( const Grid& grid, const GridEntity< Grid, 0, Config >& entity
template< typename Grid, int EntityDimension, typename Config >
__cuda_callable__
typename Grid::RealType
getEntityMeasure( const Grid& grid, const GridEntity< Grid, EntityDimension, Config >& entity )
getEntityMeasure( const Grid& grid, const GridEntity< Grid, EntityDimension >& entity )
{
   return entity.getMeasure();
}
+6 −6
Original line number Diff line number Diff line
@@ -12,10 +12,10 @@
namespace TNL {
namespace Meshes {

template< typename Grid, typename Config >
template< typename Grid >
__cuda_callable__
typename Grid::PointType
getOutwardNormalVector( const Grid& grid, const GridEntity< Grid, 0, Config >& face, const typename Grid::PointType cellCenter )
getOutwardNormalVector( const Grid& grid, const GridEntity< Grid, 0 >& face, const typename Grid::PointType cellCenter )
{
   static_assert( Grid::getMeshDimension() == 1, "getOutwardNormalVector can be used only with faces." );
   const typename Grid::PointType faceCenter = getEntityCenter( grid, face );
@@ -25,10 +25,10 @@ getOutwardNormalVector( const Grid& grid, const GridEntity< Grid, 0, Config >& f
      return { -1 };
}

template< typename Grid, typename Config >
template< typename Grid >
__cuda_callable__
typename Grid::PointType
getOutwardNormalVector( const Grid& grid, const GridEntity< Grid, 1, Config >& face, const typename Grid::PointType cellCenter )
getOutwardNormalVector( const Grid& grid, const GridEntity< Grid, 1 >& face, const typename Grid::PointType cellCenter )
{
   static_assert( Grid::getMeshDimension() == 2, "getOutwardNormalVector can be used only with faces." );
   const typename Grid::PointType faceCenter = getEntityCenter( grid, face );
@@ -48,10 +48,10 @@ getOutwardNormalVector( const Grid& grid, const GridEntity< Grid, 1, Config >& f
   }
}

template< typename Grid, typename Config >
template< typename Grid >
__cuda_callable__
typename Grid::PointType
getOutwardNormalVector( const Grid& grid, const GridEntity< Grid, 2, Config >& face, const typename Grid::PointType cellCenter )
getOutwardNormalVector( const Grid& grid, const GridEntity< Grid, 2 >& face, const typename Grid::PointType cellCenter )
{
   static_assert( Grid::getMeshDimension() == 3, "getOutwardNormalVector can be used only with faces." );
   const typename Grid::PointType faceCenter = getEntityCenter( grid, face );