Loading src/TNL/Functions/MeshFunction.h +13 −3 Original line number Original line Diff line number Diff line Loading @@ -163,6 +163,16 @@ class MeshFunction : using Object::boundLoad; using Object::boundLoad; DistributedMeshSynchronizerType& getSynchronizer() { return this->synchronizer; } const DistributedMeshSynchronizerType& getSynchronizer() const { return this->synchronizer; } template< typename CommunicatorType, template< typename CommunicatorType, typename PeriodicBoundariesMaskType = MeshFunction< Mesh, MeshEntityDimension, bool > > typename PeriodicBoundariesMaskType = MeshFunction< Mesh, MeshEntityDimension, bool > > void synchronize( bool withPeriodicBoundaryConditions = false, void synchronize( bool withPeriodicBoundaryConditions = false, Loading @@ -171,8 +181,9 @@ class MeshFunction : protected: protected: //DistributedMeshSynchronizerType synchronizer; // TODO: synchronizer should not be part of the mesh function - the way of synchronization Meshes::DistributedMeshes::DistributedMeshSynchronizer< Functions::MeshFunction< MeshType, MeshEntityDimension, RealType > > synchronizer; // depends rather on algorithm/method/scheme in hand than on data DistributedMeshSynchronizerType synchronizer; MeshPointer meshPointer; MeshPointer meshPointer; Loading @@ -182,7 +193,6 @@ class MeshFunction : private: private: void setupSynchronizer( DistributedMeshType *distributedMesh ); void setupSynchronizer( DistributedMeshType *distributedMesh ); }; }; template< typename Mesh, template< typename Mesh, Loading src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -66,6 +66,11 @@ class DistributedMeshSynchronizer< Functions::MeshFunction< Grid< MeshDimension, setDistributedGrid( distributedGrid ); setDistributedGrid( distributedGrid ); }; }; void setPeriodicBoundariesCopyDirection( const PeriodicBoundariesCopyDirection dir ) { this->periodicBoundariesCopyDirection = dir; } void setDistributedGrid( DistributedGridType *distributedGrid ) void setDistributedGrid( DistributedGridType *distributedGrid ) { { isSet = true; isSet = true; Loading src/UnitTests/Meshes/DistributedMeshes/DistributedGridTest_1D.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -256,6 +256,8 @@ TEST_F(DistributedGridTest_1D, SynchronizePeriodicNeighborsWithoutMask ) setDof_1D( dof, -rank-1 ); setDof_1D( dof, -rank-1 ); maskDofs.setValue( true ); maskDofs.setValue( true ); constFunctionEvaluator.evaluateAllEntities( meshFunctionPtr, constFunctionPtr ); constFunctionEvaluator.evaluateAllEntities( meshFunctionPtr, constFunctionPtr ); using Synchronizer = decltype( meshFunctionPtr->getSynchronizer() ); meshFunctionPtr->getSynchronizer().setPeriodicBoundariesCopyDirection( Synchronizer::OverlapToBoundary ); meshFunctionPtr->template synchronize<CommunicatorType>( true ); meshFunctionPtr->template synchronize<CommunicatorType>( true ); if( rank == 0 ) if( rank == 0 ) Loading Loading
src/TNL/Functions/MeshFunction.h +13 −3 Original line number Original line Diff line number Diff line Loading @@ -163,6 +163,16 @@ class MeshFunction : using Object::boundLoad; using Object::boundLoad; DistributedMeshSynchronizerType& getSynchronizer() { return this->synchronizer; } const DistributedMeshSynchronizerType& getSynchronizer() const { return this->synchronizer; } template< typename CommunicatorType, template< typename CommunicatorType, typename PeriodicBoundariesMaskType = MeshFunction< Mesh, MeshEntityDimension, bool > > typename PeriodicBoundariesMaskType = MeshFunction< Mesh, MeshEntityDimension, bool > > void synchronize( bool withPeriodicBoundaryConditions = false, void synchronize( bool withPeriodicBoundaryConditions = false, Loading @@ -171,8 +181,9 @@ class MeshFunction : protected: protected: //DistributedMeshSynchronizerType synchronizer; // TODO: synchronizer should not be part of the mesh function - the way of synchronization Meshes::DistributedMeshes::DistributedMeshSynchronizer< Functions::MeshFunction< MeshType, MeshEntityDimension, RealType > > synchronizer; // depends rather on algorithm/method/scheme in hand than on data DistributedMeshSynchronizerType synchronizer; MeshPointer meshPointer; MeshPointer meshPointer; Loading @@ -182,7 +193,6 @@ class MeshFunction : private: private: void setupSynchronizer( DistributedMeshType *distributedMesh ); void setupSynchronizer( DistributedMeshType *distributedMesh ); }; }; template< typename Mesh, template< typename Mesh, Loading
src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -66,6 +66,11 @@ class DistributedMeshSynchronizer< Functions::MeshFunction< Grid< MeshDimension, setDistributedGrid( distributedGrid ); setDistributedGrid( distributedGrid ); }; }; void setPeriodicBoundariesCopyDirection( const PeriodicBoundariesCopyDirection dir ) { this->periodicBoundariesCopyDirection = dir; } void setDistributedGrid( DistributedGridType *distributedGrid ) void setDistributedGrid( DistributedGridType *distributedGrid ) { { isSet = true; isSet = true; Loading
src/UnitTests/Meshes/DistributedMeshes/DistributedGridTest_1D.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -256,6 +256,8 @@ TEST_F(DistributedGridTest_1D, SynchronizePeriodicNeighborsWithoutMask ) setDof_1D( dof, -rank-1 ); setDof_1D( dof, -rank-1 ); maskDofs.setValue( true ); maskDofs.setValue( true ); constFunctionEvaluator.evaluateAllEntities( meshFunctionPtr, constFunctionPtr ); constFunctionEvaluator.evaluateAllEntities( meshFunctionPtr, constFunctionPtr ); using Synchronizer = decltype( meshFunctionPtr->getSynchronizer() ); meshFunctionPtr->getSynchronizer().setPeriodicBoundariesCopyDirection( Synchronizer::OverlapToBoundary ); meshFunctionPtr->template synchronize<CommunicatorType>( true ); meshFunctionPtr->template synchronize<CommunicatorType>( true ); if( rank == 0 ) if( rank == 0 ) Loading