version 3.8
facet/couplingmapper.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_FACETCOUPLING_MAPPER_HH
13#define DUMUX_FACETCOUPLING_MAPPER_HH
14
15#include <memory>
16
17#include <dune/common/indices.hh>
19
20namespace Dumux {
21
37template< class BulkFVG,
38 class LowDimFVG,
39 std::size_t bulkId = 0,
40 std::size_t lowDimId = 1,
41 class DiscretizationMethod = typename BulkFVG::DiscretizationMethod >
43
56template< class BulkFVG, class FacetFVG, class EdgeFVG,
57 std::size_t bulkId = 0,
58 std::size_t facetId = 1,
59 std::size_t edgeId = 2 >
61: public FacetCouplingMapper<BulkFVG, FacetFVG, bulkId, facetId>
62, public FacetCouplingMapper<FacetFVG, EdgeFVG, facetId, edgeId>
63{
66
67 // grid dimensions
68 static constexpr int bulkDim = BulkFVG::GridView::dimension;
69 static constexpr int facetDim = FacetFVG::GridView::dimension;
70 static constexpr int edgeDim = EdgeFVG::GridView::dimension;
71
73 template<std::size_t id>
74 using GridIdType = Dune::index_constant<id>;
75
76public:
78 static constexpr auto bulkGridId = Dune::index_constant< bulkId >();
79 static constexpr auto facetGridId = Dune::index_constant< facetId >();
80 static constexpr auto edgeGridId = Dune::index_constant< edgeId >();
81
83 template<std::size_t i>
84 using Stencil = typename std::conditional< (i == edgeId),
85 typename FacetEdgeMapper::template Stencil<i>,
86 typename BulkFacetMapper::template Stencil<i> >::type;
87
89 template<std::size_t i, std::size_t j>
90 using CouplingMap = typename std::conditional< (i != edgeId && j != edgeId),
91 typename BulkFacetMapper::template CouplingMap<i,j>,
92 typename FacetEdgeMapper::template CouplingMap<i,j> >::type;
93
95 template<int dim>
96 static constexpr GridIdType< ( dim == bulkDim ? bulkId : (dim == facetDim ? facetId : edgeId) ) > gridId()
97 { return GridIdType< ( dim == bulkDim ? bulkId : (dim == facetDim ? facetId : edgeId) ) >(); }
98
107 template< class Embeddings >
108 void update(const BulkFVG& bulkFvGridGeometry,
109 const FacetFVG& facetFvGridGeometry,
110 const EdgeFVG& edgeFvGridGeometry,
111 std::shared_ptr<const Embeddings> embeddings)
112 {
113 BulkFacetMapper::update(bulkFvGridGeometry, facetFvGridGeometry, embeddings);
114 FacetEdgeMapper::update(facetFvGridGeometry, edgeFvGridGeometry, embeddings);
115 }
116
118 using BulkFacetMapper::update;
119 using FacetEdgeMapper::update;
120
122 using BulkFacetMapper::couplingMap;
123 using FacetEdgeMapper::couplingMap;
124};
125
126} // end namespace Dumux
127
128// Here, we have to include all available implementations
132
133#endif
Implementation for the coupling mapper that sets up and stores the coupling maps between two domains ...
Definition: facet/couplingmapper.hh:42
Specialization of the mapper class for the case of three domains with the grid dimensions d,...
Definition: facet/couplingmapper.hh:63
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:96
static constexpr auto edgeGridId
Definition: facet/couplingmapper.hh:80
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:92
static constexpr auto bulkGridId
export domain ids
Definition: facet/couplingmapper.hh:78
static constexpr auto facetGridId
Definition: facet/couplingmapper.hh:79
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:86
void update(const BulkFVG &bulkFvGridGeometry, const FacetFVG &facetFvGridGeometry, const EdgeFVG &edgeFvGridGeometry, std::shared_ptr< const Embeddings > embeddings)
Update coupling maps.
Definition: facet/couplingmapper.hh:108
The available discretization methods in Dumux.
Definition: adapt.hh:17