Loading src/TNL/Meshes/DistributedMeshes/BufferEntitiesHelper.h +24 −12 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <TNL/Devices/Host.h> #include <TNL/Devices/Cuda.h> #include <TNL/ParallelFor.h> #include <TNL/Containers/StaticVector.h> namespace TNL { namespace Meshes { Loading Loading @@ -43,10 +44,14 @@ class BufferEntitiesHelper< MeshFunctionType, MaskPointer, 1, RealType, Device, const MaskPointer& maskPointer, RealType* buffer, bool isBoundary, const Index& beginx, const Index& sizex, const Containers::StaticVector<1,Index>& begin, const Containers::StaticVector<1,Index>& size, bool tobuffer ) { Index beginx=begin.x(); Index sizex=size.x(); auto mesh = meshFunction.getMesh(); RealType* meshFunctionData = meshFunction.getData().getData(); const typename MaskPointer::ObjectType* mask( nullptr ); Loading Loading @@ -83,12 +88,16 @@ class BufferEntitiesHelper< MeshFunctionType, MaskPointer, 2, RealType, Device, const MaskPointer& maskPointer, RealType* buffer, bool isBoundary, const Index& beginx, const Index& beginy, const Index& sizex, const Index& sizey, const Containers::StaticVector<2,Index>& begin, const Containers::StaticVector<2,Index>& size, bool tobuffer) { Index beginx=begin.x(); Index beginy=begin.y(); Index sizex=size.x(); Index sizey=size.y(); auto mesh=meshFunction.getMesh(); RealType* meshFunctionData = meshFunction.getData().getData(); const typename MaskPointer::ObjectType* mask( nullptr ); Loading Loading @@ -127,15 +136,18 @@ class BufferEntitiesHelper< MeshFunctionType, MaskPointer, 3, RealType, Device, const MaskPointer& maskPointer, RealType* buffer, bool isBoundary, const Index& beginx, const Index& beginy, const Index& beginz, const Index& sizex, const Index& sizey, const Index& sizez, const Containers::StaticVector<3,Index>& begin, const Containers::StaticVector<3,Index>& size, bool tobuffer) { Index beginx=begin.x(); Index beginy=begin.y(); Index beginz=begin.z(); Index sizex=size.x(); Index sizey=size.y(); Index sizez=size.z(); auto mesh=meshFunction.getMesh(); RealType * meshFunctionData=meshFunction.getData().getData(); const typename MaskPointer::ObjectType* mask( nullptr ); Loading src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +2 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,6 @@ #pragma once #include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_1D.h> #include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_2D.h> //#include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_1D.h> //#include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_2D.h> #include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_3D.h> src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_3D.h +111 −205 File changed.Preview size limit exceeded, changes collapsed. Show changes src/UnitTests/Meshes/DistributedMeshes/DistributedGridTest_1D.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ class DistributedGridTest_1D : public ::testing::Test delete distributedGrid; } }; /* TEST_F( DistributedGridTest_1D, isBoundaryDomainTest ) { if( rank == 0 || rank == nproc - 1 ) Loading Loading @@ -209,20 +209,21 @@ TEST_F(DistributedGridTest_1D, evaluateInteriorEntities) check_Overlap_1D(rank, nproc, dof, -1); check_Inner_1D(rank, nproc, dof, rank); } */ TEST_F(DistributedGridTest_1D, SynchronizerNeighborsTest ) { setDof_1D(dof,-1); constFunctionEvaluator.evaluateAllEntities( meshFunctionPtr , constFunctionPtr ); meshFunctionPtr->template synchronize<CommunicatorType>(); std::cout << rank << dof << std::endl; if(rank!=0) EXPECT_EQ((dof)[0],rank-1)<< "Left Overlap was filled by wrong process."; if(rank!=nproc-1) EXPECT_EQ((dof)[dof.getSize()-1],rank+1)<< "Right Overlap was filled by wrong process."; } /* TEST_F(DistributedGridTest_1D, EvaluateLinearFunction ) { //fill mesh function with linear function (physical center of cell corresponds with its coordinates in grid) Loading @@ -237,9 +238,9 @@ TEST_F(DistributedGridTest_1D, EvaluateLinearFunction ) auto entity2= gridptr->template getEntity< Cell >((dof).getSize()-1); entity2.refresh(); EXPECT_EQ(meshFunctionPtr->getValue(entity), (*linearFunctionPtr)(entity)) << "Linear function Overlap error on right Edge."; } }*/ /* TEST_F(DistributedGridTest_1D, SynchronizePeriodicNeighborsWithoutMask ) { // Setup periodic boundaries Loading Loading @@ -374,7 +375,7 @@ TEST_F(DistributedGridTest_1D, SynchronizePeriodicBoundariesLinearTest ) if( rank == nproc - 1 ) EXPECT_EQ( meshFunctionPtr->getValue(entity2), -1 ) << "Linear function Overlap error on right Edge."; } */ #else Loading src/UnitTests/Meshes/DistributedMeshes/DistributedGridTest_3D.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -663,7 +663,7 @@ class DistributedGirdTest_3D : public ::testing::Test delete distributedGrid; } }; /* TEST_F(DistributedGirdTest_3D, evaluateAllEntities) { Loading Loading @@ -695,7 +695,7 @@ TEST_F(DistributedGirdTest_3D, evaluateInteriorEntities) check_Boundary_3D(rank, *gridptr, *dof, -1); check_Overlap_3D(rank, *gridptr, *dof, -1); check_Inner_3D(rank, *gridptr, *dof, rank); } } */ TEST_F(DistributedGirdTest_3D, LinearFunctionTest) { Loading Loading
src/TNL/Meshes/DistributedMeshes/BufferEntitiesHelper.h +24 −12 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <TNL/Devices/Host.h> #include <TNL/Devices/Cuda.h> #include <TNL/ParallelFor.h> #include <TNL/Containers/StaticVector.h> namespace TNL { namespace Meshes { Loading Loading @@ -43,10 +44,14 @@ class BufferEntitiesHelper< MeshFunctionType, MaskPointer, 1, RealType, Device, const MaskPointer& maskPointer, RealType* buffer, bool isBoundary, const Index& beginx, const Index& sizex, const Containers::StaticVector<1,Index>& begin, const Containers::StaticVector<1,Index>& size, bool tobuffer ) { Index beginx=begin.x(); Index sizex=size.x(); auto mesh = meshFunction.getMesh(); RealType* meshFunctionData = meshFunction.getData().getData(); const typename MaskPointer::ObjectType* mask( nullptr ); Loading Loading @@ -83,12 +88,16 @@ class BufferEntitiesHelper< MeshFunctionType, MaskPointer, 2, RealType, Device, const MaskPointer& maskPointer, RealType* buffer, bool isBoundary, const Index& beginx, const Index& beginy, const Index& sizex, const Index& sizey, const Containers::StaticVector<2,Index>& begin, const Containers::StaticVector<2,Index>& size, bool tobuffer) { Index beginx=begin.x(); Index beginy=begin.y(); Index sizex=size.x(); Index sizey=size.y(); auto mesh=meshFunction.getMesh(); RealType* meshFunctionData = meshFunction.getData().getData(); const typename MaskPointer::ObjectType* mask( nullptr ); Loading Loading @@ -127,15 +136,18 @@ class BufferEntitiesHelper< MeshFunctionType, MaskPointer, 3, RealType, Device, const MaskPointer& maskPointer, RealType* buffer, bool isBoundary, const Index& beginx, const Index& beginy, const Index& beginz, const Index& sizex, const Index& sizey, const Index& sizez, const Containers::StaticVector<3,Index>& begin, const Containers::StaticVector<3,Index>& size, bool tobuffer) { Index beginx=begin.x(); Index beginy=begin.y(); Index beginz=begin.z(); Index sizex=size.x(); Index sizey=size.y(); Index sizez=size.z(); auto mesh=meshFunction.getMesh(); RealType * meshFunctionData=meshFunction.getData().getData(); const typename MaskPointer::ObjectType* mask( nullptr ); Loading
src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +2 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,6 @@ #pragma once #include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_1D.h> #include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_2D.h> //#include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_1D.h> //#include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_2D.h> #include <TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_3D.h>
src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer_3D.h +111 −205 File changed.Preview size limit exceeded, changes collapsed. Show changes
src/UnitTests/Meshes/DistributedMeshes/DistributedGridTest_1D.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ class DistributedGridTest_1D : public ::testing::Test delete distributedGrid; } }; /* TEST_F( DistributedGridTest_1D, isBoundaryDomainTest ) { if( rank == 0 || rank == nproc - 1 ) Loading Loading @@ -209,20 +209,21 @@ TEST_F(DistributedGridTest_1D, evaluateInteriorEntities) check_Overlap_1D(rank, nproc, dof, -1); check_Inner_1D(rank, nproc, dof, rank); } */ TEST_F(DistributedGridTest_1D, SynchronizerNeighborsTest ) { setDof_1D(dof,-1); constFunctionEvaluator.evaluateAllEntities( meshFunctionPtr , constFunctionPtr ); meshFunctionPtr->template synchronize<CommunicatorType>(); std::cout << rank << dof << std::endl; if(rank!=0) EXPECT_EQ((dof)[0],rank-1)<< "Left Overlap was filled by wrong process."; if(rank!=nproc-1) EXPECT_EQ((dof)[dof.getSize()-1],rank+1)<< "Right Overlap was filled by wrong process."; } /* TEST_F(DistributedGridTest_1D, EvaluateLinearFunction ) { //fill mesh function with linear function (physical center of cell corresponds with its coordinates in grid) Loading @@ -237,9 +238,9 @@ TEST_F(DistributedGridTest_1D, EvaluateLinearFunction ) auto entity2= gridptr->template getEntity< Cell >((dof).getSize()-1); entity2.refresh(); EXPECT_EQ(meshFunctionPtr->getValue(entity), (*linearFunctionPtr)(entity)) << "Linear function Overlap error on right Edge."; } }*/ /* TEST_F(DistributedGridTest_1D, SynchronizePeriodicNeighborsWithoutMask ) { // Setup periodic boundaries Loading Loading @@ -374,7 +375,7 @@ TEST_F(DistributedGridTest_1D, SynchronizePeriodicBoundariesLinearTest ) if( rank == nproc - 1 ) EXPECT_EQ( meshFunctionPtr->getValue(entity2), -1 ) << "Linear function Overlap error on right Edge."; } */ #else Loading
src/UnitTests/Meshes/DistributedMeshes/DistributedGridTest_3D.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -663,7 +663,7 @@ class DistributedGirdTest_3D : public ::testing::Test delete distributedGrid; } }; /* TEST_F(DistributedGirdTest_3D, evaluateAllEntities) { Loading Loading @@ -695,7 +695,7 @@ TEST_F(DistributedGirdTest_3D, evaluateInteriorEntities) check_Boundary_3D(rank, *gridptr, *dof, -1); check_Overlap_3D(rank, *gridptr, *dof, -1); check_Inner_3D(rank, *gridptr, *dof, rank); } } */ TEST_F(DistributedGirdTest_3D, LinearFunctionTest) { Loading