Loading src/TNL/Meshes/Mesh.h +21 −5 Original line number Diff line number Diff line Loading @@ -30,11 +30,31 @@ namespace Meshes { template< typename MeshConfig > class MeshInitializer; template< typename MeshConfig, typename Device, typename MeshType > class MeshInitializableBase { public: using MeshTraitsType = MeshTraits< MeshConfig, Device >; // The points and cellSeeds arrays will be reset when not needed to save memory. bool init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ); }; // The mesh cannot be initialized on CUDA GPU, so this specialization is empty. template< typename MeshConfig, typename MeshType > class MeshInitializableBase< MeshConfig, Devices::Cuda, MeshType > { }; template< typename MeshConfig, typename Device = Devices::Host > class Mesh : public Object, protected MeshStorageLayers< MeshConfig, Device > protected MeshStorageLayers< MeshConfig, Device >, public MeshInitializableBase< MeshConfig, Device, Mesh< MeshConfig, Device > > { using StorageBaseType = MeshStorageLayers< MeshConfig, Device >; Loading Loading @@ -109,10 +129,6 @@ class Mesh bool operator==( const Mesh& mesh ) const; // The points and cellSeeds arrays will be reset when not needed to save memory. bool init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ); void writeProlog( Logger& logger ); protected: Loading src/TNL/Meshes/MeshDetails/Mesh_impl.h +13 −12 Original line number Diff line number Diff line Loading @@ -22,6 +22,19 @@ namespace TNL { namespace Meshes { template< typename MeshConfig, typename Device, typename MeshType > bool MeshInitializableBase< MeshConfig, Device, MeshType >:: init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ) { MeshInitializer< typename MeshType::Config > meshInitializer; if( ! meshInitializer.createMesh( points, cellSeeds, *static_cast<MeshType*>(this) ) ) return false; return true; } template< typename MeshConfig, typename Device > constexpr int Mesh< MeshConfig, Device >:: Loading Loading @@ -178,18 +191,6 @@ operator==( const Mesh& mesh ) const return StorageBaseType::operator==( mesh ); } template< typename MeshConfig, typename Device > bool Mesh< MeshConfig, Device >:: init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ) { MeshInitializer< MeshConfig> meshInitializer; if( ! meshInitializer.createMesh( points, cellSeeds, *this ) ) return false; return true; } template< typename MeshConfig, typename Device > void Mesh< MeshConfig, Device >:: Loading Loading
src/TNL/Meshes/Mesh.h +21 −5 Original line number Diff line number Diff line Loading @@ -30,11 +30,31 @@ namespace Meshes { template< typename MeshConfig > class MeshInitializer; template< typename MeshConfig, typename Device, typename MeshType > class MeshInitializableBase { public: using MeshTraitsType = MeshTraits< MeshConfig, Device >; // The points and cellSeeds arrays will be reset when not needed to save memory. bool init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ); }; // The mesh cannot be initialized on CUDA GPU, so this specialization is empty. template< typename MeshConfig, typename MeshType > class MeshInitializableBase< MeshConfig, Devices::Cuda, MeshType > { }; template< typename MeshConfig, typename Device = Devices::Host > class Mesh : public Object, protected MeshStorageLayers< MeshConfig, Device > protected MeshStorageLayers< MeshConfig, Device >, public MeshInitializableBase< MeshConfig, Device, Mesh< MeshConfig, Device > > { using StorageBaseType = MeshStorageLayers< MeshConfig, Device >; Loading Loading @@ -109,10 +129,6 @@ class Mesh bool operator==( const Mesh& mesh ) const; // The points and cellSeeds arrays will be reset when not needed to save memory. bool init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ); void writeProlog( Logger& logger ); protected: Loading
src/TNL/Meshes/MeshDetails/Mesh_impl.h +13 −12 Original line number Diff line number Diff line Loading @@ -22,6 +22,19 @@ namespace TNL { namespace Meshes { template< typename MeshConfig, typename Device, typename MeshType > bool MeshInitializableBase< MeshConfig, Device, MeshType >:: init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ) { MeshInitializer< typename MeshType::Config > meshInitializer; if( ! meshInitializer.createMesh( points, cellSeeds, *static_cast<MeshType*>(this) ) ) return false; return true; } template< typename MeshConfig, typename Device > constexpr int Mesh< MeshConfig, Device >:: Loading Loading @@ -178,18 +191,6 @@ operator==( const Mesh& mesh ) const return StorageBaseType::operator==( mesh ); } template< typename MeshConfig, typename Device > bool Mesh< MeshConfig, Device >:: init( typename MeshTraitsType::PointArrayType& points, typename MeshTraitsType::CellSeedArrayType& cellSeeds ) { MeshInitializer< MeshConfig> meshInitializer; if( ! meshInitializer.createMesh( points, cellSeeds, *this ) ) return false; return true; } template< typename MeshConfig, typename Device > void Mesh< MeshConfig, Device >:: Loading