Skip to content
Snippets Groups Projects
Commit 40aa3f83 authored by Ján Bobot's avatar Ján Bobot Committed by Jakub Klinkovský
Browse files

Added Polygon mesh topology

- added Polygon to Topologies
- added mapping of Topologies::Polygon to EntityShape::Polygon in VTKTraits
- added a missing reference to a variable in MeshBuilder::validate
parent fb71dff8
No related branches found
No related tags found
1 merge request!93Polygonal + polyhedral mesh
...@@ -92,7 +92,7 @@ private: ...@@ -92,7 +92,7 @@ private:
assignedPoints.setValue( false ); assignedPoints.setValue( false );
for( GlobalIndexType i = 0; i < getCellsCount(); i++ ) { for( GlobalIndexType i = 0; i < getCellsCount(); i++ ) {
const auto cornerIds = this->cellSeeds[ i ].getCornerIds(); const auto& cornerIds = this->cellSeeds[ i ].getCornerIds();
for( LocalIndexType j = 0; j < cornerIds.getSize(); j++ ) { for( LocalIndexType j = 0; j < cornerIds.getSize(); j++ ) {
assignedPoints[ cornerIds[ j ] ] = true; assignedPoints[ cornerIds[ j ] ] = true;
if( cornerIds[ j ] < 0 || getPointsCount() <= cornerIds[ j ] ) { if( cornerIds[ j ] < 0 || getPointsCount() <= cornerIds[ j ] ) {
......
#pragma once
#include <TNL/Meshes/Topologies/Edge.h>
namespace TNL {
namespace Meshes {
namespace Topologies {
struct Polygon
{
static constexpr int dimension = 2;
};
template<>
struct Subtopology< Polygon, 0 >
{
typedef Vertex Topology;
};
template<>
struct Subtopology< Polygon, 1 >
{
typedef Edge Topology;
};
} // namespace Topologies
} // namespace Meshes
} // namespace TNL
\ No newline at end of file
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <TNL/Meshes/Topologies/Quadrangle.h> #include <TNL/Meshes/Topologies/Quadrangle.h>
#include <TNL/Meshes/Topologies/Tetrahedron.h> #include <TNL/Meshes/Topologies/Tetrahedron.h>
#include <TNL/Meshes/Topologies/Hexahedron.h> #include <TNL/Meshes/Topologies/Hexahedron.h>
#include <TNL/Meshes/Topologies/Polygon.h>
namespace TNL { namespace TNL {
namespace Meshes { namespace Meshes {
...@@ -122,12 +123,13 @@ inline int getEntityDimension( EntityShape shape ) ...@@ -122,12 +123,13 @@ inline int getEntityDimension( EntityShape shape )
// static mapping of TNL entity topologies to EntityShape // static mapping of TNL entity topologies to EntityShape
template< typename Topology > struct TopologyToEntityShape {}; template< typename Topology > struct TopologyToEntityShape {};
template<> struct TopologyToEntityShape< Topologies::Vertex > { static constexpr EntityShape shape = EntityShape::Vertex; }; template<> struct TopologyToEntityShape< Topologies::Vertex > { static constexpr EntityShape shape = EntityShape::Vertex; };
template<> struct TopologyToEntityShape< Topologies::Edge > { static constexpr EntityShape shape = EntityShape::Line; }; template<> struct TopologyToEntityShape< Topologies::Edge > { static constexpr EntityShape shape = EntityShape::Line; };
template<> struct TopologyToEntityShape< Topologies::Triangle > { static constexpr EntityShape shape = EntityShape::Triangle; }; template<> struct TopologyToEntityShape< Topologies::Triangle > { static constexpr EntityShape shape = EntityShape::Triangle; };
template<> struct TopologyToEntityShape< Topologies::Quadrangle > { static constexpr EntityShape shape = EntityShape::Quad; }; template<> struct TopologyToEntityShape< Topologies::Quadrangle > { static constexpr EntityShape shape = EntityShape::Quad; };
template<> struct TopologyToEntityShape< Topologies::Tetrahedron > { static constexpr EntityShape shape = EntityShape::Tetra; }; template<> struct TopologyToEntityShape< Topologies::Tetrahedron > { static constexpr EntityShape shape = EntityShape::Tetra; };
template<> struct TopologyToEntityShape< Topologies::Hexahedron > { static constexpr EntityShape shape = EntityShape::Hexahedron; }; template<> struct TopologyToEntityShape< Topologies::Hexahedron > { static constexpr EntityShape shape = EntityShape::Hexahedron; };
template<> struct TopologyToEntityShape< Topologies::Polygon > { static constexpr EntityShape shape = EntityShape::Polygon; };
// mapping used in VTKWriter // mapping used in VTKWriter
template< typename GridEntity > template< typename GridEntity >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment