Skip to content
Snippets Groups Projects
Commit 01852cf2 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Optimized mesh initializer for cases with disabled entity orientations

parent bd748683
No related branches found
No related tags found
1 merge request!65VTK formats, distributed mesh and synchronizer
......@@ -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 );
}
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment