Loading src/TNL/Meshes/Mesh.h +7 −6 Original line number Diff line number Diff line Loading @@ -23,14 +23,15 @@ #include <TNL/Meshes/MeshDetails/traits/MeshTraits.h> #include <TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h> #include <TNL/Meshes/MeshDetails/config/MeshConfigValidator.h> #include <TNL/Meshes/MeshDetails/initializer/MeshInitializer.h> #include <TNL/Meshes/MeshDetails/layers/MeshEntityStorageRebinder.h> namespace TNL { namespace Meshes { template< typename MeshConfig > //, //typename Device = Devices::Host > template< typename MeshConfig > class MeshInitializer; template< typename MeshConfig, typename Device = Devices::Host > class Mesh : public Object, protected MeshStorageLayers< MeshConfig > Loading @@ -39,7 +40,7 @@ class Mesh public: using Config = MeshConfig; using MeshTraitsType = MeshTraits< MeshConfig >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; using DeviceType = typename MeshTraitsType::DeviceType; using GlobalIndexType = typename MeshTraitsType::GlobalIndexType; using LocalIndexType = typename MeshTraitsType::LocalIndexType; Loading Loading @@ -128,8 +129,8 @@ class Mesh friend struct MeshEntityStorageRebinderWorker; }; template< typename MeshConfig > std::ostream& operator<<( std::ostream& str, const Mesh< MeshConfig >& mesh ); template< typename MeshConfig, typename Device > std::ostream& operator<<( std::ostream& str, const Mesh< MeshConfig, Device >& mesh ); } // namespace Meshes } // namespace TNL Loading src/TNL/Meshes/MeshDetails/MeshEntity_impl.h +47 −36 Original line number Diff line number Diff line Loading @@ -22,9 +22,10 @@ namespace TNL { namespace Meshes { template< typename MeshConfig, typename Device, typename EntityTopology > String MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: getType() { return String( "MeshEntity< " ) + Loading @@ -33,18 +34,20 @@ getType() } template< typename MeshConfig, typename Device, typename EntityTopology > String MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: getTypeVirtual() const { return this->getType(); } template< typename MeshConfig, typename Device, typename EntityTopology > bool MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: save( File& file ) const { if( ! MeshSubentityAccess< MeshConfig, EntityTopology >::save( file ) ) Loading @@ -53,9 +56,10 @@ save( File& file ) const } template< typename MeshConfig, typename Device, typename EntityTopology > bool MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: load( File& file ) { if( ! MeshSubentityAccess< MeshConfig, EntityTopology >::load( file ) ) Loading @@ -64,9 +68,10 @@ load( File& file ) } template< typename MeshConfig, typename Device, typename EntityTopology > void MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: print( std::ostream& str ) const { str << "\t Mesh entity dimension: " << EntityTopology::dimension << std::endl; Loading @@ -75,9 +80,10 @@ print( std::ostream& str ) const } template< typename MeshConfig, typename Device, typename EntityTopology > bool MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: operator==( const MeshEntity& entity ) const { return ( MeshSubentityAccess< MeshConfig, EntityTopology >::operator==( entity ) && Loading @@ -86,18 +92,20 @@ operator==( const MeshEntity& entity ) const } template< typename MeshConfig, typename Device, typename EntityTopology > bool MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: operator!=( const MeshEntity& entity ) const { return ! ( *this == entity ); } template< typename MeshConfig, typename Device, typename EntityTopology > constexpr int MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: getEntityDimension() { return EntityTopology::dimension; Loading @@ -107,18 +115,20 @@ getEntityDimension() * Subentities */ template< typename MeshConfig, typename Device, typename EntityTopology > constexpr typename MeshEntity< MeshConfig, EntityTopology >::LocalIndexType MeshEntity< MeshConfig, EntityTopology >:: constexpr typename MeshEntity< MeshConfig, Device, EntityTopology >::LocalIndexType MeshEntity< MeshConfig, Device, EntityTopology >:: getVerticesCount() { return SubentityTraits< 0 >::count; } template< typename MeshConfig, typename Device, typename EntityTopology > typename MeshEntity< MeshConfig, EntityTopology >::GlobalIndexType MeshEntity< MeshConfig, EntityTopology >:: typename MeshEntity< MeshConfig, Device, EntityTopology >::GlobalIndexType MeshEntity< MeshConfig, Device, EntityTopology >:: getVertexIndex( const LocalIndexType localIndex ) const { return this->template getSubentityIndex< 0 >( localIndex ); Loading @@ -128,47 +138,47 @@ getVertexIndex( const LocalIndexType localIndex ) const /**** * Vertex entity specialization */ template< typename MeshConfig > template< typename MeshConfig, typename Device > String MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: getType() { return String( "MeshEntity< ... >" ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > String MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: getTypeVirtual() const { return this->getType(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: save( File& file ) const { if( //! MeshSuperentityStorageLayers< MeshConfig, MeshVertexTopology >::save( file ) || if( //! MeshSuperentityStorageLayers< MeshConfig, Device, MeshVertexTopology >::save( file ) || ! point.save( file ) ) return false; return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: load( File& file ) { if( //! MeshSuperentityStorageLayers< MeshConfig, MeshVertexTopology >::load( file ) || if( //! MeshSuperentityStorageLayers< MeshConfig, Device, MeshVertexTopology >::load( file ) || ! point.load( file ) ) return false; return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > void MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: print( std::ostream& str ) const { str << "\t Mesh entity dimension: " << MeshVertexTopology::dimension << std::endl; Loading @@ -176,9 +186,9 @@ print( std::ostream& str ) const MeshSuperentityAccess< MeshConfig, MeshVertexTopology >::print( str ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: operator==( const MeshEntity& entity ) const { return ( MeshSuperentityAccess< MeshConfig, MeshVertexTopology >::operator==( entity ) && Loading @@ -186,41 +196,42 @@ operator==( const MeshEntity& entity ) const point == entity.point ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: operator!=( const MeshEntity& entity ) const { return ! ( *this == entity ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > constexpr int MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: getEntityDimension() { return EntityTopology::dimension; } template< typename MeshConfig > typename MeshEntity< MeshConfig, MeshVertexTopology >::PointType MeshEntity< MeshConfig, MeshVertexTopology >:: template< typename MeshConfig, typename Device > typename MeshEntity< MeshConfig, Device, MeshVertexTopology >::PointType MeshEntity< MeshConfig, Device, MeshVertexTopology >:: getPoint() const { return this->point; } template< typename MeshConfig > template< typename MeshConfig, typename Device > void MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: setPoint( const PointType& point ) { this->point = point; } template< typename MeshConfig, typename Device, typename EntityTopology > std::ostream& operator<<( std::ostream& str, const MeshEntity< MeshConfig, EntityTopology >& entity ) std::ostream& operator<<( std::ostream& str, const MeshEntity< MeshConfig, Device, EntityTopology >& entity ) { entity.print( str ); return str; Loading src/TNL/Meshes/MeshDetails/MeshWriterVTKLegacy.h +4 −4 Original line number Diff line number Diff line Loading @@ -48,10 +48,10 @@ enum tnlVTKMeshEntities { tnlVTKVertex = 1, template< typename MeshEntity > struct MeshEntityVTKType{}; template< typename MeshConfig > struct MeshEntityVTKType< MeshEntity< MeshConfig, MeshTriangleTopology > > { enum { VTKType = tnlVTKTriangle }; }; template< typename MeshConfig > struct MeshEntityVTKType< MeshEntity< MeshConfig, MeshQuadrilateralTopology > >{ enum { VTKType = tnlVTKQuad }; }; template< typename MeshConfig > struct MeshEntityVTKType< MeshEntity< MeshConfig, MeshTetrahedronTopology > > { enum { VTKType = tnlVTKTetra }; }; template< typename MeshConfig > struct MeshEntityVTKType< MeshEntity< MeshConfig, MeshHexahedronTopology > > { enum { VTKType = tnlVTKHexahedron }; }; template< typename MeshConfig, typename Device > struct MeshEntityVTKType< MeshEntity< MeshConfig, Device, MeshTriangleTopology > > { enum { VTKType = tnlVTKTriangle }; }; template< typename MeshConfig, typename Device > struct MeshEntityVTKType< MeshEntity< MeshConfig, Device, MeshQuadrilateralTopology > >{ enum { VTKType = tnlVTKQuad }; }; template< typename MeshConfig, typename Device > struct MeshEntityVTKType< MeshEntity< MeshConfig, Device, MeshTetrahedronTopology > > { enum { VTKType = tnlVTKTetra }; }; template< typename MeshConfig, typename Device > struct MeshEntityVTKType< MeshEntity< MeshConfig, Device, MeshHexahedronTopology > > { enum { VTKType = tnlVTKHexahedron }; }; class MeshWriterVTKLegacy { Loading src/TNL/Meshes/MeshDetails/Mesh_impl.h +43 −42 Original line number Diff line number Diff line Loading @@ -17,83 +17,84 @@ #pragma once #include <TNL/Meshes/Mesh.h> #include <TNL/Meshes/MeshDetails/initializer/MeshInitializer.h> namespace TNL { namespace Meshes { template< typename MeshConfig > template< typename MeshConfig, typename Device > constexpr int Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getMeshDimension() { return MeshTraitsType::meshDimension; } template< typename MeshConfig > template< typename MeshConfig, typename Device > String Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getType() { return String( "Meshes::Mesh< ") + MeshConfig::getType() + " >"; } template< typename MeshConfig > template< typename MeshConfig, typename Device > String Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getTypeVirtual() const { return this->getType(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > String Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getSerializationType() { return Mesh::getType(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > String Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getSerializationTypeVirtual() const { return this->getSerializationType(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< int Dimension > constexpr bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: entitiesAvailable() { return MeshTraitsType::template EntityTraits< Dimension >::storageEnabled; } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< int Dimension > typename Mesh< MeshConfig >::GlobalIndexType Mesh< MeshConfig >:: typename Mesh< MeshConfig, Device >::GlobalIndexType Mesh< MeshConfig, Device >:: getEntitiesCount() const { static_assert( EntityTraits< Dimension >::storageEnabled, "You try to get number of entities which are not configured for storage." ); return StorageBaseType::getEntitiesCount( DimensionTag< Dimension >() ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< int Dimension > typename Mesh< MeshConfig >::template EntityType< Dimension >& Mesh< MeshConfig >:: typename Mesh< MeshConfig, Device >::template EntityType< Dimension >& Mesh< MeshConfig, Device >:: getEntity( const GlobalIndexType& entityIndex ) { static_assert( EntityTraits< Dimension >::storageEnabled, "You try to get entity which is not configured for storage." ); return StorageBaseType::getEntity( DimensionTag< Dimension >(), entityIndex ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< int Dimension > const typename Mesh< MeshConfig >::template EntityType< Dimension >& Mesh< MeshConfig >:: const typename Mesh< MeshConfig, Device >::template EntityType< Dimension >& Mesh< MeshConfig, Device >:: getEntity( const GlobalIndexType& entityIndex ) const { static_assert( EntityTraits< Dimension >::storageEnabled, "You try to get entity which is not configured for storage." ); Loading @@ -102,37 +103,37 @@ getEntity( const GlobalIndexType& entityIndex ) const // duplicated for compatibility with grids template< typename MeshConfig > template< typename MeshConfig, typename Device > template< typename Entity > typename Mesh< MeshConfig >::GlobalIndexType Mesh< MeshConfig >:: typename Mesh< MeshConfig, Device >::GlobalIndexType Mesh< MeshConfig, Device >:: getEntitiesCount() const { return getEntitiesCount< Entity::getEntityDimension() >(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< typename Entity > Entity& Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getEntity( const GlobalIndexType& entityIndex ) { return getEntity< Entity::getEntityDimension() >( entityIndex ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< typename Entity > const Entity& Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getEntity( const GlobalIndexType& entityIndex ) const { return getEntity< Entity::getEntityDimension() >( entityIndex ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: save( File& file ) const { if( ! Object::save( file ) || Loading @@ -144,9 +145,9 @@ save( File& file ) const return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: load( File& file ) { if( ! Object::load( file ) || Loading @@ -161,25 +162,25 @@ load( File& file ) return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > void Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: print( std::ostream& str ) const { StorageBaseType::print( str ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: operator==( const Mesh& mesh ) const { return StorageBaseType::operator==( mesh ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ) { Loading @@ -189,9 +190,9 @@ init( typename MeshTraitsType::PointArrayType& points, return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > void Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: writeProlog( Logger& logger ) { logger.writeParameter( "Dimension:", getMeshDimension() ); Loading @@ -203,8 +204,8 @@ writeProlog( Logger& logger ) } template< typename MeshConfig > std::ostream& operator<<( std::ostream& str, const Mesh< MeshConfig >& mesh ) template< typename MeshConfig, typename Device > std::ostream& operator<<( std::ostream& str, const Mesh< MeshConfig, Device >& mesh ) { mesh.print( str ); return str; Loading src/TNL/Meshes/MeshDetails/initializer/MeshInitializer.h +0 −4 Original line number Diff line number Diff line Loading @@ -62,9 +62,6 @@ namespace TNL { namespace Meshes { template< typename MeshConfig > class Mesh; template< typename MeshConfig, typename DimensionTag, bool EntityStorage = Loading Loading @@ -246,7 +243,6 @@ class MeshInitializerLayer< MeshConfig, // TODO: this is unused - should be moved to MeshIntegrityChecker bool checkCells() { typedef typename MeshEntity< MeshConfig, EntityTopology >::template SubentitiesTraits< 0 >::LocalIndexType LocalIndexType; const GlobalIndexType numberOfVertices( this->getMesh().getVerticesCount() ); for( GlobalIndexType cell = 0; cell < this->getMesh().template getEntitiesCount< typename MeshType::Cell >(); Loading Loading
src/TNL/Meshes/Mesh.h +7 −6 Original line number Diff line number Diff line Loading @@ -23,14 +23,15 @@ #include <TNL/Meshes/MeshDetails/traits/MeshTraits.h> #include <TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h> #include <TNL/Meshes/MeshDetails/config/MeshConfigValidator.h> #include <TNL/Meshes/MeshDetails/initializer/MeshInitializer.h> #include <TNL/Meshes/MeshDetails/layers/MeshEntityStorageRebinder.h> namespace TNL { namespace Meshes { template< typename MeshConfig > //, //typename Device = Devices::Host > template< typename MeshConfig > class MeshInitializer; template< typename MeshConfig, typename Device = Devices::Host > class Mesh : public Object, protected MeshStorageLayers< MeshConfig > Loading @@ -39,7 +40,7 @@ class Mesh public: using Config = MeshConfig; using MeshTraitsType = MeshTraits< MeshConfig >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; using DeviceType = typename MeshTraitsType::DeviceType; using GlobalIndexType = typename MeshTraitsType::GlobalIndexType; using LocalIndexType = typename MeshTraitsType::LocalIndexType; Loading Loading @@ -128,8 +129,8 @@ class Mesh friend struct MeshEntityStorageRebinderWorker; }; template< typename MeshConfig > std::ostream& operator<<( std::ostream& str, const Mesh< MeshConfig >& mesh ); template< typename MeshConfig, typename Device > std::ostream& operator<<( std::ostream& str, const Mesh< MeshConfig, Device >& mesh ); } // namespace Meshes } // namespace TNL Loading
src/TNL/Meshes/MeshDetails/MeshEntity_impl.h +47 −36 Original line number Diff line number Diff line Loading @@ -22,9 +22,10 @@ namespace TNL { namespace Meshes { template< typename MeshConfig, typename Device, typename EntityTopology > String MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: getType() { return String( "MeshEntity< " ) + Loading @@ -33,18 +34,20 @@ getType() } template< typename MeshConfig, typename Device, typename EntityTopology > String MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: getTypeVirtual() const { return this->getType(); } template< typename MeshConfig, typename Device, typename EntityTopology > bool MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: save( File& file ) const { if( ! MeshSubentityAccess< MeshConfig, EntityTopology >::save( file ) ) Loading @@ -53,9 +56,10 @@ save( File& file ) const } template< typename MeshConfig, typename Device, typename EntityTopology > bool MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: load( File& file ) { if( ! MeshSubentityAccess< MeshConfig, EntityTopology >::load( file ) ) Loading @@ -64,9 +68,10 @@ load( File& file ) } template< typename MeshConfig, typename Device, typename EntityTopology > void MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: print( std::ostream& str ) const { str << "\t Mesh entity dimension: " << EntityTopology::dimension << std::endl; Loading @@ -75,9 +80,10 @@ print( std::ostream& str ) const } template< typename MeshConfig, typename Device, typename EntityTopology > bool MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: operator==( const MeshEntity& entity ) const { return ( MeshSubentityAccess< MeshConfig, EntityTopology >::operator==( entity ) && Loading @@ -86,18 +92,20 @@ operator==( const MeshEntity& entity ) const } template< typename MeshConfig, typename Device, typename EntityTopology > bool MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: operator!=( const MeshEntity& entity ) const { return ! ( *this == entity ); } template< typename MeshConfig, typename Device, typename EntityTopology > constexpr int MeshEntity< MeshConfig, EntityTopology >:: MeshEntity< MeshConfig, Device, EntityTopology >:: getEntityDimension() { return EntityTopology::dimension; Loading @@ -107,18 +115,20 @@ getEntityDimension() * Subentities */ template< typename MeshConfig, typename Device, typename EntityTopology > constexpr typename MeshEntity< MeshConfig, EntityTopology >::LocalIndexType MeshEntity< MeshConfig, EntityTopology >:: constexpr typename MeshEntity< MeshConfig, Device, EntityTopology >::LocalIndexType MeshEntity< MeshConfig, Device, EntityTopology >:: getVerticesCount() { return SubentityTraits< 0 >::count; } template< typename MeshConfig, typename Device, typename EntityTopology > typename MeshEntity< MeshConfig, EntityTopology >::GlobalIndexType MeshEntity< MeshConfig, EntityTopology >:: typename MeshEntity< MeshConfig, Device, EntityTopology >::GlobalIndexType MeshEntity< MeshConfig, Device, EntityTopology >:: getVertexIndex( const LocalIndexType localIndex ) const { return this->template getSubentityIndex< 0 >( localIndex ); Loading @@ -128,47 +138,47 @@ getVertexIndex( const LocalIndexType localIndex ) const /**** * Vertex entity specialization */ template< typename MeshConfig > template< typename MeshConfig, typename Device > String MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: getType() { return String( "MeshEntity< ... >" ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > String MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: getTypeVirtual() const { return this->getType(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: save( File& file ) const { if( //! MeshSuperentityStorageLayers< MeshConfig, MeshVertexTopology >::save( file ) || if( //! MeshSuperentityStorageLayers< MeshConfig, Device, MeshVertexTopology >::save( file ) || ! point.save( file ) ) return false; return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: load( File& file ) { if( //! MeshSuperentityStorageLayers< MeshConfig, MeshVertexTopology >::load( file ) || if( //! MeshSuperentityStorageLayers< MeshConfig, Device, MeshVertexTopology >::load( file ) || ! point.load( file ) ) return false; return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > void MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: print( std::ostream& str ) const { str << "\t Mesh entity dimension: " << MeshVertexTopology::dimension << std::endl; Loading @@ -176,9 +186,9 @@ print( std::ostream& str ) const MeshSuperentityAccess< MeshConfig, MeshVertexTopology >::print( str ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: operator==( const MeshEntity& entity ) const { return ( MeshSuperentityAccess< MeshConfig, MeshVertexTopology >::operator==( entity ) && Loading @@ -186,41 +196,42 @@ operator==( const MeshEntity& entity ) const point == entity.point ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: operator!=( const MeshEntity& entity ) const { return ! ( *this == entity ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > constexpr int MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: getEntityDimension() { return EntityTopology::dimension; } template< typename MeshConfig > typename MeshEntity< MeshConfig, MeshVertexTopology >::PointType MeshEntity< MeshConfig, MeshVertexTopology >:: template< typename MeshConfig, typename Device > typename MeshEntity< MeshConfig, Device, MeshVertexTopology >::PointType MeshEntity< MeshConfig, Device, MeshVertexTopology >:: getPoint() const { return this->point; } template< typename MeshConfig > template< typename MeshConfig, typename Device > void MeshEntity< MeshConfig, MeshVertexTopology >:: MeshEntity< MeshConfig, Device, MeshVertexTopology >:: setPoint( const PointType& point ) { this->point = point; } template< typename MeshConfig, typename Device, typename EntityTopology > std::ostream& operator<<( std::ostream& str, const MeshEntity< MeshConfig, EntityTopology >& entity ) std::ostream& operator<<( std::ostream& str, const MeshEntity< MeshConfig, Device, EntityTopology >& entity ) { entity.print( str ); return str; Loading
src/TNL/Meshes/MeshDetails/MeshWriterVTKLegacy.h +4 −4 Original line number Diff line number Diff line Loading @@ -48,10 +48,10 @@ enum tnlVTKMeshEntities { tnlVTKVertex = 1, template< typename MeshEntity > struct MeshEntityVTKType{}; template< typename MeshConfig > struct MeshEntityVTKType< MeshEntity< MeshConfig, MeshTriangleTopology > > { enum { VTKType = tnlVTKTriangle }; }; template< typename MeshConfig > struct MeshEntityVTKType< MeshEntity< MeshConfig, MeshQuadrilateralTopology > >{ enum { VTKType = tnlVTKQuad }; }; template< typename MeshConfig > struct MeshEntityVTKType< MeshEntity< MeshConfig, MeshTetrahedronTopology > > { enum { VTKType = tnlVTKTetra }; }; template< typename MeshConfig > struct MeshEntityVTKType< MeshEntity< MeshConfig, MeshHexahedronTopology > > { enum { VTKType = tnlVTKHexahedron }; }; template< typename MeshConfig, typename Device > struct MeshEntityVTKType< MeshEntity< MeshConfig, Device, MeshTriangleTopology > > { enum { VTKType = tnlVTKTriangle }; }; template< typename MeshConfig, typename Device > struct MeshEntityVTKType< MeshEntity< MeshConfig, Device, MeshQuadrilateralTopology > >{ enum { VTKType = tnlVTKQuad }; }; template< typename MeshConfig, typename Device > struct MeshEntityVTKType< MeshEntity< MeshConfig, Device, MeshTetrahedronTopology > > { enum { VTKType = tnlVTKTetra }; }; template< typename MeshConfig, typename Device > struct MeshEntityVTKType< MeshEntity< MeshConfig, Device, MeshHexahedronTopology > > { enum { VTKType = tnlVTKHexahedron }; }; class MeshWriterVTKLegacy { Loading
src/TNL/Meshes/MeshDetails/Mesh_impl.h +43 −42 Original line number Diff line number Diff line Loading @@ -17,83 +17,84 @@ #pragma once #include <TNL/Meshes/Mesh.h> #include <TNL/Meshes/MeshDetails/initializer/MeshInitializer.h> namespace TNL { namespace Meshes { template< typename MeshConfig > template< typename MeshConfig, typename Device > constexpr int Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getMeshDimension() { return MeshTraitsType::meshDimension; } template< typename MeshConfig > template< typename MeshConfig, typename Device > String Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getType() { return String( "Meshes::Mesh< ") + MeshConfig::getType() + " >"; } template< typename MeshConfig > template< typename MeshConfig, typename Device > String Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getTypeVirtual() const { return this->getType(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > String Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getSerializationType() { return Mesh::getType(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > String Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getSerializationTypeVirtual() const { return this->getSerializationType(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< int Dimension > constexpr bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: entitiesAvailable() { return MeshTraitsType::template EntityTraits< Dimension >::storageEnabled; } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< int Dimension > typename Mesh< MeshConfig >::GlobalIndexType Mesh< MeshConfig >:: typename Mesh< MeshConfig, Device >::GlobalIndexType Mesh< MeshConfig, Device >:: getEntitiesCount() const { static_assert( EntityTraits< Dimension >::storageEnabled, "You try to get number of entities which are not configured for storage." ); return StorageBaseType::getEntitiesCount( DimensionTag< Dimension >() ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< int Dimension > typename Mesh< MeshConfig >::template EntityType< Dimension >& Mesh< MeshConfig >:: typename Mesh< MeshConfig, Device >::template EntityType< Dimension >& Mesh< MeshConfig, Device >:: getEntity( const GlobalIndexType& entityIndex ) { static_assert( EntityTraits< Dimension >::storageEnabled, "You try to get entity which is not configured for storage." ); return StorageBaseType::getEntity( DimensionTag< Dimension >(), entityIndex ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< int Dimension > const typename Mesh< MeshConfig >::template EntityType< Dimension >& Mesh< MeshConfig >:: const typename Mesh< MeshConfig, Device >::template EntityType< Dimension >& Mesh< MeshConfig, Device >:: getEntity( const GlobalIndexType& entityIndex ) const { static_assert( EntityTraits< Dimension >::storageEnabled, "You try to get entity which is not configured for storage." ); Loading @@ -102,37 +103,37 @@ getEntity( const GlobalIndexType& entityIndex ) const // duplicated for compatibility with grids template< typename MeshConfig > template< typename MeshConfig, typename Device > template< typename Entity > typename Mesh< MeshConfig >::GlobalIndexType Mesh< MeshConfig >:: typename Mesh< MeshConfig, Device >::GlobalIndexType Mesh< MeshConfig, Device >:: getEntitiesCount() const { return getEntitiesCount< Entity::getEntityDimension() >(); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< typename Entity > Entity& Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getEntity( const GlobalIndexType& entityIndex ) { return getEntity< Entity::getEntityDimension() >( entityIndex ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > template< typename Entity > const Entity& Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: getEntity( const GlobalIndexType& entityIndex ) const { return getEntity< Entity::getEntityDimension() >( entityIndex ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: save( File& file ) const { if( ! Object::save( file ) || Loading @@ -144,9 +145,9 @@ save( File& file ) const return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: load( File& file ) { if( ! Object::load( file ) || Loading @@ -161,25 +162,25 @@ load( File& file ) return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > void Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: print( std::ostream& str ) const { StorageBaseType::print( str ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: operator==( const Mesh& mesh ) const { return StorageBaseType::operator==( mesh ); } template< typename MeshConfig > template< typename MeshConfig, typename Device > bool Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ) { Loading @@ -189,9 +190,9 @@ init( typename MeshTraitsType::PointArrayType& points, return true; } template< typename MeshConfig > template< typename MeshConfig, typename Device > void Mesh< MeshConfig >:: Mesh< MeshConfig, Device >:: writeProlog( Logger& logger ) { logger.writeParameter( "Dimension:", getMeshDimension() ); Loading @@ -203,8 +204,8 @@ writeProlog( Logger& logger ) } template< typename MeshConfig > std::ostream& operator<<( std::ostream& str, const Mesh< MeshConfig >& mesh ) template< typename MeshConfig, typename Device > std::ostream& operator<<( std::ostream& str, const Mesh< MeshConfig, Device >& mesh ) { mesh.print( str ); return str; Loading
src/TNL/Meshes/MeshDetails/initializer/MeshInitializer.h +0 −4 Original line number Diff line number Diff line Loading @@ -62,9 +62,6 @@ namespace TNL { namespace Meshes { template< typename MeshConfig > class Mesh; template< typename MeshConfig, typename DimensionTag, bool EntityStorage = Loading Loading @@ -246,7 +243,6 @@ class MeshInitializerLayer< MeshConfig, // TODO: this is unused - should be moved to MeshIntegrityChecker bool checkCells() { typedef typename MeshEntity< MeshConfig, EntityTopology >::template SubentitiesTraits< 0 >::LocalIndexType LocalIndexType; const GlobalIndexType numberOfVertices( this->getMesh().getVerticesCount() ); for( GlobalIndexType cell = 0; cell < this->getMesh().template getEntitiesCount< typename MeshType::Cell >(); Loading