Go to the documentation of this file.
10 #ifndef DUNE_GRIDGLUE_GRIDGLUE_HH
11 #define DUNE_GRIDGLUE_GRIDGLUE_HH
15 #include <type_traits>
17 #include <dune/common/deprecated.hh>
18 #include <dune/common/exceptions.hh>
19 #include <dune/common/iteratorfacades.hh>
20 #include <dune/common/promotiontraits.hh>
21 #include <dune/common/shared_ptr.hh>
22 #include <dune/common/stdstreams.hh>
27 #include <dune/common/parallel/mpitraits.hh>
28 #include <dune/common/parallel/mpicommunication.hh>
29 #include <dune/common/parallel/indexset.hh>
30 #include <dune/common/parallel/plocalindex.hh>
31 #include <dune/common/parallel/remoteindices.hh>
32 #include <dune/common/parallel/communicator.hh>
33 #include <dune/common/parallel/interface.hh>
39 template<
typename P0,
typename P1>
42 template<
typename P0,
typename P1>
45 template<
typename P0,
typename P1,
int ins
ide,
int outs
ide>
48 template<
typename P0,
typename P1,
int ins
ide,
int outs
ide>
51 template<
typename P0,
typename P1>
63 template<
typename P0,
typename P1>
80 typedef ::Dune::GridGlue::GlobalId
GlobalId;
83 typedef Dune::ParallelLocalIndex <Dune::PartitionType> LocalIndex;
86 typedef Dune::ParallelIndexSet <GlobalId, LocalIndex> PIndexSet;
94 using GridPatch = std::conditional_t<side == 0, P0, std::conditional_t<side == 1, P1, void>>;
123 static constexpr auto grid0dim =
griddim<0>();
126 static constexpr auto domdim =
griddim<0>();
130 static constexpr auto grid0dimworld =
griddimworld<0>();
149 static constexpr auto grid1dim =
griddim<1>();
152 static constexpr auto tardim =
griddim<1>();
156 static constexpr auto grid1dimworld =
griddimworld<1>();
168 typedef typename PromotionTraits<typename
GridView<0>::
ctype,
220 using GridPatches = std::tuple<
221 const std::shared_ptr< const
GridPatch<0> >,
222 const std::shared_ptr< const
GridPatch<1> >
225 const GridPatches patches_;
228 const std::shared_ptr<
Merger> merger_;
238 PIndexSet patch0_is_;
241 PIndexSet patch1_is_;
244 Dune::RemoteIndices<PIndexSet> remoteIndices_;
251 mutable std::vector<IntersectionData> intersections_;
270 void mergePatches(
const std::vector<Dune::FieldVector<ctype,dimworld> >& patch0coords,
271 const std::vector<unsigned int>& patch0entities,
272 const std::vector<Dune::GeometryType>& patch0types,
273 const int patch0rank,
274 const std::vector<Dune::FieldVector<ctype,dimworld> >& patch1coords,
275 const std::vector<unsigned int>& patch1entities,
276 const std::vector<Dune::GeometryType>& patch1types,
277 const int patch1rank);
280 template<
typename Extractor>
282 std::vector<Dune::FieldVector<ctype, dimworld> > & coords,
283 std::vector<unsigned int> & faces,
284 std::vector<Dune::GeometryType>& geometryTypes)
const;
308 return *std::get<P>(patches_);
318 return std::get<P>(patches_)->gridView();
350 return {
this, index__sz};
365 template<
class DataHandleImp,
class DataTypeImp>
367 Dune::InterfaceType iftype, Dune::CommunicationDirection dir)
const;
379 size_t indexSet_size()
const
409 #endif // DUNE_GRIDGLUE_GRIDGLUE_HH
Dune::FieldVector< ctype, dimworld > Coords
The type used for coordinate vectors.
Definition: gridglue.hh:172
Definition: gridglue.hh:35
Definition: intersectionindexset.hh:18
IntersectionIterator< I > ibegin() const
gets an iterator over all remote intersections in the merged grid between grid0 and grid1
Definition: gridglue.hh:335
storage class for Dune::GridGlue::Intersection related data
Definition: intersection.hh:36
IndexSet indexSet() const
Definition: gridglue.hh:372
describes the features of a data handle for communication in parallel runs using the GridGlue::commun...
Definition: gridgluecommunicate.hh:75
typename GridView< side >::Grid Grid
Definition: gridglue.hh:102
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:298
Model of the Intersection concept provided by GridGlue.
unsigned int IndexType
Definition: gridglue.hh:145
static constexpr auto griddim()
Definition: gridglue.hh:114
IntersectionIterator< I > iend() const
gets the (general) end-iterator for grid glue iterations
Definition: gridglue.hh:348
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:177
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:19
size_t size() const
Definition: gridglue.hh:391
Definition: intersectioniterator.hh:23
std::conditional_t< side==0, P0, std::conditional_t< side==1, P1, void > > GridPatch
Definition: gridglue.hh:94
const GridPatch< P > & patch() const
Definition: gridglue.hh:306
Describes the parallel communication interface class for Dune::GridGlue.
typename GridView< side >::Traits::template Codim< Grid< side >::dimension >::Entity GridVertex
type of grid vertices on side side
Definition: gridglue.hh:180
The intersection of two entities of the two patches of a GridGlue.
Definition: intersection.hh:265
const GridView< P > & gridView() const
getter for the GridView of patch P
Definition: gridglue.hh:316
sequential adapter to couple two grids at specified close together boundaries
Definition: gridglue.hh:52
Intersection getIntersection(int i) const
Definition: gridglue.hh:386
PromotionTraits< typename GridView< 0 >::ctype, typename GridView< 1 >::ctype >::PromotedType ctype
The type used for coordinates.
Definition: gridglue.hh:169
Provides codimension-independent methods for grid extraction.
Definition: extractor.hh:44
Dune::GridGlue::IntersectionIndexSet< P0, P1 > IndexSet
Type of remote intersection indexSet.
Definition: gridglue.hh:204
void build()
Definition: gridglue.cc:34
DUNE_DEPRECATED_MSG("please use griddim<0>() instead") static const expr auto grid0dim
dimension of the grid 0 extractor
typename GridView< side >::Traits::template Codim< 0 >::Entity GridElement
type of grid elements on side side
Definition: gridglue.hh:176
GridView< 0 > instead
Definition: gridglue.hh:105
Dune::GridGlue::Intersection< P0, P1, 0, 1 > Intersection
Type of remote intersection objects.
Definition: gridglue.hh:201
Definition: gridgluecommunicate.hh:24
Abstract base for all classes that take extracted grids and build sets of intersections.
Definition: merger.hh:25
static constexpr auto griddimworld()
Definition: gridglue.hh:118
typename GridPatch< side >::GridView GridView
Definition: gridglue.hh:98
static constexpr int dimworld
export the world dimension This is the maximum of the extractors' world dimensions.
Definition: gridglue.hh:164
Implement iterators over GridGlue intersections.
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:263