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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ private:
      assignedPoints.setValue( false );

      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++ ) {
            assignedPoints[ cornerIds[ j ] ] = true;
            if( cornerIds[ j ] < 0 || getPointsCount() <= cornerIds[ j ] ) {
+28 −0
Original line number Diff line number Diff line
#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
+7 −5
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <TNL/Meshes/Topologies/Quadrangle.h>
#include <TNL/Meshes/Topologies/Tetrahedron.h>
#include <TNL/Meshes/Topologies/Hexahedron.h>
#include <TNL/Meshes/Topologies/Polygon.h>

namespace TNL {
namespace Meshes {
@@ -128,6 +129,7 @@ template<> struct TopologyToEntityShape< Topologies::Triangle > { static c
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::Hexahedron >  { static constexpr EntityShape shape = EntityShape::Hexahedron; };
template<> struct TopologyToEntityShape< Topologies::Polygon >     { static constexpr EntityShape shape = EntityShape::Polygon; };

// mapping used in VTKWriter
template< typename GridEntity >