12#ifndef DUNE_GRIDGLUE_GRIDGLUE_HH
13#define DUNE_GRIDGLUE_GRIDGLUE_HH
19#include <dune/common/deprecated.hh>
20#include <dune/common/exceptions.hh>
21#include <dune/common/iteratorfacades.hh>
22#include <dune/common/promotiontraits.hh>
23#include <dune/common/shared_ptr.hh>
24#include <dune/common/stdstreams.hh>
29#include <dune/common/parallel/mpitraits.hh>
30#include <dune/common/parallel/mpicommunication.hh>
31#include <dune/common/parallel/indexset.hh>
32#include <dune/common/parallel/plocalindex.hh>
33#include <dune/common/parallel/remoteindices.hh>
34#include <dune/common/parallel/communicator.hh>
35#include <dune/common/parallel/interface.hh>
41template<
typename P0,
typename P1>
44template<
typename P0,
typename P1>
47template<
typename P0,
typename P1,
int ins
ide,
int outs
ide>
50template<
typename P0,
typename P1,
int ins
ide,
int outs
ide>
53template<
typename P0,
typename P1>
65template<
typename P0,
typename P1>
72 friend class IntersectionData<P0,P1>;
85 typedef Dune::ParallelLocalIndex <Dune::PartitionType> LocalIndex;
88 typedef Dune::ParallelIndexSet <GlobalId, LocalIndex> PIndexSet;
96 using GridPatch = std::conditional_t<side == 0, P0, std::conditional_t<side == 1, P1, void>>;
107 using Grid0View [[deprecated(
"please use GridView<0> instead")]] =
GridView<0>;
110 using Grid0 [[deprecated(
"please use Grid<0> instead")]] =
Grid<0>;
113 using Grid0Patch [[deprecated(
"please use GridPatch<0> instead")]] =
GridPatch<0>;
124 [[deprecated(
"please use griddim<0>() instead")]]
127 [[deprecated(
"please use griddim<0>() instead")]]
131 [[deprecated(
"please use griddimworld<0>() instead")]]
134 [[deprecated(
"please use griddimworld<0>() instead")]]
138 using Grid1View [[deprecated(
"please use GridView<0> instead")]] =
GridView<1>;
141 using Grid1 [[deprecated(
"please use Grid<1> instead")]] =
Grid<1>;
144 using Grid1Patch [[deprecated(
"please use GridPatch<1> instead")]] =
GridPatch<1>;
150 [[deprecated(
"please use griddim<1>() instead")]]
153 [[deprecated(
"please use griddim<1>() instead")]]
157 [[deprecated(
"please use griddimworld<1>() instead")]]
160 [[deprecated(
"please use griddimworld<1>() instead")]]
170 typedef typename PromotionTraits<typename GridView<0>::ctype,
174 typedef Dune::FieldVector<ctype, dimworld>
Coords;
185 using Grid0Element [[deprecated(
"please use GridElement<0> instead")]] =
GridElement<0>;
188 using Grid0Vertex [[deprecated(
"please use GridVertex<0> instead")]] =
GridVertex<0>;
191 using Grid1Element [[deprecated(
"please use GridElement<1> instead")]] =
GridElement<1>;
194 using Grid1Vertex [[deprecated(
"please use GridVertex<1> instead")]] =
GridVertex<1>;
213 using Grid0IntersectionIterator [[deprecated(
"please use IntersectionIterator<0> instead")]] =
IntersectionIterator<0>;
216 using Grid1IntersectionIterator [[deprecated(
"please use IntersectionIterator<1> instead")]] =
IntersectionIterator<1>;
222 using GridPatches = std::tuple<
223 const std::shared_ptr< const GridPatch<0> >,
224 const std::shared_ptr< const GridPatch<1> >
227 const GridPatches patches_;
230 const std::shared_ptr<Merger> merger_;
240 PIndexSet patch0_is_;
243 PIndexSet patch1_is_;
246 Dune::RemoteIndices<PIndexSet> remoteIndices_;
253 mutable std::vector<IntersectionData> intersections_;
272 void mergePatches(
const std::vector<Dune::FieldVector<ctype,dimworld> >& patch0coords,
273 const std::vector<unsigned int>& patch0entities,
274 const std::vector<Dune::GeometryType>& patch0types,
275 const int patch0rank,
276 const std::vector<Dune::FieldVector<ctype,dimworld> >& patch1coords,
277 const std::vector<unsigned int>& patch1entities,
278 const std::vector<Dune::GeometryType>& patch1types,
279 const int patch1rank);
282 template<
typename Extractor>
284 std::vector<Dune::FieldVector<ctype, dimworld> > & coords,
285 std::vector<unsigned int> & faces,
286 std::vector<Dune::GeometryType>& geometryTypes)
const;
310 return *std::get<P>(patches_);
320 return std::get<P>(patches_)->gridView();
352 return {
this, index__sz};
367 template<
class DataHandleImp,
class DataTypeImp>
369 Dune::InterfaceType iftype, Dune::CommunicationDirection dir)
const;
381 size_t indexSet_size()
const
Implement iterators over GridGlue intersections.
Model of the Intersection concept provided by GridGlue.
Describes the parallel communication interface class for Dune::GridGlue.
Definition gridglue.hh:37
sequential adapter to couple two grids at specified close together boundaries
Definition gridglue.hh:67
Dune::FieldVector< ctype, dimworld > Coords
The type used for coordinate vectors.
Definition gridglue.hh:174
Intersection getIntersection(int i) const
Definition gridglue.hh:388
Dune::GridGlue::IntersectionIndexSet< P0, P1 > IndexSet
Type of remote intersection indexSet.
Definition gridglue.hh:206
unsigned int IndexType
Definition gridglue.hh:147
PromotionTraits< typenameGridView< 0 >::ctype, typenameGridView< 1 >::ctype >::PromotedType ctype
The type used for coordinates.
Definition gridglue.hh:171
void mergePatches(const std::vector< Dune::FieldVector< ctype, dimworld > > &patch0coords, const std::vector< unsigned int > &patch0entities, const std::vector< Dune::GeometryType > &patch0types, const int patch0rank, const std::vector< Dune::FieldVector< ctype, dimworld > > &patch1coords, const std::vector< unsigned int > &patch1entities, const std::vector< Dune::GeometryType > &patch1types, const int patch1rank)
after building the merged grid the intersection can be updated through this method (for internal use)
Definition gridglue.cc:179
Dune::GridGlue::Intersection< P0, P1, 0, 1 > Intersection
Type of remote intersection objects.
Definition gridglue.hh:203
static constexpr auto griddimworld()
Definition gridglue.hh:120
void communicate(Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > &data, Dune::InterfaceType iftype, Dune::CommunicationDirection dir) const
Communicate information on the MergedGrid of a GridGlue.
Definition gridglue.cc:300
static constexpr int dimworld
export the world dimension This is the maximum of the extractors' world dimensions.
Definition gridglue.hh:166
GridGlue(const std::shared_ptr< const GridPatch< 0 > > &gp0, const std::shared_ptr< const GridPatch< 1 > > &gp1, const std::shared_ptr< Merger > &merger)
constructor
Definition gridglue.cc:21
IntersectionIterator< I > iend() const
gets the (general) end-iterator for grid glue iterations
Definition gridglue.hh:350
Dune::GridGlue::Merger< ctype, Grid< 0 >::dimension - GridPatch< 0 >::codim, Grid< 1 >::dimension - GridPatch< 1 >::codim, dimworld > Merger
Instance of a Merger.
Definition gridglue.hh:200
static constexpr auto domdimworld
Definition gridglue.hh:135
void build()
Definition gridglue.cc:36
void extractGrid(const Extractor &extractor, std::vector< Dune::FieldVector< ctype, dimworld > > &coords, std::vector< unsigned int > &faces, std::vector< Dune::GeometryType > &geometryTypes) const
Definition gridglue.cc:265
Dune::GridGlue::IntersectionIterator< P0, P1, side,(side+1) % 2 > IntersectionIterator
Type of the iterator that iterates over remove intersections.
Definition gridglue.hh:210
static constexpr auto grid0dim
dimension of the grid 0 extractor
Definition gridglue.hh:125
const GridView< P > & gridView() const
getter for the GridView of patch P
Definition gridglue.hh:318
static constexpr auto grid1dim
dimension of the grid 1 extractor
Definition gridglue.hh:151
static constexpr auto griddim()
Definition gridglue.hh:116
const GridPatch< P > & patch() const
Definition gridglue.hh:308
static constexpr auto grid1dimworld
world dimension of the grid 1 extractor
Definition gridglue.hh:158
static constexpr auto domdim
Definition gridglue.hh:128
static constexpr auto grid0dimworld
world dimension of the grid 0 extractor
Definition gridglue.hh:132
std::conditional_t< side==0, P0, std::conditional_t< side==1, P1, void > > GridPatch
Definition gridglue.hh:96
IntersectionIterator< I > ibegin() const
gets an iterator over all remote intersections in the merged grid between grid0 and grid1
Definition gridglue.hh:337
typename GridPatch< side >::GridView GridView
Definition gridglue.hh:100
static constexpr auto tardim
Definition gridglue.hh:154
typename GridView< side >::Traits::template Codim< Grid< side >::dimension >::Entity GridVertex
type of grid vertices on side side
Definition gridglue.hh:182
typename GridView< side >::Traits::template Codim< 0 >::Entity GridElement
type of grid elements on side side
Definition gridglue.hh:178
IndexSet indexSet() const
Definition gridglue.hh:374
size_t size() const
Definition gridglue.hh:393
static constexpr auto tardimworld
Definition gridglue.hh:161
typename GridView< side >::Grid Grid
Definition gridglue.hh:104
storage class for Dune::GridGlue::Intersection related data
Definition intersection.hh:38
The intersection of two entities of the two patches of a GridGlue.
Definition intersection.hh:257
Definition intersectioniterator.hh:25
Definition intersectionindexset.hh:20
Definition gridgluecommunicate.hh:26
describes the features of a data handle for communication in parallel runs using the GridGlue::commun...
Definition gridgluecommunicate.hh:77
Provides codimension-independent methods for grid extraction.
Definition extractor.hh:46
Abstract base for all classes that take extracted grids and build sets of intersections.
Definition merger.hh:27