3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
facet/couplingmapper.hh
Go to the documentation of this file.
1/*****************************************************************************
2 * See the file COPYING for full copying permissions. *
3 * *
4 * This program is free software: you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation, either version 3 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
16 *****************************************************************************/
22#ifndef DUMUX_FACETCOUPLING_MAPPER_HH
23#define DUMUX_FACETCOUPLING_MAPPER_HH
24
25#include <memory>
26
27#include <dune/common/indices.hh>
29
30namespace Dumux {
31
47template< class BulkFVG,
48 class LowDimFVG,
49 std::size_t bulkId = 0,
50 std::size_t lowDimId = 1,
53
66template< class BulkFVG, class FacetFVG, class EdgeFVG,
67 std::size_t bulkId = 0,
68 std::size_t facetId = 1,
69 std::size_t edgeId = 2 >
71: public FacetCouplingMapper<BulkFVG, FacetFVG, bulkId, facetId>
72, public FacetCouplingMapper<FacetFVG, EdgeFVG, facetId, edgeId>
73{
76
77 // grid dimensions
78 static constexpr int bulkDim = BulkFVG::GridView::dimension;
79 static constexpr int facetDim = FacetFVG::GridView::dimension;
80 static constexpr int edgeDim = EdgeFVG::GridView::dimension;
81
83 template<std::size_t id>
84 using GridIdType = Dune::index_constant<id>;
85
86public:
88 static constexpr auto bulkGridId = Dune::index_constant< bulkId >();
89 static constexpr auto facetGridId = Dune::index_constant< facetId >();
90 static constexpr auto edgeGridId = Dune::index_constant< edgeId >();
91
93 template<std::size_t i>
94 using Stencil = typename std::conditional< (i == edgeId),
95 typename FacetEdgeMapper::template Stencil<i>,
96 typename BulkFacetMapper::template Stencil<i> >::type;
97
99 template<std::size_t i, std::size_t j>
100 using CouplingMap = typename std::conditional< (i != edgeId && j != edgeId),
101 typename BulkFacetMapper::template CouplingMap<i,j>,
102 typename FacetEdgeMapper::template CouplingMap<i,j> >::type;
103
105 template<int dim>
106 static constexpr GridIdType< ( dim == bulkDim ? bulkId : (dim == facetDim ? facetId : edgeId) ) > gridId()
107 { return GridIdType< ( dim == bulkDim ? bulkId : (dim == facetDim ? facetId : edgeId) ) >(); }
108
117 template< class Embeddings >
118 void update(const BulkFVG& bulkFvGridGeometry,
119 const FacetFVG& facetFvGridGeometry,
120 const EdgeFVG& edgeFvGridGeometry,
121 std::shared_ptr<const Embeddings> embeddings)
122 {
123 BulkFacetMapper::update(bulkFvGridGeometry, facetFvGridGeometry, embeddings);
124 FacetEdgeMapper::update(facetFvGridGeometry, edgeFvGridGeometry, embeddings);
125 }
126
128 using BulkFacetMapper::update;
129 using FacetEdgeMapper::update;
130
132 using BulkFacetMapper::couplingMap;
133 using FacetEdgeMapper::couplingMap;
134};
135
136} // end namespace Dumux
137
138// Here, we have to include all available implementations
142
143#endif
The available discretization methods in Dumux.
DiscretizationMethod
The available discretization methods in Dumux.
Definition: method.hh:42
Definition: adapt.hh:29
Implementation for the coupling mapper that sets up and stores the coupling maps between two domains ...
Definition: facet/couplingmapper.hh:52
Specialization of the mapper class for the case of three domains with the grid dimensions d,...
Definition: facet/couplingmapper.hh:73
static constexpr GridIdType<(dim==bulkDim ? bulkId :(dim==facetDim ? facetId :edgeId)) > gridId()
Allow retrievment of grid id for a given grid dimension.
Definition: facet/couplingmapper.hh:106
static constexpr auto edgeGridId
Definition: facet/couplingmapper.hh:90
typename std::conditional<(i !=edgeId &&j !=edgeId), typename BulkFacetMapper::template CouplingMap< i, j >, typename FacetEdgeMapper::template CouplingMap< i, j > >::type CouplingMap
Export the coupling map type for the provided domain indices.
Definition: facet/couplingmapper.hh:102
static constexpr auto bulkGridId
export domain ids
Definition: facet/couplingmapper.hh:88
static constexpr auto facetGridId
Definition: facet/couplingmapper.hh:89
typename std::conditional<(i==edgeId), typename FacetEdgeMapper::template Stencil< i >, typename BulkFacetMapper::template Stencil< i > >::type Stencil
Export the coupling stencil type for the provided domain index.
Definition: facet/couplingmapper.hh:96
void update(const BulkFVG &bulkFvGridGeometry, const FacetFVG &facetFvGridGeometry, const EdgeFVG &edgeFvGridGeometry, std::shared_ptr< const Embeddings > embeddings)
Update coupling maps.
Definition: facet/couplingmapper.hh:118