Commit 01852cf2 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Optimized mesh initializer for cases with disabled entity orientations

parent bd748683
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ class Initializer
      {
         // copy points
         mesh.template setEntitiesCount< 0 >( points.getSize() );
         mesh.getPoints() = points;
         mesh.getPoints().swap( points );
         points.reset();

         this->mesh = &mesh;
@@ -354,6 +354,7 @@ class InitializerLayer< MeshConfig,
         EntityInitializerType::initSuperentities( initializer, mesh );
         this->seedsIndexedSet.clear();
         this->referenceOrientations.clear();
         this->referenceOrientations.shrink_to_fit();

         BaseType::initEntities( initializer, mesh );
      }
+11 −1
Original line number Diff line number Diff line
@@ -52,6 +52,16 @@ class MeshEntityTraits
{
   using GlobalIndexType = typename MeshConfig::GlobalIndexType;

   static constexpr bool checkOrientationNeeded()
   {
      if( Dimension == 0 || Dimension == MeshConfig::meshDimension )
         return false;
      for( int d = 1; d < Dimension; d++ )
         if( MeshConfig::subentityOrientationStorage( EntityTopology(), d ) )
            return true;
      return false;
   }

public:
   static_assert( 0 <= Dimension && Dimension <= MeshConfig::meshDimension, "invalid dimension" );

@@ -64,7 +74,7 @@ public:
   using SeedSetType                   = std::unordered_set< typename SeedIndexedSetType::key_type, typename SeedIndexedSetType::hasher, typename SeedIndexedSetType::key_equal >;
   using ReferenceOrientationArrayType = std::vector< ReferenceOrientationType >;

   static constexpr bool orientationNeeded = 0 < Dimension && Dimension < MeshConfig::meshDimension;
   static constexpr bool orientationNeeded = checkOrientationNeeded();
};

} // namespace Meshes