Commit 121bba76 authored by Dennis Gläser's avatar Dennis Gläser Committed by Timo Koch
Browse files

[multidomain][facet] introduce grid manager and pull out grid data

parent 370b660e
......@@ -8,6 +8,6 @@ couplingmapper.hh
couplingmapperbase.hh
enrichmenthelper.hh
gmshreader.hh
gridcreator.hh
gridmanager.hh
vertexmapper.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/multidomain/facet)
......@@ -69,16 +69,16 @@ public:
*
* \param bulkFvGridGeometry The finite-volume grid geometry of the bulk grid
* \param lowDimFvGridGeometry The finite-volume grid geometry of the lower-dimensional grid
* \param gridCreator Class that contains the grid factories and embedments
* \param gridManager Class that contains the embedments and allows obtaining entity insertion indices
*/
template< class GridCreator >
template< class GridManager >
void update(const BulkFVG& bulkFvGridGeometry,
const LowDimFVG& lowDimFvGridGeometry,
const GridCreator& gridCreator)
const GridManager& gridManager)
{
// forward to update function with instantiated vertex adapter
using GridAdapter = CodimOneGridAdapter<GridCreator, bulkGridId, facetGridId>;
update(bulkFvGridGeometry, lowDimFvGridGeometry, gridCreator, GridAdapter{gridCreator});
using GridAdapter = CodimOneGridAdapter<GridManager, bulkGridId, facetGridId>;
update(bulkFvGridGeometry, lowDimFvGridGeometry, gridManager, GridAdapter{gridManager});
}
/*!
* \brief Update coupling maps. This is the standard
......@@ -86,13 +86,13 @@ public:
*
* \param bulkFvGridGeometry The finite-volume grid geometry of the bulk grid
* \param lowDimFvGridGeometry The finite-volume grid geometry of the lower-dimensional grid
* \param gridCreator Class that contains the grid factories and embedments
* \param gridManager Class that contains the embedments and allows obtaining entity insertion indices
* \param codimOneGridAdapter Allows direct access to data on the bulk grid for lowdim grid entities
*/
template< class GridCreator, class CodimOneGridAdapter >
template< class GridManager, class CodimOneGridAdapter >
void update(const BulkFVG& bulkFvGridGeometry,
const LowDimFVG& lowDimFvGridGeometry,
const GridCreator& gridCreator,
const GridManager& gridManager,
const CodimOneGridAdapter& codimOneGridAdapter)
{
// define the execution policy how to add map entries from an embedment
......@@ -204,7 +204,7 @@ public:
};
// let the parent do the update subject to the execution policy defined above
ParentType::update_(bulkFvGridGeometry, lowDimFvGridGeometry, gridCreator, addEmbedmentPolicy);
ParentType::update_(bulkFvGridGeometry, lowDimFvGridGeometry, gridManager, addEmbedmentPolicy);
// coupling stencils might not be unique with the policy above
auto makeStencilUnique = [] (auto& data)
......
......@@ -62,12 +62,12 @@ public:
*
* \param bulkFvGridGeometry The finite-volume grid geometry of the bulk grid
* \param lowDimFvGridGeometry The finite-volume grid geometry of the lower-dimensional grid
* \param gridCreator Class that contains the grid factories and embedments
* \param gridManager Class that contains the embedments and allows obtaining entity insertion indices
*/
template< class GridCreator >
template< class GridManager >
void update(const BulkFVG& bulkFvGridGeometry,
const LowDimFVG& lowDimFvGridGeometry,
const GridCreator& gridCreator)
const GridManager& gridManager)
{
// define the execution policy how to add map entries from an embedment
auto addEmbedmentPolicy = [&] (auto&& embedments,
......@@ -150,7 +150,7 @@ public:
};
// let the parent do the update subject to the execution policy defined above
ParentType::update_(bulkFvGridGeometry, lowDimFvGridGeometry, gridCreator, addEmbedmentPolicy);
ParentType::update_(bulkFvGridGeometry, lowDimFvGridGeometry, gridManager, addEmbedmentPolicy);
// coupling stencils might not be unique if box is used in lowdim domain
if (LowDimFVG::discMethod == DiscretizationMethod::box)
......
......@@ -40,22 +40,22 @@ namespace Dumux {
* d-dimensional grid. This class can be used in the context of models where
* a sub-domain lives on the facets of a bulk grid.
*
* \tparam GridCreator A grid creator containing a hierarchy of facet-conforming grids.
* \tparam GridManager A grid manager containing a hierarchy of facet-conforming grids.
* \tparam bulkGridId The grid id of the d-dimensional grid within the hierarchy
* \tparam facetGridId The grid id of the (d-1)-dimensional grid within the hierarchy
*/
template<class GridCreator, int bulkGridId = 0, int facetGridId = 1>
template<class GridManager, int bulkGridId = 0, int facetGridId = 1>
class CodimOneGridAdapter
{
// Extract some types of the facet-conforming grid of codimension one
using FacetGrid = typename GridCreator::template Grid<facetGridId>;
using FacetGrid = typename GridManager::template Grid<facetGridId>;
using FacetGridView = typename FacetGrid::LeafGridView;
using FacetGridVertex = typename FacetGridView::template Codim<FacetGrid::dimension>::Entity;
using FacetGridElement = typename FacetGridView::template Codim<0>::Entity;
using FacetGridIndexType = typename FacetGridView::IndexSet::IndexType;
// Extract some types of the bulk grid
using BulkGrid = typename GridCreator::template Grid<bulkGridId>;
using BulkGrid = typename GridManager::template Grid<bulkGridId>;
using BulkGridView = typename BulkGrid::LeafGridView;
using BulkMapper = Dune::MultipleCodimMultipleGeomTypeMapper<BulkGridView>;
using BulkReferenceElements = typename Dune::ReferenceElements<typename BulkGridView::ctype, BulkGrid::dimension>;
......@@ -65,7 +65,7 @@ class CodimOneGridAdapter
using BulkIndexType = typename BulkGridView::IndexSet::IndexType;
// Find out if the given bulk grid is the one with highest dimensionality among the created grids
static constexpr bool bulkHasHighestDimension = (int(BulkGrid::dimension) == GridCreator::bulkDim);
static constexpr bool bulkHasHighestDimension = (int(BulkGrid::dimension) == GridManager::bulkDim);
// check if provided id combination makes sense
static_assert( int(FacetGrid::dimension) == int(BulkGrid::dimension) - 1,
......@@ -76,28 +76,28 @@ class CodimOneGridAdapter
public:
//! The constructor
CodimOneGridAdapter(const GridCreator& gridCreator)
: gridCreatorPtr_(&gridCreator)
, bulkVertexMapper_(gridCreator.template grid<bulkGridId>().leafGridView(), Dune::mcmgVertexLayout())
CodimOneGridAdapter(const GridManager& gridManager)
: gridManagerPtr_(&gridManager)
, bulkVertexMapper_(gridManager.template grid<bulkGridId>().leafGridView(), Dune::mcmgVertexLayout())
{
// bulk insertion to grid index map
const auto& bulkGridView = gridCreator.template grid<bulkGridId>().leafGridView();
const auto& bulkGridFactory = gridCreatorPtr_->template gridFactory<bulkGridId>();
const auto& bulkGridView = gridManager.template grid<bulkGridId>().leafGridView();
const auto& bulkGridFactory = gridManagerPtr_->template gridFactory<bulkGridId>();
bulkInsertionToGridVIdx_.resize(bulkGridView.size(BulkGrid::dimension));
for (const auto& v : vertices(bulkGridView))
bulkInsertionToGridVIdx_[ bulkGridFactory.insertionIndex(v) ] = bulkVertexMapper_.index(v);
// maybe set up index map from hierachy insertion to bulk insertion indices
makeBulkIndexMap_(gridCreator);
makeBulkIndexMap_(gridManager);
// determine which bulk vertices lie on facet elements
bulkVertexIsOnFacetGrid_.resize(bulkGridView.size(BulkGrid::dimension), false);
const auto& facetGridView = gridCreator.template grid<facetGridId>().leafGridView();
const auto& facetGridFactory = gridCreatorPtr_->template gridFactory<facetGridId>();
const auto& facetGridView = gridManager.template grid<facetGridId>().leafGridView();
const auto& facetGridFactory = gridManager.template gridFactory<facetGridId>();
for (const auto& v : vertices(facetGridView))
{
const auto insIdx = facetGridFactory.insertionIndex(v);
const auto highestLevelInsIdx = gridCreatorPtr_->lowDimVertexIndices(facetGridId)[insIdx];
const auto highestLevelInsIdx = gridManager.lowDimVertexIndices(facetGridId)[insIdx];
const auto bulkGridIdx = getBulkGridVertexIndex_(highestLevelInsIdx);
bulkVertexIsOnFacetGrid_[ bulkGridIdx ] = true;
}
......@@ -138,8 +138,8 @@ public:
*/
BulkIndexType bulkGridVertexIndex(const FacetGridVertex& v) const
{
const auto insIdx = gridCreatorPtr_->template gridFactory<facetGridId>().insertionIndex(v);
const auto highestLevelInsIdx = gridCreatorPtr_->lowDimVertexIndices(facetGridId)[insIdx];
const auto insIdx = gridManagerPtr_->template gridFactory<facetGridId>().insertionIndex(v);
const auto highestLevelInsIdx = gridManagerPtr_->lowDimVertexIndices(facetGridId)[insIdx];
return getBulkGridVertexIndex_(highestLevelInsIdx);
}
......@@ -149,7 +149,7 @@ public:
*/
bool isOnFacetGrid(const BulkGridVertex& v) const
{
const auto bulkInsIdx = gridCreatorPtr_->template gridFactory<bulkGridId>().insertionIndex(v);
const auto bulkInsIdx = gridManagerPtr_->template gridFactory<bulkGridId>().insertionIndex(v);
const auto bulkVIdx = bulkInsertionToGridVIdx_[bulkInsIdx];
return bulkVertexIsOnFacetGrid_[bulkVIdx];
}
......@@ -230,29 +230,29 @@ public:
* given (d-1)-dimensional element is embedded in
*/
std::size_t numEmbedments(const FacetGridElement& e) const
{ return gridCreatorPtr_->template embedmentEntityIndices<facetGridId>(e).size(); }
{ return gridManagerPtr_->template embedmentEntityIndices<facetGridId>(e).size(); }
private:
//! Determine map from the insertion idx of the highest-dimensional grid to bulk insertion idx
template< bool isHighest = bulkHasHighestDimension, std::enable_if_t<!isHighest, int> = 0 >
void makeBulkIndexMap_(const GridCreator& gridCreator)
void makeBulkIndexMap_(const GridManager& gridManager)
{
// obtain highest-dimensional grid using the bulkId from grid creator
const auto& highestLevelGridView = gridCreator.template grid<GridCreator::bulkGridId>().leafGridView();
highestLevelInsertionToBulkInsertionIdx_.resize(highestLevelGridView.size(GridCreator::bulkDim));
const auto& highestLevelGridView = gridManager.template grid<GridManager::bulkGridId>().leafGridView();
highestLevelInsertionToBulkInsertionIdx_.resize(highestLevelGridView.size(GridManager::bulkDim));
// indices in grid creator stem from the grid file, which has one set of vertices
// for the entire hierarchy. Thus, the vertex indices we obtain from the grid creator
// that make up this bulk grid (lower-dimensional within the hierarchy), correspond to
// the highest-dimensional grid's insertion indices.
const auto& vertexInsIndices = gridCreatorPtr_->lowDimVertexIndices(bulkGridId);
const auto& vertexInsIndices = gridManager.lowDimVertexIndices(bulkGridId);
for (std::size_t insIdx = 0; insIdx < vertexInsIndices.size(); ++insIdx)
highestLevelInsertionToBulkInsertionIdx_[ vertexInsIndices[insIdx] ] = insIdx;
}
//! If the given bulk grid is on the highest level of grid creation, we do not need the map
template< bool isHighest = bulkHasHighestDimension, std::enable_if_t<isHighest, int> = 0 >
void makeBulkIndexMap_(const GridCreator& gridCreator)
void makeBulkIndexMap_(const GridManager& gridManager)
{}
//! Obtains the bulk grid vertex index from a given insertion index on the hierarchy
......@@ -264,7 +264,7 @@ private:
}
// pointer to the grid creator
const GridCreator* gridCreatorPtr_;
const GridManager* gridManagerPtr_;
// vertex mapper of the bulk grid
BulkMapper bulkVertexMapper_;
......
......@@ -113,16 +113,16 @@ public:
* \param bulkFvGridGeometry The finite-volume grid geometry of the bulk grid
* \param facetFvGridGeometry The finite-volume grid geometry of the codimension-one grid
* \param edgeFvGridGeometry The finite-volume grid geometry of the codimension-two grid
* \param gridCreator Class that contains the grid factories and embedments
* \param gridManager Class that contains the embedments and allows obtaining entity insertion indices
*/
template< class GridCreator >
template< class GridManager >
void update(const BulkFVG& bulkFvGridGeometry,
const FacetFVG& facetFvGridGeometry,
const EdgeFVG& edgeFvGridGeometry,
const GridCreator& gridCreator)
const GridManager& gridManager)
{
BulkFacetMapper::update(bulkFvGridGeometry, facetFvGridGeometry, gridCreator);
FacetEdgeMapper::update(facetFvGridGeometry, edgeFvGridGeometry, gridCreator);
BulkFacetMapper::update(bulkFvGridGeometry, facetFvGridGeometry, gridManager);
FacetEdgeMapper::update(facetFvGridGeometry, edgeFvGridGeometry, gridManager);
}
//! Pull up the parents' access operators to allow for individual updates
......
......@@ -64,11 +64,11 @@ class FacetCouplingMapperBase
static constexpr auto bulkDiscMethod = BulkFVG::discMethod;
// helper struct to check validity of the given domain id offset
template< class GridCreator >
class IsValidGridCreator
template< class GridManager >
class IsValidGridManager
{
using GCBulkGridView = typename GridCreator::template Grid<bulkId>::LeafGridView;
using GCLowDimGridView = typename GridCreator::template Grid<lowDimId>::LeafGridView;
using GCBulkGridView = typename GridManager::template Grid<bulkId>::LeafGridView;
using GCLowDimGridView = typename GridManager::template Grid<lowDimId>::LeafGridView;
static constexpr bool bulkMatch = std::is_same<GCBulkGridView, BulkGridView>::value;
static constexpr bool lowDimMatch = std::is_same<GCLowDimGridView, LowDimGridView>::value;
static_assert(bulkMatch, "The bulk domain id does not match the provided bulk grid geometry");
......@@ -145,10 +145,10 @@ public:
* \brief Update coupling maps. This is the standard interface
* and has to be overloaded by the implementation.
*/
template< class GridCreator >
template< class GridManager >
void update(const BulkFVG& bulkFvGridGeometry,
const LowDimFVG& lowDimFvGridGeometry,
const GridCreator& gridCreator)
const GridManager& gridManager)
{ DUNE_THROW(Dune::NotImplemented, "Implementation does not provide an update() function."); }
//! returns coupling data for bulk -> lowDim
......@@ -166,30 +166,30 @@ protected:
*
* \param bulkFvGridGeometry The finite-volume grid geometry of the bulk grid
* \param lowDimFvGridGeometry The finite-volume grid geometry of the lower-dimensional grid
* \param gridCreator Class that contains the grid factories and embedments
* \param gridManager Class that contains the embedments and allows obtaining entity insertion indices
* \param EmbedmentExecutionPolicy Policy for adding coupling entries for embedments
*/
template< class GridCreator, typename EmbedmentExecutionPolicy >
template< class GridManager, typename EmbedmentExecutionPolicy >
void update_(const BulkFVG& bulkFvGridGeometry,
const LowDimFVG& lowDimFvGridGeometry,
const GridCreator& gridCreator,
const GridManager& gridManager,
EmbedmentExecutionPolicy&& embedmentPolicy)
{
// some static assertions on the grid creator
static_assert(IsValidGridCreator< GridCreator >::value, "Grid type mismatch. Please review the provided domain id offset.");
static_assert(IsValidGridManager< GridManager >::value, "Grid type mismatch. Please review the provided domain id offset.");
// clear data
bulkCouplingData_.clear();
lowDimCouplingData_.clear();
// set up maps between element indices and insertion indices
const auto& bulkGridFactory = gridCreator.template gridFactory<bulkId>();
const auto& bulkGridFactory = gridManager.template gridFactory<bulkId>();
const auto bulkInsertionToElemIdxMap = makeInsertionToGridIndexMap_(bulkGridFactory, bulkFvGridGeometry);
// set up coupling maps coming from the low dim domain
for (const auto& element : elements(lowDimFvGridGeometry.gridView()))
{
auto embedments = gridCreator.template embedmentEntityIndices<lowDimId>(element);
auto embedments = gridManager.template embedmentEntityIndices<lowDimId>(element);
// proceed only if embedments were found
if (embedments.size() == 0)
......
......@@ -52,25 +52,24 @@ namespace Dumux {
* then be interpreted as boundary segments. Use respective physical entity
* indexing in your grid file in that case.
*
* \tparam GCTraits The type traits of the grid creator class
* \tparam BulkGrid The type of the highest-dimensional grid in the hierachy
* \tparam IndexType The index type to be used
* \tparam numGrids The number of grids to be considered in the hierarchy
*/
template<typename GCTraits>
template <class BulkGrid, class IndexType, int numGrids>
class FacetCouplingGmshReader
{
// extract some necessary info from bulk grid
using BulkGrid = typename GCTraits::BulkGrid;
static constexpr int bulkDim = BulkGrid::dimension;
static constexpr int bulkDimWorld = BulkGrid::dimensionworld;
using ctype = typename BulkGrid::ctype;
using GlobalPosition = Dune::FieldVector<ctype, bulkDimWorld>;
// determine minimum dimension for which a grid is created
static constexpr int numGrids = GCTraits::numGrids;
static constexpr int minGridDim = BulkGrid::dimension - numGrids + 1;
static_assert(minGridDim >= 1, "Grids with dim < 1 cannot be read!");
// structure to store data on an element
using IndexType = typename GCTraits::IndexType;
using VertexIndexSet = std::vector<IndexType>;
struct ElementData
{
......@@ -302,28 +301,28 @@ public:
}
//! Returns the maps of element markers
typename GCTraits::ElementToDomainMarkerMap& elementMarkerMap(std::size_t id)
std::vector<int>& elementMarkerMap(std::size_t id)
{
assert(id < numGrids && "Index exceeds number of grids provided");
return elementMarkerMaps_[id];
}
//! Returns the maps of domain markers
typename GCTraits::BoundarySegmentToMarkerMap& boundaryMarkerMap(std::size_t id)
std::vector<int>& boundaryMarkerMap(std::size_t id)
{
assert(id < numGrids && "Index exceeds number of grids provided");
return boundaryMarkerMaps_[id];
}
//! Returns the maps of the embedded entities
typename GCTraits::EmbeddedEntityMap& embeddedEntityMap(std::size_t id)
std::unordered_map< IndexType, std::vector<IndexType> >& embeddedEntityMap(std::size_t id)
{
assert(id < numGrids && "Index exceeds number of grids provided");
return embeddedEntityMaps_[id];
}
//! Returns the maps of the embedments
typename GCTraits::EmbedmentMap& embedmentMap(std::size_t id)
std::unordered_map< IndexType, std::vector<IndexType> >& embedmentMap(std::size_t id)
{
assert(id < numGrids && "Index exceeds number of grids provided");
return embedmentMaps_[id];
......@@ -415,12 +414,12 @@ private:
std::array<std::vector<VertexIndexSet>, numGrids> boundarySegments_;
//! data on connectivity between the grids
std::array< typename GCTraits::EmbeddedEntityMap, numGrids > embeddedEntityMaps_;
std::array< typename GCTraits::EmbedmentMap, numGrids > embedmentMaps_;
std::array< std::unordered_map< IndexType, std::vector<IndexType> >, numGrids > embeddedEntityMaps_;
std::array< std::unordered_map< IndexType, std::vector<IndexType> >, numGrids > embedmentMaps_;
//! data on domain and boundary markers
std::array< typename GCTraits::ElementToDomainMarkerMap, numGrids > elementMarkerMaps_;
std::array< typename GCTraits::BoundarySegmentToMarkerMap, numGrids > boundaryMarkerMaps_;
std::array< std::vector<int>, numGrids > elementMarkerMaps_;
std::array< std::vector<int>, numGrids > boundaryMarkerMaps_;
};
} // end namespace Dumux
......
......@@ -46,7 +46,7 @@
#include <dumux/multidomain/fvassembler.hh>
#include <dumux/multidomain/traits.hh>
#include <dumux/multidomain/facet/gridcreator.hh>
#include <dumux/multidomain/facet/gridmanager.hh>
#include <dumux/multidomain/facet/couplingmapper.hh>
#include <dumux/multidomain/facet/couplingmanager.hh>
#include <dumux/multidomain/facet/codimonegridadapter.hh>
......@@ -157,24 +157,24 @@ computeL2Norm(const GridView& gridView,
// the update. The reason is that we have to create additional faces on interior
// boundaries, which wouldn't be created in the standard scheme.
template< class FVGridGeometry,
class GridCreator,
class GridManager,
class LowDimGridView,
std::enable_if_t<FVGridGeometry::discMethod == Dumux::DiscretizationMethod::box, int> = 0 >
void updateBulkFVGridGeometry(FVGridGeometry& fvGridGeometry,
const GridCreator& gridCreator,
const GridManager& gridManager,
const LowDimGridView& lowDimGridView)
{
Dumux::CodimOneGridAdapter<GridCreator> facetGridAdapter(gridCreator);
Dumux::CodimOneGridAdapter<GridManager> facetGridAdapter(gridManager);
fvGridGeometry.update(lowDimGridView, facetGridAdapter);
}
// specialization for cell-centered schemes
template< class FVGridGeometry,
class GridCreator,
class GridManager,
class LowDimGridView,
std::enable_if_t<FVGridGeometry::discMethod != Dumux::DiscretizationMethod::box, int> = 0 >
void updateBulkFVGridGeometry(FVGridGeometry& fvGridGeometry,
const GridCreator& gridCreator,
const GridManager& gridManager,
const LowDimGridView& lowDimGridView)
{
fvGridGeometry.update();
......@@ -206,25 +206,25 @@ int main(int argc, char** argv) try
using BulkGrid = typename GET_PROP_TYPE(BulkProblemTypeTag, Grid);
using LowDimGrid = typename GET_PROP_TYPE(LowDimProblemTypeTag, Grid);
using GridCreator = FacetCouplingGridCreator<BulkGrid, LowDimGrid>;
GridCreator gridCreator;
gridCreator.makeGrids(getParam<std::string>("Grid.File"));
gridCreator.loadBalance();
using GridManager = FacetCouplingGridManager<BulkGrid, LowDimGrid>;
GridManager gridManager;
gridManager.init();
gridManager.loadBalance();
////////////////////////////////////////////////////////////
// run stationary, non-linear problem on this grid
////////////////////////////////////////////////////////////
// we compute on the leaf grid views
const auto& bulkGridView = gridCreator.template grid<0>().leafGridView();
const auto& lowDimGridView = gridCreator.template grid<1>().leafGridView();
const auto& bulkGridView = gridManager.template grid<0>().leafGridView();
const auto& lowDimGridView = gridManager.template grid<1>().leafGridView();
// create the finite volume grid geometries
using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkProblemTypeTag, FVGridGeometry);
using LowDimFVGridGeometry = typename GET_PROP_TYPE(LowDimProblemTypeTag, FVGridGeometry);
auto bulkFvGridGeometry = std::make_shared<BulkFVGridGeometry>(bulkGridView);
auto lowDimFvGridGeometry = std::make_shared<LowDimFVGridGeometry>(lowDimGridView);
updateBulkFVGridGeometry(*bulkFvGridGeometry, gridCreator, lowDimGridView);
updateBulkFVGridGeometry(*bulkFvGridGeometry, gridManager, lowDimGridView);
lowDimFvGridGeometry->update();
// the problems (boundary conditions)
......@@ -250,7 +250,7 @@ int main(int argc, char** argv) try
// the coupling mapper
auto couplingMapper = std::make_shared<typename TestTraits::CouplingMapper>();
couplingMapper->update(*bulkFvGridGeometry, *lowDimFvGridGeometry, gridCreator);
couplingMapper->update(*bulkFvGridGeometry, *lowDimFvGridGeometry, gridManager);
// the coupling manager
using CouplingManager = typename TestTraits::CouplingManager;
......
......@@ -43,7 +43,7 @@
#include <dumux/multidomain/fvassembler.hh>
#include <dumux/multidomain/traits.hh>
#include <dumux/multidomain/facet/gridcreator.hh>
#include <dumux/multidomain/facet/gridmanager.hh>
#include <dumux/multidomain/facet/couplingmapper.hh>
#include <dumux/multidomain/facet/couplingmanager.hh>
......@@ -100,19 +100,19 @@ int main(int argc, char** argv) try
using FacetGrid = typename GET_PROP_TYPE(FacetProblemTypeTag, Grid);
using EdgeGrid = typename GET_PROP_TYPE(EdgeProblemTypeTag, Grid);
using GridCreator = FacetCouplingGridCreator<BulkGrid, FacetGrid, EdgeGrid>;
GridCreator gridCreator;
gridCreator.makeGrids(getParam<std::string>("Grid.File"));
gridCreator.loadBalance();
using GridManager = FacetCouplingGridManager<BulkGrid, FacetGrid, EdgeGrid>;
GridManager gridManager;
gridManager.init();
gridManager.loadBalance();
////////////////////////////////////////////////////////////
// run stationary non-linear problem on this grid
////////////////////////////////////////////////////////////
// we compute on the leaf grid views
const auto& bulkGridView = gridCreator.template grid<0>().leafGridView();
const auto& facetGridView = gridCreator.template grid<1>().leafGridView();
const auto& edgeGridView = gridCreator.template grid<2>().leafGridView();
const auto& bulkGridView = gridManager.template grid<0>().leafGridView();
const auto& facetGridView = gridManager.template grid<1>().leafGridView();
const auto& edgeGridView = gridManager.template grid<2>().leafGridView();
// create the finite volume grid geometries
using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkProblemTypeTag, FVGridGeometry);
......@@ -154,7 +154,7 @@ int main(int argc, char** argv) try
// the coupling mapper
using CouplingMapper = typename TestTraits::CouplingMapper;
auto couplingMapper = std::make_shared<CouplingMapper>();
couplingMapper->update(*bulkFvGridGeometry, *facetFvGridGeometry, *edgeFvGridGeometry, gridCreator);
couplingMapper->update(*bulkFvGridGeometry, *facetFvGridGeometry, *edgeFvGridGeometry, gridManager);
// the coupling manager
using CouplingManager = typename TestTraits::CouplingManager;
......
add_subdirectory(1p_1p)
dune_symlink_to_source_files(FILES "grid.msh" "grid2.msh" "test_gridcreator.input" "2d_grid.msh" "3d_grid.msh")
dune_add_test(NAME test_facetgridcreator_alu
dune_symlink_to_source_files(FILES "grid.msh" "grid2.msh" "test_gridmanager.input" "test_vertexmapper.input" "test_couplingmapper_boundary.input" "2d_grid.msh" "3d_grid.msh")
dune_add_test(NAME test_facetgridmanager_alu
CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )"
COMPILE_DEFINITIONS BULKGRIDTYPE=Dune::ALUGrid<3,3,Dune::simplex,Dune::conforming>
SOURCES test_gridcreator.cc
COMMAND ./test_facetgridcreator_alu
CMD_ARGS test_gridcreator.input)
SOURCES test_gridmanager.cc
COMMAND ./test_facetgridmanager_alu
CMD_ARGS test_gridmanager.input)
dune_add_test(NAME test_facetgridcreator_ug
dune_add_test(NAME test_facetgridmanager_ug
CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-uggrid_FOUND )"
COMPILE_DEFINITIONS BULKGRIDTYPE=Dune::UGGrid<3>
SOURCES test_gridcreator.cc
COMMAND ./test_facetgridcreator_ug
CMD_ARGS test_gridcreator.input)
SOURCES test_gridmanager.cc
COMMAND ./test_facetgridmanager_ug
CMD_ARGS test_gridmanager.input)
dune_add_test(NAME test_facetcouplingmapper_tpfa_alu
CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )"
COMPILE_DEFINITIONS BULKGRIDTYPE=Dune::ALUGrid<3,3,Dune::simplex,Dune::conforming>
SOURCES test_facetcouplingmapper.cc
COMMAND ./test_facetcouplingmapper_tpfa_alu
CMD_ARGS test_gridcreator.input)
CMD_ARGS test_gridmanager.input)
dune_add_test(NAME test_facetcouplingmapper_tpfa_ug
CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-uggrid_FOUND )"
COMPILE_DEFINITIONS BULKGRIDTYPE=Dune::UGGrid<3>
SOURCES test_facetcouplingmapper.cc
COMMAND ./test_facetcouplingmapper_tpfa_ug
CMD_ARGS test_gridcreator.input)
CMD_ARGS test_gridmanager.input)
dune_add_test(NAME test_facetcouplingmapper_box_alu
CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )"
......@@ -35,7 +36,7 @@ dune_add_test(NAME test_facetcouplingmapper_box_alu
COMPILE_DEFINITIONS USEBOXINBULK=true
SOURCES test_facetcouplingmapper.cc
COMMAND ./test_facetcouplingmapper_box_alu
CMD_ARGS test_gridcreator.input)
CMD_ARGS test_gridmanager.input)
dune_add_test(NAME test_facetcouplingmapper_box_ug
CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-uggrid_FOUND )"
......@@ -43,19 +44,21 @@ dune_add_test(NAME test_facetcouplingmapper_box_ug
COMPILE_DEFINITIONS USEBOXINBULK=true
SOURCES test_facetcouplingmapper.cc
COMMAND ./test_facetcouplingmapper_box_ug
CMD_ARGS test_gridcreator.input)
CMD_ARGS test_gridmanager.input)
dune_add_test(NAME test_facetcouplingmapper_tpfa_boundary_alu
CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )"