Commit 2009d5df authored by Mathis Kelm's avatar Mathis Kelm Committed by Timo Koch
Browse files

[test] Check if grid can communicate in tests

parent b8a6d8af
......@@ -31,6 +31,7 @@
#include <dumux/io/grid/gridmanager.hh>
#include <dumux/discretization/method.hh>
#include <dumux/common/gridcapabilities.hh>
namespace Dumux {
......@@ -287,9 +288,12 @@ private:
if (gridView.comm().size() > 1)
{
VertexHandleNonZeroMin<GridView> dataHandle(boundaryMarker, gridView);
gridView.communicate(dataHandle,
Dune::InteriorBorder_All_Interface,
Dune::ForwardCommunication);
if constexpr (Detail::canCommunicate<typename GridView::Traits::Grid, GridView::dimension>)
gridView.communicate(dataHandle,
Dune::InteriorBorder_All_Interface,
Dune::ForwardCommunication);
else
DUNE_THROW(Dune::InvalidStateException, "Cannot call getBoundaryMarkers_ on multiple processes for a grid that cannot communicate codim-" << GridView::dimension << "-entities");
}
}
};
......
......@@ -37,6 +37,7 @@
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/discretization/box/scvftoscvboundarytypes.hh>
#include <dumux/material/components/co2.hh>
#include <dumux/common/gridcapabilities.hh>
#include "co2tables.hh"
......@@ -235,9 +236,12 @@ public:
{
VectorCommDataHandleSum<typename GridGeometry::VertexMapper, std::vector<Scalar>, GridView::dimension>
sumVolumeHandle(this->gridGeometry().vertexMapper(), vtkBoxVolume_);
gridView.communicate(sumVolumeHandle,
Dune::InteriorBorder_InteriorBorder_Interface,
Dune::ForwardCommunication);
if constexpr (Detail::canCommunicate<typename GridView::Traits::Grid, GridView::dimension>)
gridView.communicate(sumVolumeHandle,
Dune::InteriorBorder_InteriorBorder_Interface,
Dune::ForwardCommunication);
else
DUNE_THROW(Dune::InvalidStateException, "Cannot call addFieldsToWriter on multiple processes for a grid that cannot communicate codim-" << GridView::dimension << "-entities.");
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment