...
 
Commits (3)
......@@ -192,8 +192,8 @@ public:
<< "\tGhost levels:\t" << getGhostLevels() << "\n"
<< "\tGhost cells count:\t" << localMesh.template getGhostEntitiesCount< Mesh::getMeshDimension() >() << "\n"
<< "\tGhost vertices count:\t" << localMesh.template getGhostEntitiesCount< 0 >() << "\n"
<< "\tBoundary cells count:\t" << localMesh.template getBoundaryEntitiesCount< Mesh::getMeshDimension() >() << "\n"
<< "\tBoundary vertices count:\t" << localMesh.template getBoundaryEntitiesCount< 0 >() << "\n";
<< "\tBoundary cells count:\t" << localMesh.template getBoundaryIndices< Mesh::getMeshDimension() >().getSize() << "\n"
<< "\tBoundary vertices count:\t" << localMesh.template getBoundaryIndices< 0 >().getSize() << "\n";
const GlobalIndexType globalPointIndices = getGlobalIndices< 0 >().getSize();
const GlobalIndexType globalCellIndices = getGlobalIndices< Mesh::getMeshDimension() >().getSize();
if( getGhostLevels() > 0 ) {
......
......@@ -175,6 +175,62 @@ class Mesh
GlobalIndexType getCellNeighborIndex( const GlobalIndexType cellIndex, const LocalIndexType neighborIndex ) const;
/**
* \brief Execute function \e f in parallel for all mesh entities with dimension \e EntityDimension.
*
* The function \e f is executed as `f(i)`, where `GlobalIndexType i` is the global index of the
* mesh entity to be processed. The mesh itself is not passed to the function `f`, it is the user's
* responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture
* and/or using a \ref SharedPointer.
*/
template< int EntityDimension, typename Device2 = DeviceType, typename Func >
void forAll( Func f ) const;
/**
* \brief Execute function \e f in parallel for all boundary mesh entities with dimension \e EntityDimension.
*
* The function \e f is executed as `f(i)`, where `GlobalIndexType i` is the global index of the
* mesh entity to be processed. The mesh itself is not passed to the function `f`, it is the user's
* responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture
* and/or using a \ref SharedPointer.
*/
template< int EntityDimension, typename Device2 = DeviceType, typename Func >
void forBoundary( Func f ) const;
/**
* \brief Execute function \e f in parallel for all interior mesh entities with dimension \e EntityDimension.
*
* The function \e f is executed as `f(i)`, where `GlobalIndexType i` is the global index of the
* mesh entity to be processed. The mesh itself is not passed to the function `f`, it is the user's
* responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture
* and/or using a \ref SharedPointer.
*/
template< int EntityDimension, typename Device2 = DeviceType, typename Func >
void forInterior( Func f ) const;
/**
* \brief Execute function \e f in parallel for all local mesh entities with dimension \e EntityDimension.
*
* The function \e f is executed as `f(i)`, where `GlobalIndexType i` is the global index of the
* mesh entity to be processed. The mesh itself is not passed to the function `f`, it is the user's
* responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture
* and/or using a \ref SharedPointer.
*/
template< int EntityDimension, typename Device2 = DeviceType, typename Func >
void forLocal( Func f ) const;
/**
* \brief Execute function \e f in parallel for all ghost mesh entities with dimension \e EntityDimension.
*
* The function \e f is executed as `f(i)`, where `GlobalIndexType i` is the global index of the
* mesh entity to be processed. The mesh itself is not passed to the function `f`, it is the user's
* responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture
* and/or using a \ref SharedPointer.
*/
template< int EntityDimension, typename Device2 = DeviceType, typename Func >
void forGhost( Func f ) const;
/*
* The permutations follow the definition used in the Metis library: Let M
* be the original mesh and M' the permuted mesh. Then entity with index i
......@@ -201,11 +257,6 @@ class Mesh
void writeProlog( Logger& logger ) const;
DistributedMeshes::DistributedMesh< Mesh<MeshConfig,Device> >* getDistributedMesh(void) const
{
return nullptr;
}
protected:
// Methods for the mesh initializer
using StorageBaseType::getPoints;
......
......@@ -239,6 +239,68 @@ getCellNeighborIndex( const GlobalIndexType cellIndex, const LocalIndexType neig
}
template< typename MeshConfig, typename Device >
template< int EntityDimension, typename Device2, typename Func >
void
Mesh< MeshConfig, Device >::
forAll( Func f ) const
{
const GlobalIndexType entitiesCount = getEntitiesCount< EntityDimension >();
Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, entitiesCount, f );
}
template< typename MeshConfig, typename Device >
template< int EntityDimension, typename Device2, typename Func >
void
Mesh< MeshConfig, Device >::
forBoundary( Func f ) const
{
const auto boundaryIndices = this->template getBoundaryIndices< EntityDimension >();
const GlobalIndexType entitiesCount = boundaryIndices.getSize();
auto wrapper = [f, boundaryIndices] __cuda_callable__ ( const GlobalIndexType i ) mutable
{
f( boundaryIndices[ i ] );
};
Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, entitiesCount, wrapper );
}
template< typename MeshConfig, typename Device >
template< int EntityDimension, typename Device2, typename Func >
void
Mesh< MeshConfig, Device >::
forInterior( Func f ) const
{
const auto interiorIndices = this->template getInteriorIndices< EntityDimension >();
const GlobalIndexType entitiesCount = interiorIndices.getSize();
auto wrapper = [f, interiorIndices] __cuda_callable__ ( const GlobalIndexType i ) mutable
{
f( interiorIndices[ i ] );
};
Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, entitiesCount, wrapper );
}
template< typename MeshConfig, typename Device >
template< int EntityDimension, typename Device2, typename Func >
void
Mesh< MeshConfig, Device >::
forLocal( Func f ) const
{
const GlobalIndexType ghostsOffset = this->template getGhostEntitiesOffset< EntityDimension >();
Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, ghostsOffset, f );
}
template< typename MeshConfig, typename Device >
template< int EntityDimension, typename Device2, typename Func >
void
Mesh< MeshConfig, Device >::
forGhost( Func f ) const
{
const GlobalIndexType ghostsOffset = this->template getGhostEntitiesOffset< EntityDimension >();
const GlobalIndexType entitiesCount = this->template getEntitiesCount< EntityDimension >();
Algorithms::ParallelFor< DeviceType >::exec( ghostsOffset, entitiesCount, f );
}
template< typename MeshConfig, typename Device >
template< int Dimension >
void
......
......@@ -178,27 +178,15 @@ public:
}
__cuda_callable__
GlobalIndexType getBoundaryEntitiesCount( DimensionTag ) const
auto getBoundaryIndices( DimensionTag ) const
{
return boundaryIndices.getSize();
return boundaryIndices.getConstView();
}
__cuda_callable__
GlobalIndexType getBoundaryEntityIndex( DimensionTag, const GlobalIndexType& i ) const
auto getInteriorIndices( DimensionTag ) const
{
return boundaryIndices[ i ];
}
__cuda_callable__
GlobalIndexType getInteriorEntitiesCount( DimensionTag ) const
{
return interiorIndices.getSize();
}
__cuda_callable__
GlobalIndexType getInteriorEntityIndex( DimensionTag, const GlobalIndexType& i ) const
{
return interiorIndices[ i ];
return interiorIndices.getConstView();
}
__cuda_callable__
......@@ -287,10 +275,8 @@ protected:
void isBoundaryEntity( DimensionTag, const GlobalIndexType& ) const {}
void isGhostEntity( DimensionTag, const GlobalIndexType& ) const {}
void updateEntityTagsLayer( DimensionTag ) {}
void getBoundaryEntitiesCount( DimensionTag ) const {}
void getBoundaryEntityIndex( DimensionTag, const GlobalIndexType& i ) const {}
void getInteriorEntitiesCount( DimensionTag ) const {}
void getInteriorEntityIndex( DimensionTag, const GlobalIndexType& i ) const {}
void getBoundaryIndices( DimensionTag ) const {}
void getInteriorIndices( DimensionTag ) const {}
void getGhostEntitiesCount() const;
void getGhostEntitiesOffset() const;
......
......@@ -35,10 +35,8 @@ protected:
using LayerType::isBoundaryEntity;
using LayerType::isGhostEntity;
using LayerType::updateEntityTagsLayer;
using LayerType::getBoundaryEntitiesCount;
using LayerType::getBoundaryEntityIndex;
using LayerType::getInteriorEntitiesCount;
using LayerType::getInteriorEntityIndex;
using LayerType::getBoundaryIndices;
using LayerType::getInteriorIndices;
using LayerType::getGhostEntitiesCount;
using LayerType::getGhostEntitiesOffset;
......@@ -50,10 +48,8 @@ protected:
using BaseType::isBoundaryEntity;
using BaseType::isGhostEntity;
using BaseType::updateEntityTagsLayer;
using BaseType::getBoundaryEntitiesCount;
using BaseType::getBoundaryEntityIndex;
using BaseType::getInteriorEntitiesCount;
using BaseType::getInteriorEntityIndex;
using BaseType::getBoundaryIndices;
using BaseType::getInteriorIndices;
using BaseType::getGhostEntitiesCount;
using BaseType::getGhostEntitiesOffset;
......@@ -124,10 +120,8 @@ protected:
void isBoundaryEntity() const;
void isGhostEntity() const;
void updateEntityTagsLayer();
void getBoundaryEntitiesCount() const;
void getBoundaryEntityIndex() const;
void getInteriorEntitiesCount() const;
void getInteriorEntityIndex() const;
void getBoundaryIndices() const;
void getInteriorIndices() const;
void getGhostEntitiesCount() const;
void getGhostEntitiesOffset() const;
......@@ -216,34 +210,18 @@ public:
template< int Dimension >
__cuda_callable__
GlobalIndexType getBoundaryEntitiesCount() const
auto getBoundaryIndices() const
{
static_assert( WeakTrait< Dimension >::entityTagsEnabled, "You try to access entity tags which are not configured for storage." );
return BaseType::getBoundaryEntitiesCount( DimensionTag< Dimension >() );
return BaseType::getBoundaryIndices( DimensionTag< Dimension >() );
}
template< int Dimension >
__cuda_callable__
GlobalIndexType getBoundaryEntityIndex( const GlobalIndexType& i ) const
auto getInteriorIndices() const
{
static_assert( WeakTrait< Dimension >::entityTagsEnabled, "You try to access entity tags which are not configured for storage." );
return BaseType::getBoundaryEntityIndex( DimensionTag< Dimension >(), i );
}
template< int Dimension >
__cuda_callable__
GlobalIndexType getInteriorEntitiesCount() const
{
static_assert( WeakTrait< Dimension >::entityTagsEnabled, "You try to access entity tags which are not configured for storage." );
return BaseType::getInteriorEntitiesCount( DimensionTag< Dimension >() );
}
template< int Dimension >
__cuda_callable__
GlobalIndexType getInteriorEntityIndex( const GlobalIndexType& i ) const
{
static_assert( WeakTrait< Dimension >::entityTagsEnabled, "You try to access entity tags which are not configured for storage." );
return BaseType::getInteriorEntityIndex( DimensionTag< Dimension >(), i );
return BaseType::getInteriorIndices( DimensionTag< Dimension >() );
}
template< int Dimension >
......
......@@ -26,13 +26,14 @@ Traverser< Mesh, MeshEntity, EntitiesDimension >::
processBoundaryEntities( const MeshPointer& meshPointer,
UserData userData ) const
{
const GlobalIndexType entitiesCount = meshPointer->template getBoundaryEntitiesCount< MeshEntity::getEntityDimension() >();
auto kernel = [] __cuda_callable__
const auto boundaryIndices = meshPointer->template getBoundaryIndices< MeshEntity::getEntityDimension() >();
const GlobalIndexType entitiesCount = boundaryIndices.getSize();
auto kernel = [boundaryIndices] __cuda_callable__
( const GlobalIndexType i,
const Mesh* mesh,
UserData userData )
{
const GlobalIndexType entityIndex = mesh->template getBoundaryEntityIndex< MeshEntity::getEntityDimension() >( i );
const GlobalIndexType entityIndex = boundaryIndices[ i ];
const auto entity = mesh->template getEntity< MeshEntity::getEntityDimension() >( entityIndex );
EntitiesProcessor::processEntity( *mesh, userData, entity );
};
......@@ -54,13 +55,14 @@ Traverser< Mesh, MeshEntity, EntitiesDimension >::
processInteriorEntities( const MeshPointer& meshPointer,
UserData userData ) const
{
const auto entitiesCount = meshPointer->template getInteriorEntitiesCount< MeshEntity::getEntityDimension() >();
auto kernel = [] __cuda_callable__
const auto interiorIndices = meshPointer->template getInteriorIndices< MeshEntity::getEntityDimension() >();
const GlobalIndexType entitiesCount = interiorIndices.getSize();
auto kernel = [interiorIndices] __cuda_callable__
( const GlobalIndexType i,
const Mesh* mesh,
UserData userData )
{
const GlobalIndexType entityIndex = mesh->template getInteriorEntityIndex< MeshEntity::getEntityDimension() >( i );
const GlobalIndexType entityIndex = interiorIndices[ i ];
const auto entity = mesh->template getEntity< MeshEntity::getEntityDimension() >( entityIndex );
EntitiesProcessor::processEntity( *mesh, userData, entity );
};
......@@ -82,7 +84,7 @@ Traverser< Mesh, MeshEntity, EntitiesDimension >::
processAllEntities( const MeshPointer& meshPointer,
UserData userData ) const
{
const auto entitiesCount = meshPointer->template getEntitiesCount< MeshEntity::getEntityDimension() >();
const GlobalIndexType entitiesCount = meshPointer->template getEntitiesCount< MeshEntity::getEntityDimension() >();
auto kernel = [] __cuda_callable__
( const GlobalIndexType entityIndex,
const Mesh* mesh,
......@@ -109,8 +111,8 @@ Traverser< Mesh, MeshEntity, EntitiesDimension >::
processGhostEntities( const MeshPointer& meshPointer,
UserData userData ) const
{
const auto ghostsOffset = meshPointer->template getGhostEntitiesOffset< MeshEntity::getEntityDimension() >();
const auto entitiesCount = meshPointer->template getEntitiesCount< MeshEntity::getEntityDimension() >();
const GlobalIndexType ghostsOffset = meshPointer->template getGhostEntitiesOffset< MeshEntity::getEntityDimension() >();
const GlobalIndexType entitiesCount = meshPointer->template getEntitiesCount< MeshEntity::getEntityDimension() >();
auto kernel = [] __cuda_callable__
( const GlobalIndexType entityIndex,
const Mesh* mesh,
......@@ -137,7 +139,7 @@ Traverser< Mesh, MeshEntity, EntitiesDimension >::
processLocalEntities( const MeshPointer& meshPointer,
UserData userData ) const
{
const auto ghostsOffset = meshPointer->template getGhostEntitiesOffset< MeshEntity::getEntityDimension() >();
const GlobalIndexType ghostsOffset = meshPointer->template getGhostEntitiesOffset< MeshEntity::getEntityDimension() >();
auto kernel = [] __cuda_callable__
( const GlobalIndexType entityIndex,
const Mesh* mesh,
......
......@@ -177,7 +177,6 @@ bool testDistributedMesh( const Mesh& mesh )
MyMeshFunction f_in( localMesh ), f_out( localMesh );
f_in.getData().setValue( 0 );
const Index entitiesCount = localMesh.template getEntitiesCount< MyMeshFunction::getEntitiesDimension() >();
const Index pointsCount = localMesh.template getEntitiesCount< 0 >();
const Index cellsCount = localMesh.template getEntitiesCount< Mesh::getMeshDimension() >();
......@@ -285,6 +284,12 @@ bool testDistributedMesh( const Mesh& mesh )
// write initial state
make_snapshot( 0 );
// captures for the iteration kernel
const auto f_in_view = f_in.getData().getConstView();
auto f_out_view = f_out.getData().getView();
Pointers::DevicePointer< const LocalMesh > localMeshDevicePointer( localMesh );
const LocalMesh* localMeshPointer = &localMeshDevicePointer.template getData< typename LocalMesh::DeviceType >();
bool all_done = false;
Index iteration = 0;
do {
......@@ -292,41 +297,39 @@ bool testDistributedMesh( const Mesh& mesh )
if( CommunicatorType::GetRank() == 0 )
std::cout << "Computing iteration " << iteration << "..." << std::endl;
// traverse the mesh
for( Index i = 0; i < entitiesCount; i++ ) {
// end on the first ghost entity
// TODO: the mesh should allow iteration over local entities only
if( localMesh.template isGhostEntity< MyMeshFunction::getEntitiesDimension() >( i ) )
break;
// iterate over all local entities
auto kernel = [f_in_view, f_out_view, localMeshPointer] __cuda_callable__ ( Index i ) mutable
{
// sum values of the function on the neighbor entities
Real sum = 0;
for( Index n = 0; n < localMesh.getCellNeighborsCount( i ); n++ ) {
const Index neighbor = localMesh.getCellNeighborIndex( i, n );
sum += f_in.getData()[ neighbor ];
for( Index n = 0; n < localMeshPointer->getCellNeighborsCount( i ); n++ ) {
const Index neighbor = localMeshPointer->getCellNeighborIndex( i, n );
sum += f_in_view[ neighbor ];
}
const bool live = f_in.getData()[ i ];
const bool live = f_in_view[ i ];
// Conway's rules for square grid
if( live ) {
// any live cell with less than two live neighbors dies
if( sum < 2 )
f_out.getData()[ i ] = 0;
f_out_view[ i ] = 0;
// any live cell with two or three live neighbors survives
else if( sum < 4 )
f_out.getData()[ i ] = 1;
f_out_view[ i ] = 1;
// any live cell with more than three live neighbors dies
else
f_out.getData()[ i ] = 0;
f_out_view[ i ] = 0;
}
else {
// any dead cell with exactly three live neighbors becomes a live cell
if( sum == 3 )
f_out.getData()[ i ] = 1;
f_out_view[ i ] = 1;
// any other dead cell remains dead
else
f_out.getData()[ i ] = 0;
f_out_view[ i ] = 0;
}
}
};
localMesh.template forLocal< MyMeshFunction::getEntitiesDimension() >( kernel );
// synchronize
sync.synchronize( f_out );
......
......@@ -470,6 +470,37 @@ void testTraverserOnDevice( const MeshType& mesh,
EXPECT_EQ( array_all, expected_array_all );
EXPECT_EQ( array_ghost, expected_array_ghost );
EXPECT_EQ( array_local, expected_array_local );
// test iteration methods: forAll, forBoundary, forInterior
array_boundary.setValue( 0 );
array_interior.setValue( 0 );
array_all .setValue( 0 );
array_ghost .setValue( 0 );
array_local .setValue( 0 );
auto view_boundary = array_boundary.getView();
auto view_interior = array_interior.getView();
auto view_all = array_all.getView();
auto view_ghost = array_ghost.getView();
auto view_local = array_local.getView();
auto f_boundary = [view_boundary] __cuda_callable__ ( typename MeshType::GlobalIndexType i ) mutable { view_boundary[i] += 1; };
auto f_interior = [view_interior] __cuda_callable__ ( typename MeshType::GlobalIndexType i ) mutable { view_interior[i] += 1; };
auto f_all = [view_all] __cuda_callable__ ( typename MeshType::GlobalIndexType i ) mutable { view_all[i] += 1; };
auto f_ghost = [view_ghost] __cuda_callable__ ( typename MeshType::GlobalIndexType i ) mutable { view_ghost[i] += 1; };
auto f_local = [view_local] __cuda_callable__ ( typename MeshType::GlobalIndexType i ) mutable { view_local[i] += 1; };
meshPointer->template forBoundary< EntityType::getEntityDimension() >( f_boundary );
meshPointer->template forInterior< EntityType::getEntityDimension() >( f_interior );
meshPointer->template forAll < EntityType::getEntityDimension() >( f_all );
meshPointer->template forGhost < EntityType::getEntityDimension() >( f_ghost );
meshPointer->template forLocal < EntityType::getEntityDimension() >( f_local );
EXPECT_EQ( array_boundary, expected_array_boundary );
EXPECT_EQ( array_interior, expected_array_interior );
EXPECT_EQ( array_all, expected_array_all );
EXPECT_EQ( array_ghost, expected_array_ghost );
EXPECT_EQ( array_local, expected_array_local );
}
template< typename Mesh >
......
......@@ -84,16 +84,16 @@ TEST( MeshTest, RegularMeshOfQuadrilateralsTest )
std::vector< IndexType > interiorCells = {4, 7};
// Test boundary cells
EXPECT_EQ( mesh.template getBoundaryEntitiesCount< 2 >(), (int) boundaryCells.size() );
EXPECT_EQ( mesh.template getBoundaryIndices< 2 >().getSize(), (int) boundaryCells.size() );
for( size_t i = 0; i < boundaryCells.size(); i++ ) {
EXPECT_TRUE( mesh.template isBoundaryEntity< 2 >( boundaryCells[ i ] ) );
EXPECT_EQ( mesh.template getBoundaryEntityIndex< 2 >( i ), boundaryCells[ i ] );
EXPECT_EQ( mesh.template getBoundaryIndices< 2 >()[ i ], boundaryCells[ i ] );
}
// Test interior cells
EXPECT_EQ( mesh.template getInteriorEntitiesCount< 2 >(), (int) interiorCells.size() );
EXPECT_EQ( mesh.template getInteriorIndices< 2 >().getSize(), (int) interiorCells.size() );
for( size_t i = 0; i < interiorCells.size(); i++ ) {
EXPECT_FALSE( mesh.template isBoundaryEntity< 2 >( interiorCells[ i ] ) );
EXPECT_EQ( mesh.template getInteriorEntityIndex< 2 >( i ), interiorCells[ i ] );
EXPECT_EQ( mesh.template getInteriorIndices< 2 >()[ i ], interiorCells[ i ] );
}
// Test setting other tags
......@@ -116,16 +116,16 @@ TEST( MeshTest, RegularMeshOfQuadrilateralsTest )
std::vector< IndexType > interiorFaces = {1, 2, 5, 6, 9, 10, 11, 13, 14, 16, 17, 18, 20, 21, 23, 24, 27};
// Test boundary faces
EXPECT_EQ( mesh.template getBoundaryEntitiesCount< 1 >(), (int) boundaryFaces.size() );
EXPECT_EQ( mesh.template getBoundaryIndices< 1 >().getSize(), (int) boundaryFaces.size() );
for( size_t i = 0; i < boundaryFaces.size(); i++ ) {
EXPECT_TRUE( mesh.template isBoundaryEntity< 1 >( boundaryFaces[ i ] ) );
EXPECT_EQ( mesh.template getBoundaryEntityIndex< 1 >( i ), boundaryFaces[ i ] );
EXPECT_EQ( mesh.template getBoundaryIndices< 1 >()[ i ], boundaryFaces[ i ] );
}
// Test interior faces
EXPECT_EQ( mesh.template getInteriorEntitiesCount< 1 >(), (int) interiorFaces.size() );
EXPECT_EQ( mesh.template getInteriorIndices< 1 >().getSize(), (int) interiorFaces.size() );
for( size_t i = 0; i < interiorFaces.size(); i++ ) {
EXPECT_FALSE( mesh.template isBoundaryEntity< 1 >( interiorFaces[ i ] ) );
EXPECT_EQ( mesh.template getInteriorEntityIndex< 1 >( i ), interiorFaces[ i ] );
EXPECT_EQ( mesh.template getInteriorIndices< 1 >()[ i ], interiorFaces[ i ] );
}
// Test setting other tags
......
......@@ -204,18 +204,18 @@ void testMesh( const Mesh< TestTriangleMeshConfig, Devices::Host >& mesh,
// test boundary tags
const std::vector< int > boundaryFaces = {1, 2, 3, 4};
const std::vector< int > interiorFaces = {0};
EXPECT_EQ( mesh.template getBoundaryEntitiesCount< 1 >(), (int) boundaryFaces.size() );
EXPECT_EQ( mesh.template getBoundaryIndices< 1 >().getSize(), (int) boundaryFaces.size() );
for( size_t i = 0; i < boundaryFaces.size(); i++ ) {
EXPECT_TRUE( mesh.template isBoundaryEntity< 1 >( edgePermutation[ boundaryFaces[ i ] ] ) );
// boundary indices are always sorted so we can't test this
// EXPECT_EQ( mesh.template getBoundaryEntityIndex< 1 >( i ), edgePermutation[ boundaryFaces[ i ] ] );
// EXPECT_EQ( mesh.template getBoundaryIndices< 1 >()[ i ], edgePermutation[ boundaryFaces[ i ] ] );
}
// Test interior faces
EXPECT_EQ( mesh.template getInteriorEntitiesCount< 1 >(), (int) interiorFaces.size() );
EXPECT_EQ( mesh.template getInteriorIndices< 1 >().getSize(), (int) interiorFaces.size() );
for( size_t i = 0; i < interiorFaces.size(); i++ ) {
EXPECT_FALSE( mesh.template isBoundaryEntity< 1 >( edgePermutation[ interiorFaces[ i ] ] ) );
// boundary indices are always sorted so we can't test this
// EXPECT_EQ( mesh.template getInteriorEntityIndex< 1 >( i ), edgePermutation[ interiorFaces[ i ] ] );
// EXPECT_EQ( mesh.template getInteriorIndices< 1 >()[ i ], edgePermutation[ interiorFaces[ i ] ] );
}
// tests for the dual graph layer
......
This diff is collapsed.