Loading src/TNL/Meshes/MeshDetails/initializer/EntitySeed.h +6 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ class EntitySeed using HashType = EntitySeedHash< EntitySeed >; using KeyEqual = EntitySeedEq< EntitySeed >; //this function is here only for compatibility with MeshReader void setCornersCount( const LocalIndexType& cornersCount ) {} static constexpr LocalIndexType getCornersCount() { return SubvertexTraits::count; Loading Loading @@ -81,6 +84,9 @@ class EntitySeed< MeshConfig, Topologies::Vertex > using HashType = EntitySeedHash< EntitySeed >; using KeyEqual = EntitySeedEq< EntitySeed >; //this function is here only for compatibility with MeshReader void setCornersCount( const LocalIndexType& cornersCount ) {} static constexpr LocalIndexType getCornersCount() { return 1; Loading src/TNL/Meshes/Readers/MeshReader.h +1 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,7 @@ public: for( std::size_t i = 0; i < NumberOfCells; i++ ) { CellSeedType& seed = meshBuilder.getCellSeed( i ); const std::size_t offsetEnd = offsets[ i ]; seed.setCornersCount( offsetEnd - offsetStart ); for( std::size_t o = offsetStart; o < offsetEnd; o++ ) seed.setCornerId( o - offsetStart, connectivity[ o ] ); offsetStart = offsetEnd; Loading src/TNL/Meshes/TypeResolver/MeshTypeResolver.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ resolveCellTopology( Reader& reader, Functor&& functor ) return resolveSpaceDimension< Topologies::Tetrahedron >( reader, std::forward<Functor>(functor) ); case VTK::EntityShape::Hexahedron: return resolveSpaceDimension< Topologies::Hexahedron >( reader, std::forward<Functor>(functor) ); case VTK::EntityShape::Polygon: return resolveSpaceDimension< Topologies::Polygon >( reader, std::forward<Functor>(functor) ); default: std::cerr << "unsupported cell topology: " << VTK::getShapeName( reader.getCellShape() ) << std::endl; return false; Loading src/TNL/Meshes/Writers/VTKWriter.hpp +8 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ struct MeshEntitiesVTKWriter const int verticesPerEntity = VerticesPerEntity< EntityType >::count;; for( Index i = 0; i < entitiesCount; i++ ) { const auto& entity = mesh.template getEntity< EntityType >( i ); //TODO: polygons require verticesPerEntity to be aquired like below //const Index verticesPerEntity = entity.template getSubentitiesCount< 0 >(); writeInt( format, str, verticesPerEntity ); for( int j = 0; j < verticesPerEntity; j++ ) writeInt( format, str, entity.template getSubentityIndex< 0 >( j ) ); Loading Loading @@ -445,6 +447,12 @@ VTKWriter< Mesh >::writeEntities( const Mesh& mesh ) const int verticesPerEntity = VerticesPerEntity< EntityType >::count; const std::uint64_t cellsListSize = cellsCount * ( verticesPerEntity + 1 ); //TODO: polygons need cellsListSize computed like this, but code doesnt compile, // because function writeEntities is also used for grids, that don't contain function getSubentitiesCount /*IndexType cellsListSize = cellsCount; for(IndexType index = 0; index < cellsCount; index++) cellsListSize += mesh.template getSubentitiesCount< EntityDimension, 0 >( index );*/ str << std::endl << "CELLS " << cellsCount << " " << cellsListSize << std::endl; EntitiesWriter< EntityDimension >::exec( mesh, str, format ); Loading src/TNL/Meshes/Writers/VTUWriter.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ struct MeshEntitiesVTUCollector const Index verticesPerEntity = VerticesPerEntity< EntityType >::count;; for( Index i = 0; i < entitiesCount; i++ ) { const auto& entity = mesh.template getEntity< EntityType >( i ); //TODO: polygons require verticesPerEntity to be aquired like below //const Index verticesPerEntity = entity.template getSubentitiesCount< 0 >(); for( Index j = 0; j < verticesPerEntity; j++ ) connectivity.push_back( entity.template getSubentityIndex< 0 >( j ) ); offsets.push_back( connectivity.size() ); Loading Loading
src/TNL/Meshes/MeshDetails/initializer/EntitySeed.h +6 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ class EntitySeed using HashType = EntitySeedHash< EntitySeed >; using KeyEqual = EntitySeedEq< EntitySeed >; //this function is here only for compatibility with MeshReader void setCornersCount( const LocalIndexType& cornersCount ) {} static constexpr LocalIndexType getCornersCount() { return SubvertexTraits::count; Loading Loading @@ -81,6 +84,9 @@ class EntitySeed< MeshConfig, Topologies::Vertex > using HashType = EntitySeedHash< EntitySeed >; using KeyEqual = EntitySeedEq< EntitySeed >; //this function is here only for compatibility with MeshReader void setCornersCount( const LocalIndexType& cornersCount ) {} static constexpr LocalIndexType getCornersCount() { return 1; Loading
src/TNL/Meshes/Readers/MeshReader.h +1 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,7 @@ public: for( std::size_t i = 0; i < NumberOfCells; i++ ) { CellSeedType& seed = meshBuilder.getCellSeed( i ); const std::size_t offsetEnd = offsets[ i ]; seed.setCornersCount( offsetEnd - offsetStart ); for( std::size_t o = offsetStart; o < offsetEnd; o++ ) seed.setCornerId( o - offsetStart, connectivity[ o ] ); offsetStart = offsetEnd; Loading
src/TNL/Meshes/TypeResolver/MeshTypeResolver.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ resolveCellTopology( Reader& reader, Functor&& functor ) return resolveSpaceDimension< Topologies::Tetrahedron >( reader, std::forward<Functor>(functor) ); case VTK::EntityShape::Hexahedron: return resolveSpaceDimension< Topologies::Hexahedron >( reader, std::forward<Functor>(functor) ); case VTK::EntityShape::Polygon: return resolveSpaceDimension< Topologies::Polygon >( reader, std::forward<Functor>(functor) ); default: std::cerr << "unsupported cell topology: " << VTK::getShapeName( reader.getCellShape() ) << std::endl; return false; Loading
src/TNL/Meshes/Writers/VTKWriter.hpp +8 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ struct MeshEntitiesVTKWriter const int verticesPerEntity = VerticesPerEntity< EntityType >::count;; for( Index i = 0; i < entitiesCount; i++ ) { const auto& entity = mesh.template getEntity< EntityType >( i ); //TODO: polygons require verticesPerEntity to be aquired like below //const Index verticesPerEntity = entity.template getSubentitiesCount< 0 >(); writeInt( format, str, verticesPerEntity ); for( int j = 0; j < verticesPerEntity; j++ ) writeInt( format, str, entity.template getSubentityIndex< 0 >( j ) ); Loading Loading @@ -445,6 +447,12 @@ VTKWriter< Mesh >::writeEntities( const Mesh& mesh ) const int verticesPerEntity = VerticesPerEntity< EntityType >::count; const std::uint64_t cellsListSize = cellsCount * ( verticesPerEntity + 1 ); //TODO: polygons need cellsListSize computed like this, but code doesnt compile, // because function writeEntities is also used for grids, that don't contain function getSubentitiesCount /*IndexType cellsListSize = cellsCount; for(IndexType index = 0; index < cellsCount; index++) cellsListSize += mesh.template getSubentitiesCount< EntityDimension, 0 >( index );*/ str << std::endl << "CELLS " << cellsCount << " " << cellsListSize << std::endl; EntitiesWriter< EntityDimension >::exec( mesh, str, format ); Loading
src/TNL/Meshes/Writers/VTUWriter.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ struct MeshEntitiesVTUCollector const Index verticesPerEntity = VerticesPerEntity< EntityType >::count;; for( Index i = 0; i < entitiesCount; i++ ) { const auto& entity = mesh.template getEntity< EntityType >( i ); //TODO: polygons require verticesPerEntity to be aquired like below //const Index verticesPerEntity = entity.template getSubentitiesCount< 0 >(); for( Index j = 0; j < verticesPerEntity; j++ ) connectivity.push_back( entity.template getSubentityIndex< 0 >( j ) ); offsets.push_back( connectivity.size() ); Loading