Skip to content
Snippets Groups Projects
Commit 7d009faf authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed GlobalIndexType and LocalIndexType from the public interface of MeshEntityTraits

parent ec4fa43c
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 50 deletions
......@@ -60,15 +60,15 @@ public:
}
template< int Subdimension >
static constexpr typename SubentityTraits< Subdimension >::LocalIndexType getSubentitiesCount()
static constexpr typename MeshTraitsType::LocalIndexType getSubentitiesCount()
{
return SubentityTraits< Subdimension >::count;
}
template< int Subdimension >
__cuda_callable__
void setSubentityIndex( const typename SubentityTraits< Subdimension >::LocalIndexType& localIndex,
const typename SubentityTraits< Subdimension >::GlobalIndexType& globalIndex )
void setSubentityIndex( const typename MeshTraitsType::LocalIndexType& localIndex,
const typename MeshTraitsType::GlobalIndexType& globalIndex )
{
static_assert( SubentityTraits< Subdimension >::storageEnabled, "You try to set subentity which is not configured for storage." );
BaseType::setSubentityIndex( Meshes::DimensionTag< Subdimension >(),
......@@ -78,8 +78,8 @@ public:
template< int Subdimension >
__cuda_callable__
typename SubentityTraits< Subdimension >::GlobalIndexType
getSubentityIndex( const typename SubentityTraits< Subdimension >::LocalIndexType localIndex ) const
typename MeshTraitsType::GlobalIndexType
getSubentityIndex( const typename MeshTraitsType::LocalIndexType localIndex ) const
{
static_assert( SubentityTraits< Subdimension >::storageEnabled, "You try to get subentity which is not configured for storage." );
return BaseType::getSubentityIndex( Meshes::DimensionTag< Subdimension >(),
......@@ -96,7 +96,7 @@ public:
template< int Subdimension >
__cuda_callable__
typename SubentityTraits< Subdimension >::IdPermutationArrayType getSubentityOrientation( typename SubentityTraits< Subdimension >::LocalIndexType index ) const
typename SubentityTraits< Subdimension >::IdPermutationArrayType getSubentityOrientation( typename MeshTraitsType::LocalIndexType index ) const
{
static_assert( SubentityTraits< Subdimension >::orientationEnabled, "You try to get subentity orientation which is not configured for storage." );
return BaseType::getSubentityOrientation( Meshes::DimensionTag< Subdimension >(), index );
......@@ -139,8 +139,8 @@ class SubentityAccessLayer< MeshConfig,
using SubentityTraitsType = typename MeshTraitsType::template SubentityTraits< EntityTopology, DimensionTag::value >;
protected:
using GlobalIndexType = typename SubentityTraitsType::GlobalIndexType;
using LocalIndexType = typename SubentityTraitsType::LocalIndexType;
using GlobalIndexType = typename MeshTraitsType::GlobalIndexType;
using LocalIndexType = typename MeshTraitsType::LocalIndexType;
using SubentityAccessorType = typename SubentityTraitsType::SubentityAccessorType;
using OrientationArrayType = typename SubentityTraitsType::OrientationArrayType;
using IdPermutationArrayType = typename SubentityTraitsType::IdPermutationArrayType;
......@@ -263,8 +263,8 @@ class SubentityAccessLayer< MeshConfig,
using SubentityTraitsType = typename MeshTraitsType::template SubentityTraits< EntityTopology, DimensionTag::value >;
protected:
using GlobalIndexType = typename SubentityTraitsType::GlobalIndexType;
using LocalIndexType = typename SubentityTraitsType::LocalIndexType;
using GlobalIndexType = typename MeshTraitsType::GlobalIndexType;
using LocalIndexType = typename MeshTraitsType::LocalIndexType;
using SubentityAccessorType = typename SubentityTraitsType::SubentityAccessorType;
SubentityAccessLayer() = default;
......@@ -360,6 +360,9 @@ class SubentityAccessLayer< MeshConfig,
using DimensionTag = Meshes::DimensionTag< EntityTopology::dimension >;
protected:
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
using LocalIndexType = typename MeshConfig::LocalIndexType;
/***
* Necessary because of 'using BaseType::...;' in the derived classes
*/
......@@ -368,11 +371,9 @@ protected:
void bindSubentitiesStorageNetwork( DimensionTag,
const SubentityAccessorType& storage ) {}
void getSubentitiesCount( DimensionTag ) const {}
template< typename LocalIndexType >
__cuda_callable__
void getSubentityIndex( DimensionTag,
const LocalIndexType localIndex ) const {}
template< typename LocalIndexType, typename GlobalIndexType >
__cuda_callable__
void setSubentityIndex( DimensionTag,
const LocalIndexType& localIndex,
......@@ -407,6 +408,9 @@ class SubentityAccessLayer< MeshConfig,
false >
{
protected:
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
using LocalIndexType = typename MeshConfig::LocalIndexType;
/***
* Necessary because of 'using BaseType::...;' in the derived classes
*/
......@@ -416,11 +420,9 @@ protected:
const SubentityAccessorType& storage ) {}
__cuda_callable__
void getSubentitiesCount( DimensionTag ) const {}
template< typename LocalIndexType >
__cuda_callable__
void getSubentityIndex( DimensionTag,
const LocalIndexType localIndex ) const {}
template< typename LocalIndexType, typename GlobalIndexType >
__cuda_callable__
void setSubentityIndex( DimensionTag,
const LocalIndexType& localIndex,
......
......@@ -61,7 +61,7 @@ public:
template< int Superdimension >
__cuda_callable__
void setNumberOfSuperentities( const typename SuperentityTraits< Superdimension >::LocalIndexType size )
void setNumberOfSuperentities( const typename MeshTraitsType::LocalIndexType size )
{
static_assert( SuperentityTraits< Superdimension >::storageEnabled, "You try to set number of superentities which are not configured for storage." );
BaseType::setNumberOfSuperentities( Meshes::DimensionTag< Superdimension >(),
......@@ -70,7 +70,7 @@ public:
template< int Superdimension >
__cuda_callable__
typename SuperentityTraits< Superdimension >::LocalIndexType
typename MeshTraitsType::LocalIndexType
getSuperentitiesCount() const
{
static_assert( SuperentityTraits< Superdimension >::storageEnabled, "You try to get number of superentities which are not configured for storage." );
......@@ -80,8 +80,8 @@ public:
template< int Superdimension >
__cuda_callable__
void
setSuperentityIndex( const typename SuperentityTraits< Superdimension >::LocalIndexType& localIndex,
const typename SuperentityTraits< Superdimension >::GlobalIndexType& globalIndex )
setSuperentityIndex( const typename MeshTraitsType::LocalIndexType& localIndex,
const typename MeshTraitsType::GlobalIndexType& globalIndex )
{
static_assert( SuperentityTraits< Superdimension >::storageEnabled, "You try to set superentities which are not configured for storage." );
BaseType::setSuperentityIndex( Meshes::DimensionTag< Superdimension >(),
......@@ -91,8 +91,8 @@ public:
template< int Superdimension >
__cuda_callable__
typename SuperentityTraits< Superdimension >::GlobalIndexType
getSuperentityIndex( const typename SuperentityTraits< Superdimension >::LocalIndexType localIndex ) const
typename MeshTraitsType::GlobalIndexType
getSuperentityIndex( const typename MeshTraitsType::LocalIndexType localIndex ) const
{
static_assert( SuperentityTraits< Superdimension >::storageEnabled, "You try to get superentities which are not configured for storage." );
return BaseType::getSuperentityIndex( Meshes::DimensionTag< Superdimension >(),
......@@ -127,8 +127,8 @@ class SuperentityAccessLayer< MeshConfig,
using SuperentityTraitsType = typename MeshTraitsType::template SuperentityTraits< EntityTopology, DimensionTag::value >;
public:
using GlobalIndexType = typename SuperentityTraitsType::GlobalIndexType;
using LocalIndexType = typename SuperentityTraitsType::LocalIndexType;
using GlobalIndexType = typename MeshTraitsType::GlobalIndexType;
using LocalIndexType = typename MeshTraitsType::LocalIndexType;
using SuperentityAccessorType = typename SuperentityTraitsType::SuperentityAccessorType;
/****
......@@ -249,8 +249,8 @@ class SuperentityAccessLayer< MeshConfig,
using DimensionTag = Meshes::DimensionTag< EntityTopology::dimension >;
protected:
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
using LocalIndexType = typename MeshConfig::LocalIndexType;
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
using LocalIndexType = typename MeshConfig::LocalIndexType;
/***
* Necessary because of 'using BaseType::...;' in the derived classes
......
......@@ -47,7 +47,7 @@ public:
protected:
template< int Dimension >
void setEntitiesCount( const typename EntityTraits< Dimension >::GlobalIndexType& entitiesCount )
void setEntitiesCount( const typename MeshTraitsType::GlobalIndexType& entitiesCount )
{
static_assert( EntityTraits< Dimension >::storageEnabled, "You try to set number of entities which are not configured for storage." );
BaseType::setEntitiesCount( DimensionTag< Dimension >(), entitiesCount );
......@@ -97,9 +97,9 @@ class StorageLayer< MeshConfig,
public:
using BaseType = StorageLayer< MeshConfig, Device, typename DimensionTag::Increment >;
using MeshTraitsType = MeshTraits< MeshConfig, Device >;
using GlobalIndexType = typename MeshTraitsType::GlobalIndexType;
using EntityTraitsType = typename MeshTraitsType::template EntityTraits< DimensionTag::value >;
using StorageArrayType = typename EntityTraitsType::StorageArrayType;
using GlobalIndexType = typename EntityTraitsType::GlobalIndexType;
using EntityType = typename EntityTraitsType::EntityType;
using EntityTopology = typename EntityTraitsType::EntityTopology;
using SubentityStorageBaseType = SubentityStorageLayerFamily< MeshConfig, Device, EntityTopology >;
......
......@@ -71,8 +71,7 @@ class SubentityStorageLayer< MeshConfig,
using SubentityTraitsType = typename MeshTraitsType::template SubentityTraits< EntityTopology, SubdimensionTag::value >;
protected:
using GlobalIndexType = typename SubentityTraitsType::GlobalIndexType;
using LocalIndexType = typename SubentityTraitsType::LocalIndexType;
using GlobalIndexType = typename MeshTraitsType::GlobalIndexType;
using StorageNetworkType = typename SubentityTraitsType::StorageNetworkType;
SubentityStorageLayer() = default;
......
......@@ -73,7 +73,7 @@ class SuperentityStorageLayer< MeshConfig, Device, EntityTopology, Superdimensio
using SuperentityTraitsType = typename MeshTraitsType::template SuperentityTraits< EntityTopology, SuperdimensionTag::value >;
protected:
using GlobalIndexType = typename SuperentityTraitsType::GlobalIndexType;
using GlobalIndexType = typename MeshTraitsType::GlobalIndexType;
using StorageNetworkType = typename SuperentityTraitsType::StorageNetworkType;
SuperentityStorageLayer() = default;
......
......@@ -127,10 +127,10 @@ class EntityInitializerLayer< MeshConfig,
using InitializerType = Initializer< MeshConfig >;
using MeshType = typename InitializerType::MeshType;
using GlobalIndexType = typename MeshTraits< MeshConfig >::GlobalIndexType;
using LocalIndexType = typename MeshTraits< MeshConfig >::LocalIndexType;
using SuperentityTraitsType = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
using SuperentityTopology = typename SuperentityTraitsType::EntityTopology;
using GlobalIndexType = typename SuperentityTraitsType::GlobalIndexType;
using LocalIndexType = typename SuperentityTraitsType::LocalIndexType;
using SubentitySeedsCreatorType = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
using SuperentityInitializerType = SuperentityStorageInitializer< MeshConfig, SubdimensionTag, SuperdimensionTag >;
......@@ -187,10 +187,10 @@ class EntityInitializerLayer< MeshConfig,
using InitializerType = Initializer< MeshConfig >;
using MeshType = typename InitializerType::MeshType;
using GlobalIndexType = typename MeshTraits< MeshConfig >::GlobalIndexType;
using LocalIndexType = typename MeshTraits< MeshConfig >::LocalIndexType;
using SuperentityTraitsType = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
using SuperentityTopology = typename SuperentityTraitsType::EntityTopology;
using GlobalIndexType = typename SuperentityTraitsType::GlobalIndexType;
using LocalIndexType = typename SuperentityTraitsType::LocalIndexType;
using SubentitySeedsCreatorType = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
using SuperentityInitializerType = SuperentityStorageInitializer< MeshConfig, SubdimensionTag, SuperdimensionTag >;
......@@ -251,10 +251,10 @@ class EntityInitializerLayer< MeshConfig,
using InitializerType = Initializer< MeshConfig >;
using MeshType = typename InitializerType::MeshType;
using GlobalIndexType = typename MeshTraits< MeshConfig >::GlobalIndexType;
using LocalIndexType = typename MeshTraits< MeshConfig >::LocalIndexType;
using SuperentityTraitsType = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
using SuperentityTopology = typename SuperentityTraitsType::EntityTopology;
using GlobalIndexType = typename SuperentityTraitsType::GlobalIndexType;
using LocalIndexType = typename SuperentityTraitsType::LocalIndexType;
using SubentitySeedsCreatorType = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
public:
......@@ -309,10 +309,10 @@ class EntityInitializerLayer< MeshConfig,
using InitializerType = Initializer< MeshConfig >;
using MeshType = typename InitializerType::MeshType;
using GlobalIndexType = typename MeshTraits< MeshConfig >::GlobalIndexType;
using LocalIndexType = typename MeshTraits< MeshConfig >::LocalIndexType;
using SuperentityTraitsType = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
using SuperentityTopology = typename SuperentityTraitsType::EntityTopology;
using GlobalIndexType = typename SuperentityTraitsType::GlobalIndexType;
using LocalIndexType = typename SuperentityTraitsType::LocalIndexType;
using SubentitySeedsCreatorType = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
public:
......@@ -363,10 +363,10 @@ class EntityInitializerLayer< MeshConfig,
using InitializerType = Initializer< MeshConfig >;
using MeshType = typename InitializerType::MeshType;
using GlobalIndexType = typename MeshTraits< MeshConfig >::GlobalIndexType;
using LocalIndexType = typename MeshTraits< MeshConfig >::LocalIndexType;
using SuperentityTraitsType = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
using SuperentityTopology = typename SuperentityTraitsType::EntityTopology;
using GlobalIndexType = typename SuperentityTraitsType::GlobalIndexType;
using LocalIndexType = typename SuperentityTraitsType::LocalIndexType;
using SubentitySeedsCreatorType = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
using SuperentityInitializerType = SuperentityStorageInitializer< MeshConfig, SubdimensionTag, SuperdimensionTag >;
......
......@@ -70,13 +70,12 @@ template< typename MeshConfig,
int Dimension >
class MeshEntityTraits
{
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
public:
static_assert( 0 <= Dimension && Dimension <= MeshConfig::meshDimension, "invalid dimension" );
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
using LocalIndexType = typename MeshConfig::LocalIndexType;
using EntityTopology = typename EntityTopologyGetter< MeshConfig, DimensionTag< Dimension > >::Topology;
using EntityType = MeshEntity< MeshConfig, Device, EntityTopology >;
using SeedType = EntitySeed< MeshConfig, EntityTopology >;
using ReferenceOrientationType = MeshEntityReferenceOrientation< MeshConfig, EntityTopology >;
......
......@@ -36,6 +36,9 @@ template< typename MeshConfig,
int Dimension >
class MeshSubentityTraits
{
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
using LocalIndexType = typename MeshConfig::LocalIndexType;
public:
static_assert( 0 <= Dimension && Dimension <= MeshConfig::meshDimension, "invalid dimension" );
static_assert( EntityTopology::dimension > Dimension, "Subentity dimension must be smaller than the entity dimension." );
......@@ -44,8 +47,6 @@ public:
static constexpr bool orientationEnabled = MeshConfig::subentityOrientationStorage( EntityTopology(), Dimension );
static constexpr int count = Topologies::Subtopology< EntityTopology, Dimension >::count;
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
using LocalIndexType = typename MeshConfig::LocalIndexType;
using SubentityTopology = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityTopology;
using SubentityType = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityType;
using Seed = EntitySeed< MeshConfig, SubentityTopology >;
......
......@@ -29,14 +29,15 @@ template< typename MeshConfig,
int Dimension >
class MeshSuperentityTraits
{
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
using LocalIndexType = typename MeshConfig::LocalIndexType;
public:
static_assert( 0 <= Dimension && Dimension <= MeshConfig::meshDimension, "invalid dimension" );
static_assert( EntityTopology::dimension < Dimension, "Superentity dimension must be higher than the entity dimension." );
static constexpr bool storageEnabled = MeshConfig::template superentityStorage< EntityTopology >( EntityTopology(), Dimension );
using GlobalIndexType = typename MeshConfig::GlobalIndexType;
using LocalIndexType = typename MeshConfig::LocalIndexType;
using SuperentityTopology = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityTopology;
using SuperentityType = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityType;
......
......@@ -176,7 +176,7 @@ public:
return false;
getline( inputFile, line );
iss.str( line );
typedef typename MeshType::MeshTraitsType::template EntityTraits< 0 >::GlobalIndexType VertexIndexType;
typedef typename MeshType::Config::GlobalIndexType VertexIndexType;
VertexIndexType pointsCount;
iss >> pointsCount;
meshBuilder.setPointsCount( pointsCount );
......
......@@ -247,7 +247,7 @@ TEST( MeshOrderingTest, OrderingOnHost )
MeshHost mesh;
ASSERT_TRUE( buildTriangleMesh( mesh ) );
using PermutationVector = typename MeshHost::IndexPermutationVector;
using PermutationVector = typename MeshHost::GlobalIndexVector;
PermutationVector vertexIdentity, edgeIdentity, cellIdentity,
vertexPermutation, edgePermutation, cellPermutation,
vertexInversePermutation, edgeInversePermutation, cellInversePermutation;
......@@ -282,7 +282,7 @@ TEST( MeshOrderingTest, OrderingOnCuda )
ASSERT_TRUE( buildTriangleMesh( meshHost ) );
mesh = meshHost;
using PermutationCuda = typename MeshCuda::IndexPermutationVector;
using PermutationCuda = typename MeshCuda::GlobalIndexVector;
PermutationCuda vertexIdentity, edgeIdentity, cellIdentity,
vertexPermutation, edgePermutation, cellPermutation,
vertexInversePermutation, edgeInversePermutation, cellInversePermutation;
......@@ -303,7 +303,7 @@ TEST( MeshOrderingTest, OrderingOnCuda )
// test is on host
{
// local scope so we can use the same names
using PermutationVector = typename MeshHost::IndexPermutationVector;
using PermutationVector = typename MeshHost::GlobalIndexVector;
PermutationVector vertexIdentity, edgeIdentity, cellIdentity,
vertexPermutation, edgePermutation, cellPermutation,
vertexInversePermutation, edgeInversePermutation, cellInversePermutation;
......
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