Skip to content
Snippets Groups Projects
Commit 675024b2 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Tomáš Oberhuber
Browse files

[WIP] Fixing distributed grid MPI tests.

parent 6b9cd967
No related branches found
No related tags found
1 merge request!26Lbm
......@@ -163,6 +163,16 @@ class MeshFunction :
using Object::boundLoad;
DistributedMeshSynchronizerType& getSynchronizer()
{
return this->synchronizer;
}
const DistributedMeshSynchronizerType& getSynchronizer() const
{
return this->synchronizer;
}
template< typename CommunicatorType,
typename PeriodicBoundariesMaskType = MeshFunction< Mesh, MeshEntityDimension, bool > >
void synchronize( bool withPeriodicBoundaryConditions = false,
......@@ -171,8 +181,9 @@ class MeshFunction :
protected:
//DistributedMeshSynchronizerType synchronizer;
Meshes::DistributedMeshes::DistributedMeshSynchronizer< Functions::MeshFunction< MeshType, MeshEntityDimension, RealType > > synchronizer;
// TODO: synchronizer should not be part of the mesh function - the way of synchronization
// depends rather on algorithm/method/scheme in hand than on data
DistributedMeshSynchronizerType synchronizer;
MeshPointer meshPointer;
......@@ -182,7 +193,6 @@ class MeshFunction :
private:
void setupSynchronizer( DistributedMeshType *distributedMesh );
};
template< typename Mesh,
......
......@@ -66,6 +66,11 @@ class DistributedMeshSynchronizer< Functions::MeshFunction< Grid< MeshDimension,
setDistributedGrid( distributedGrid );
};
void setPeriodicBoundariesCopyDirection( const PeriodicBoundariesCopyDirection dir )
{
this->periodicBoundariesCopyDirection = dir;
}
void setDistributedGrid( DistributedGridType *distributedGrid )
{
isSet = true;
......
......@@ -256,6 +256,8 @@ TEST_F(DistributedGridTest_1D, SynchronizePeriodicNeighborsWithoutMask )
setDof_1D( dof, -rank-1 );
maskDofs.setValue( true );
constFunctionEvaluator.evaluateAllEntities( meshFunctionPtr, constFunctionPtr );
using Synchronizer = decltype( meshFunctionPtr->getSynchronizer() );
meshFunctionPtr->getSynchronizer().setPeriodicBoundariesCopyDirection( Synchronizer::OverlapToBoundary );
meshFunctionPtr->template synchronize<CommunicatorType>( true );
if( rank == 0 )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment