Loading src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +12 −17 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,12 @@ class DistributedMeshSynchronizer< Functions::MeshFunction< Grid< MeshDimension, typedef typename DistributedGridType::CoordinatesType CoordinatesType; typedef typename DistributedGridType::CoordinatesType CoordinatesType; using SubdomainOverlapsType = typename DistributedGridType::SubdomainOverlapsType; using SubdomainOverlapsType = typename DistributedGridType::SubdomainOverlapsType; enum PeriodicBoundariesCopyDirection { BoundaryToOverlap, OverlapToBoundary }; DistributedMeshSynchronizer() DistributedMeshSynchronizer() { { isSet = false; isSet = false; Loading Loading @@ -108,22 +114,9 @@ class DistributedMeshSynchronizer< Functions::MeshFunction< Grid< MeshDimension, sendBuffers[ i ].setSize( sendSize ); sendBuffers[ i ].setSize( sendSize ); recieveBuffers[ i ].setSize( sendSize); recieveBuffers[ i ].setSize( sendSize); //Periodic-BC copy from overlap into domain if( this->periodicBoundariesCopyDirection == OverlapToBoundary && //if Im on boundary, and i is direction of the boundary i will swap source and destination neighbors[ i ] == -1 ) //i do this only for basic 6 directions, swap( sendBegin[i], recieveBegin[i] ); //because this swap at conners and edges produces writing multiple values at sam place in localsubdomain { if( ( i==ZzYzXm || i==ZzYzXp ||i==ZzYmXz || i==ZzYpXz ||i==ZmYzXz || i==ZpYzXz ) && neighbors[ i ] == -1) { //swap begins CoordinatesType tmp = sendBegin[i]; sendBegin[i]=recieveBegin[i]; recieveBegin[i]=tmp; } } } } } } Loading Loading @@ -213,6 +206,8 @@ class DistributedMeshSynchronizer< Functions::MeshFunction< Grid< MeshDimension, Containers::Array<RealType, Device, Index> recieveBuffers[getNeighborCount()]; Containers::Array<RealType, Device, Index> recieveBuffers[getNeighborCount()]; Containers::StaticArray< getNeighborCount(), int > sendSizes; Containers::StaticArray< getNeighborCount(), int > sendSizes; PeriodicBoundariesCopyDirection periodicBoundariesCopyDirection = BoundaryToOverlap; CoordinatesType sendDimensions[getNeighborCount()]; CoordinatesType sendDimensions[getNeighborCount()]; CoordinatesType recieveDimensions[getNeighborCount()]; CoordinatesType recieveDimensions[getNeighborCount()]; CoordinatesType sendBegin[getNeighborCount()]; CoordinatesType sendBegin[getNeighborCount()]; Loading Loading
src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +12 −17 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,12 @@ class DistributedMeshSynchronizer< Functions::MeshFunction< Grid< MeshDimension, typedef typename DistributedGridType::CoordinatesType CoordinatesType; typedef typename DistributedGridType::CoordinatesType CoordinatesType; using SubdomainOverlapsType = typename DistributedGridType::SubdomainOverlapsType; using SubdomainOverlapsType = typename DistributedGridType::SubdomainOverlapsType; enum PeriodicBoundariesCopyDirection { BoundaryToOverlap, OverlapToBoundary }; DistributedMeshSynchronizer() DistributedMeshSynchronizer() { { isSet = false; isSet = false; Loading Loading @@ -108,22 +114,9 @@ class DistributedMeshSynchronizer< Functions::MeshFunction< Grid< MeshDimension, sendBuffers[ i ].setSize( sendSize ); sendBuffers[ i ].setSize( sendSize ); recieveBuffers[ i ].setSize( sendSize); recieveBuffers[ i ].setSize( sendSize); //Periodic-BC copy from overlap into domain if( this->periodicBoundariesCopyDirection == OverlapToBoundary && //if Im on boundary, and i is direction of the boundary i will swap source and destination neighbors[ i ] == -1 ) //i do this only for basic 6 directions, swap( sendBegin[i], recieveBegin[i] ); //because this swap at conners and edges produces writing multiple values at sam place in localsubdomain { if( ( i==ZzYzXm || i==ZzYzXp ||i==ZzYmXz || i==ZzYpXz ||i==ZmYzXz || i==ZpYzXz ) && neighbors[ i ] == -1) { //swap begins CoordinatesType tmp = sendBegin[i]; sendBegin[i]=recieveBegin[i]; recieveBegin[i]=tmp; } } } } } } Loading Loading @@ -213,6 +206,8 @@ class DistributedMeshSynchronizer< Functions::MeshFunction< Grid< MeshDimension, Containers::Array<RealType, Device, Index> recieveBuffers[getNeighborCount()]; Containers::Array<RealType, Device, Index> recieveBuffers[getNeighborCount()]; Containers::StaticArray< getNeighborCount(), int > sendSizes; Containers::StaticArray< getNeighborCount(), int > sendSizes; PeriodicBoundariesCopyDirection periodicBoundariesCopyDirection = BoundaryToOverlap; CoordinatesType sendDimensions[getNeighborCount()]; CoordinatesType sendDimensions[getNeighborCount()]; CoordinatesType recieveDimensions[getNeighborCount()]; CoordinatesType recieveDimensions[getNeighborCount()]; CoordinatesType sendBegin[getNeighborCount()]; CoordinatesType sendBegin[getNeighborCount()]; Loading