│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
11#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH
│ │ │ │ -
12#define DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
18#include <dune/common/deprecated.hh>
│ │ │ │ -
19#include <dune/common/version.hh>
│ │ │ │ -
20#include <dune/geometry/affinegeometry.hh>
│ │ │ │ -
21#include <dune/geometry/referenceelements.hh>
│ │ │ │ -
│ │ │ │ +
5#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH
│ │ │ │ +
6#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
15#include <dune/common/bartonnackmanifcheck.hh>
│ │ │ │ +
16#include <dune/common/parallel/communicator.hh>
│ │ │ │ +
17#include <dune/grid/common/datahandleif.hh>
│ │ │ │ +
18#include <dune/grid/common/gridenums.hh>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
24#define ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
30 template<
typename P0,
typename P1>
│ │ │ │ -
31 class IntersectionIndexSet;
│ │ │ │ -
│ │ │ │ -
36 template<
typename P0,
typename P1>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
40 typedef ::Dune::GridGlue::GridGlue<P0, P1>
GridGlue;
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
50 static constexpr int dim() {
return GridGlue::template GridView<side>::Grid::dimension - GridGlue::template GridPatch<side>::codim; }
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
54 static constexpr int mydim = dim<0>() < dim<1>() ? dim<0>() : dim<1>();
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
58 typename GridGlue::template GridView<side>::ctype,
mydim, GridGlue::template GridView<side>::dimension>;
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
25 struct GlobalId :
public std::pair<RankPair, unsigned int>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
31 this->first.first = 0;
│ │ │ │ +
32 this->first.second = 0;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
39 this->first.first = i;
│ │ │ │ +
40 this->first.second = i;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
49 this->first.first = std::min(i,j);
│ │ │ │ +
50 this->first.second = std::max(i,j);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
58 <<
id.first.first <<
"," <<
id.first.second <<
","
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
65 typename GridGlue::template GridView<side>::ctype,
mydim, GridGlue::template GridView<side>::dimensionworld>;
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
71 using GridIndexType =
typename GridGlue::template GridView<side>::IndexSet::IndexType;
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
77 IntersectionData(
const GridGlue& glue,
unsigned int mergeindex,
unsigned int offset,
bool grid0local,
bool grid1local);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
75 template <
class DataHandleImp,
class DataTypeImp>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
86 {
return *std::get<side>(sideData_).gridlocalgeom[parentId]; }
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
90 {
return *std::get<side>(sideData_).gridgeom; }
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
94 {
return std::get<side>(sideData_).gridlocal; }
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
98 {
return std::get<side>(sideData_).gridindices[parentId]; }
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
102 {
return std::get<side>(sideData_).gridindices.size(); }
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
106 void initializeGeometry(
const GridGlue& glue,
unsigned mergeindex);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
91 template<
class RISType>
│ │ │ │ +
92 size_t size (RISType& i)
const
│ │ │ │ +
│ │ │ │ +
94 CHECK_INTERFACE_IMPLEMENTATION((asImp().
size(i)));
│ │ │ │ +
95 return asImp().size(i);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
103 template<
class MessageBufferImp,
class EntityType,
class RISType>
│ │ │ │ +
104 void gather (MessageBufferImp& buff,
const EntityType& e,
const RISType & i)
const
│ │ │ │ +
│ │ │ │ +
106 MessageBufferIF<MessageBufferImp> buffIF(buff);
│ │ │ │ +
107 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
gather(buffIF,e,i)));
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
118 bool gridlocal =
false;
│ │ │ │ -
│ │ │ │ -
121 std::vector< GridIndexType<side> > gridindices;
│ │ │ │ -
│ │ │ │ -
124 std::vector< std::optional< GridLocalGeometry<side> > > gridlocalgeom;
│ │ │ │ -
│ │ │ │ -
133 std::optional< GridGeometry<side> > gridgeom;
│ │ │ │ -
│ │ │ │ +
117 template<
class MessageBufferImp,
class EntityType,
class RISType>
│ │ │ │ +
118 void scatter (MessageBufferImp& buff,
const EntityType& e,
const RISType & i,
size_t n)
│ │ │ │ +
│ │ │ │ +
120 MessageBufferIF<MessageBufferImp> buffIF(buff);
│ │ │ │ +
121 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
scatter(buffIF,e,i,n)));
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
126 DataHandleImp& asImp () {
│ │ │ │ +
127 return static_cast<DataHandleImp &
> (*this);
│ │ │ │ +
│ │ │ │ +
130 const DataHandleImp& asImp ()
const
│ │ │ │ +
│ │ │ │ +
132 return static_cast<const DataHandleImp &
>(*this);
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
136 std::tuple< SideData<0>, SideData<1> > sideData_;
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
139 template<
typename P0,
typename P1>
│ │ │ │ -
│ │ │ │ -
141 void IntersectionData<P0, P1>::initializeGeometry(
const GridGlue& glue,
unsigned mergeindex)
│ │ │ │ -
│ │ │ │ -
143 auto& data = std::get<side>(sideData_);
│ │ │ │ +
140 template<
typename DT>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
145 const unsigned n_parents = glue.merger_->template parents<side>(mergeindex);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
148 data.gridindices.resize(n_parents);
│ │ │ │ -
149 data.gridlocalgeom.resize(n_parents);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
152 data.gridindices[0] = 0;
│ │ │ │ -
│ │ │ │ -
154 static constexpr int nSimplexCorners = mydim + 1;
│ │ │ │ -
155 using ctype =
typename GridGlue::ctype;
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
160 static constexpr int elementdim = GridGlue::template GridView<side>::template Codim<0>::Geometry::mydimension;
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
163 std::array<Dune::FieldVector< ctype, dim<side>() >, nSimplexCorners> corners_subEntity_local;
│ │ │ │ -
│ │ │ │ -
165 for (
unsigned int par = 0; par < n_parents; ++par) {
│ │ │ │ -
166 for (
int i = 0; i < nSimplexCorners; ++i)
│ │ │ │ -
167 corners_subEntity_local[i] = glue.merger_->template parentLocal<side>(mergeindex, i, par);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
157 static_assert(std::is_same<DT,Y>::value,
"DataType mismatch");
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
165 static_assert(std::is_same<DT,Y>::value,
"DataType mismatch");
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
170 std::array<Dune::FieldVector<ctype, elementdim>, nSimplexCorners> corners_element_local;
│ │ │ │ -
│ │ │ │ -
172 if (data.gridlocal) {
│ │ │ │ -
173 data.gridindices[par] = glue.merger_->template parent<side>(mergeindex,par);
│ │ │ │ -
│ │ │ │ -
175 typename GridGlue::template GridPatch<side>::LocalGeometry
│ │ │ │ -
176 gridLocalGeometry = glue.template patch<side>().geometryLocal(data.gridindices[par]);
│ │ │ │ -
177 for (std::size_t i=0; i<corners_subEntity_local.size(); i++) {
│ │ │ │ -
178 corners_element_local[i] = gridLocalGeometry.global(corners_subEntity_local[i]);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
182#ifdef ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ -
183# if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6)
│ │ │ │ -
184 const Dune::GeometryType type = Dune::GeometryTypes::simplex(mydim);
│ │ │ │ -
│ │ │ │ -
186 const Dune::GeometryType type(Dune::GeometryType::simplex, mydim);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
189#error Not Implemented
│ │ │ │ -
│ │ │ │ -
191 data.gridlocalgeom[par].emplace(type, corners_element_local);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
195 typename GridGlue::template GridPatch<side>::Geometry
│ │ │ │ -
196 gridWorldGeometry = glue.template patch<side>().geometry(data.gridindices[par]);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
199 std::array<Dune::FieldVector<ctype, GridGlue::template GridView<side>::dimensionworld>, nSimplexCorners> corners_global;
│ │ │ │ -
│ │ │ │ -
201 for (std::size_t i=0; i<corners_subEntity_local.size(); i++) {
│ │ │ │ -
202 corners_global[i] = gridWorldGeometry.global(corners_subEntity_local[i]);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
205 data.gridgeom.emplace(type, corners_global);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
212 template<
typename P0,
typename P1>
│ │ │ │ -
│ │ │ │ -
214 bool grid0local,
bool grid1local)
│ │ │ │ -
215 : index_(mergeindex+offset)
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
219 assert (0 <= mergeindex || mergeindex < glue.index__sz);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
196 template<
class CommInfo>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
200 typedef typename CommInfo::GridGlue::Intersection
Intersection;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
207 if (dir == Dune::ForwardCommunication)
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
221 std::get<0>(sideData_).gridlocal = grid0local;
│ │ │ │ -
222 std::get<1>(sideData_).gridlocal = grid1local;
│ │ │ │ -
│ │ │ │ -
224 initializeGeometry<0>(glue, mergeindex);
│ │ │ │ -
225 initializeGeometry<1>(glue, mergeindex);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
232 template<
typename P0,
typename P1,
int ins
ide,
int outs
ide>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
244 using Geometry =
typename IntersectionData::template GridGeometry<inside>;
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
259 template<
typename P0,
typename P1,
int I,
int O>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
223 return commInfo.
buffer[j];
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
226 template<
class CommInfo>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
230 typedef typename CommInfo::GridGlue::Intersection
Intersection;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
246 if (dir == Dune::ForwardCommunication)
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
281 typedef typename InsideGridView::Traits::template Codim<0>::Entity
InsideEntity;
│ │ │ │ -
282 typedef typename OutsideGridView::Traits::template Codim<0>::Entity
OutsideEntity;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
270 template <
typename GG,
class DataHandleImp,
class DataTypeImp>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
286 mutable ::Dune::GridGlue::StreamingMessageBuffer<DataType>
mbuffer;
│ │ │ │ +
│ │ │ │ +
288 Dune::CommunicationDirection
dir;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
312 glue_(glue), i_(i) {}
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
322 return glue_->template patch<I>().element(i_->template index<I>(parentId));
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
331 return glue_->template patch<O>().element(i_->template index<O>(parentId));
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
337 throw Dune::NotImplemented();
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
344 return i_->template localGeometry<I>(parentId);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
351 return i_->template localGeometry<O>(parentId);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
362 return i_->template geometry<I>();
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
373 return i_->template geometry<O>();
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
377 Dune::GeometryType
type()
const
│ │ │ │ -
│ │ │ │ -
379 #ifdef ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ -
380 # if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6)
│ │ │ │ -
381 return Dune::GeometryTypes::simplex(
mydim);
│ │ │ │ -
│ │ │ │ -
383 static const Dune::GeometryType
type(Dune::GeometryType::simplex,
mydim);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
387 #error Not Implemented
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
395 return i_->template local<I>();
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
401 if (g == 0 && i_->template local<O>()) {
│ │ │ │ -
402 return i_->template parents<O>();
│ │ │ │ -
403 }
else if (g == 1 && i_->template local<I>()) {
│ │ │ │ -
404 return i_->template parents<I>();
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
413 return glue_->template patch<I>().indexInInside(i_->template index<I>(parentId));
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
420 return glue_->template patch<O>().indexInInside(i_->template index<O>(parentId));
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
431 if (codimensionWorld == 0)
│ │ │ │ -
432 DUNE_THROW(Dune::Exception,
"There is no normal vector to a full-dimensional intersection");
│ │ │ │ -
433 else if (codimensionWorld == 1) {
│ │ │ │ -
│ │ │ │ -
435 const auto jacobianTransposed =
geometry().jacobianTransposed(local);
│ │ │ │ -
│ │ │ │ -
437 normal[0] = - jacobianTransposed[0][1];
│ │ │ │ -
438 normal[1] = jacobianTransposed[0][0];
│ │ │ │ -
439 }
else if (
mydim==2) {
│ │ │ │ -
440 normal[0] = (jacobianTransposed[0][1] * jacobianTransposed[1][2] - jacobianTransposed[0][2] * jacobianTransposed[1][1]);
│ │ │ │ -
441 normal[1] = - (jacobianTransposed[0][0] * jacobianTransposed[1][2] - jacobianTransposed[0][2] * jacobianTransposed[1][0]);
│ │ │ │ -
442 normal[2] = (jacobianTransposed[0][0] * jacobianTransposed[1][1] - jacobianTransposed[0][1] * jacobianTransposed[1][0]);
│ │ │ │ -
│ │ │ │ -
444 DUNE_THROW(Dune::NotImplemented,
"Remote intersections don't implement the 'outerNormal' method for " <<
mydim <<
"-dimensional intersections yet");
│ │ │ │ -
│ │ │ │ -
446 DUNE_THROW(Dune::NotImplemented,
"Remote intersections don't implement the 'outerNormal' method for intersections with codim >= 2 yet");
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
458 normal /= normal.two_norm();
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
488#ifdef QUICKHACK_INDEX
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
491 IndexType index()
const
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
500 friend class IntersectionIndexSet<P0,P1>;
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
Central component of the module implementing the coupling of two grids.
│ │ │ │ +
│ │ │ │ +
298 template<
typename GG,
class DataHandleImp,
class DataTypeImp>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
304 typedef ::Dune::GridGlue::CommInfo<GG, DataHandleImp, DataTypeImp>
Type;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
323 typedef typename Type::GridGlue::Intersection Intersection;
│ │ │ │ +
324 Intersection ris(commInfo.
gridglue->getIntersection(i));
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
327 return commInfo.
data->size(ris);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
bool inside(const Coordinate &x, const Field &epsilon)
Definition: projection_impl.hh:111
│ │ │ │ -
sequential adapter to couple two grids at specified close together boundaries
Definition: gridglue.hh:67
│ │ │ │ -
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
│ │ │ │ -
static constexpr int dimworld
export the world dimension This is the maximum of the extractors' world dimensions.
Definition: gridglue.hh:166
│ │ │ │ -
storage class for Dune::GridGlue::Intersection related data
Definition: intersection.hh:38
│ │ │ │ -
GridGlue::IndexType IndexType
Definition: intersection.hh:42
│ │ │ │ -
AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, GridGlue::template GridView< side >::dimensionworld > GridGeometry
Definition: intersection.hh:65
│ │ │ │ -
const GridLocalGeometry< side > & localGeometry(unsigned int parentId=0) const
Definition: intersection.hh:85
│ │ │ │ -
static constexpr int coorddim
Dimension of the world space of the intersection.
Definition: intersection.hh:45
│ │ │ │ -
GridGeometry< 0 > Grid0Geometry
Definition: intersection.hh:67
│ │ │ │ -
typename GridGlue::template GridView< side >::IndexSet::IndexType GridIndexType
Definition: intersection.hh:71
│ │ │ │ -
IndexType index(unsigned int parentId=0) const
Definition: intersection.hh:97
│ │ │ │ -
IndexType parents() const
Definition: intersection.hh:101
│ │ │ │ -
GridLocalGeometry< 1 > Grid1LocalGeometry
Definition: intersection.hh:61
│ │ │ │ -
const GridGeometry< side > & geometry() const
Definition: intersection.hh:89
│ │ │ │ -
bool local() const
Definition: intersection.hh:93
│ │ │ │ -
::Dune::GridGlue::GridGlue< P0, P1 > GridGlue
Definition: intersection.hh:40
│ │ │ │ -
static constexpr int mydim
Dimension of the intersection.
Definition: intersection.hh:54
│ │ │ │ -
AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, GridGlue::template GridView< side >::dimension > GridLocalGeometry
Definition: intersection.hh:58
│ │ │ │ -
GridLocalGeometry< 0 > Grid0LocalGeometry
Definition: intersection.hh:60
│ │ │ │ -
IndexType index_
index of this intersection after GridGlue interface
Definition: intersection.hh:112
│ │ │ │ -
GridIndexType< 1 > Grid1IndexType
Definition: intersection.hh:74
│ │ │ │ -
GridGeometry< 1 > Grid1Geometry
Definition: intersection.hh:68
│ │ │ │ -
GridIndexType< 0 > Grid0IndexType
Definition: intersection.hh:73
│ │ │ │ -
IntersectionData()=default
Default Constructor.
│ │ │ │ +
CommunicationOperator< Dune::BackwardCommunication > BackwardOperator
Definition: gridgluecommunicate.hh:264
│ │ │ │ +
CommunicationOperator< Dune::ForwardCommunication > ForwardOperator
Definition: gridgluecommunicate.hh:263
│ │ │ │ +
std::pair< int, int > RankPair
Definition: gridgluecommunicate.hh:24
│ │ │ │ +
std::ostream & operator<<(std::ostream &os, const GlobalId &id)
Definition: gridgluecommunicate.hh:55
│ │ │ │
The intersection of two entities of the two patches of a GridGlue.
Definition: intersection.hh:261
│ │ │ │ -
Traits::OutsideLocalGeometry OutsideLocalGeometry
Definition: intersection.hh:275
│ │ │ │
Intersection< P0, P1, O, I > flip() const
Return a copy of the intersection with inside and outside switched.
Definition: intersection.hh:483
│ │ │ │ -
bool conforming() const
Return true if intersection is conforming.
Definition: intersection.hh:335
│ │ │ │ -
InsideGridView::Traits::template Codim< 0 >::Entity InsideEntity
Definition: intersection.hh:281
│ │ │ │ -
Traits::GridGlue GridGlue
Definition: intersection.hh:267
│ │ │ │ -
int indexInOutside(unsigned int parentId=0) const
Local number of codim 1 entity in outside() Entity where intersection is contained in.
Definition: intersection.hh:417
│ │ │ │ -
int indexInInside(unsigned int parentId=0) const
Local number of codim 1 entity in the inside() Entity where intersection is contained in.
Definition: intersection.hh:410
│ │ │ │
bool self() const
For parallel computations: Return true if inside() entity exists locally.
Definition: intersection.hh:393
│ │ │ │ -
static constexpr auto mydim
dimension of the intersection
Definition: intersection.hh:291
│ │ │ │ -
static constexpr int outsidePatch
outside patch
Definition: intersection.hh:297
│ │ │ │ -
Dune::GeometryType type() const
Type of reference element for this intersection.
Definition: intersection.hh:377
│ │ │ │
InsideEntity inside(unsigned int parentId=0) const
Return element on the inside of this intersection.
Definition: intersection.hh:319
│ │ │ │ -
Traits::LocalCoordinate LocalCoordinate
Definition: intersection.hh:284
│ │ │ │ -
const OutsideLocalGeometry & geometryInOutside(unsigned int parentId=0) const
Geometric information about this intersection in local coordinates of the outside() element.
Definition: intersection.hh:349
│ │ │ │ -
GlobalCoordinate unitOuterNormal(const LocalCoordinate &local) const
Return a unit outer normal.
Definition: intersection.hh:455
│ │ │ │ -
Traits::ctype ctype
Definition: intersection.hh:279
│ │ │ │ -
IntersectionTraits< P0, P1, I, O > Traits
Definition: intersection.hh:265
│ │ │ │ -
Traits::IntersectionData IntersectionData
Definition: intersection.hh:268
│ │ │ │ -
Traits::GlobalCoordinate GlobalCoordinate
Definition: intersection.hh:285
│ │ │ │ -
Traits::OutsideGeometry OutsideGeometry
Definition: intersection.hh:276
│ │ │ │
size_t neighbor(unsigned int g=0) const
Return number of embeddings into local grid0 (grid1) entities.
Definition: intersection.hh:399
│ │ │ │ -
Intersection(const GridGlue *glue, const IntersectionData *i)
Constructor for a given Dataset.
Definition: intersection.hh:311
│ │ │ │ -
static constexpr int insidePatch
inside patch
Definition: intersection.hh:294
│ │ │ │ -
Traits::Geometry Geometry
Definition: intersection.hh:278
│ │ │ │ -
OutsideGridView::Traits::template Codim< 0 >::Entity OutsideEntity
Definition: intersection.hh:282
│ │ │ │
OutsideEntity outside(unsigned int parentId=0) const
Return element on the outside of this intersection.
Definition: intersection.hh:328
│ │ │ │ -
const Geometry & geometry() const
Geometric information about this intersection as part of the inside grid.
Definition: intersection.hh:360
│ │ │ │ -
Traits::InsideLocalGeometry InsideLocalGeometry
Definition: intersection.hh:272
│ │ │ │ -
GlobalCoordinate outerNormal(const LocalCoordinate &local) const
Return an outer normal (length not necessarily 1)
Definition: intersection.hh:427
│ │ │ │ -
const OutsideGeometry & geometryOutside() const
Geometric information about this intersection as part of the outside grid.
Definition: intersection.hh:371
│ │ │ │ -
Traits::OutsideGridView OutsideGridView
Definition: intersection.hh:274
│ │ │ │ -
GlobalCoordinate integrationOuterNormal(const LocalCoordinate &local) const
Return an outer normal with the length of the integration element.
Definition: intersection.hh:466
│ │ │ │ -
Traits::InsideGridView InsideGridView
Definition: intersection.hh:271
│ │ │ │ -
const InsideLocalGeometry & geometryInInside(unsigned int parentId=0) const
Geometric information about this intersection in local coordinates of the inside() element.
Definition: intersection.hh:342
│ │ │ │ -
GlobalCoordinate centerUnitOuterNormal() const
Unit outer normal at the center of the intersection.
Definition: intersection.hh:475
│ │ │ │ -
static constexpr auto coorddim
dimension of the world space of the intersection
Definition: intersection.hh:288
│ │ │ │ -
Definition: intersection.hh:234
│ │ │ │ -
static constexpr int insidePatch
Definition: intersection.hh:249
│ │ │ │ -
Dune::FieldVector< ctype, mydim > LocalCoordinate
Definition: intersection.hh:253
│ │ │ │ -
static constexpr auto coorddim
Definition: intersection.hh:247
│ │ │ │ -
typename IntersectionData::template GridGeometry< outside > OutsideGeometry
Definition: intersection.hh:245
│ │ │ │ -
typename GridGlue::ctype ctype
Definition: intersection.hh:252
│ │ │ │ -
typename GridGlue::template GridView< outside > OutsideGridView
Definition: intersection.hh:239
│ │ │ │ -
Dune::FieldVector< ctype, coorddim > GlobalCoordinate
Definition: intersection.hh:254
│ │ │ │ -
typename IntersectionData::template GridLocalGeometry< outside > OutsideLocalGeometry
Definition: intersection.hh:242
│ │ │ │ -
typename GridGlue::template GridView< inside > InsideGridView
Definition: intersection.hh:238
│ │ │ │ -
typename IntersectionData::template GridGeometry< inside > Geometry
Definition: intersection.hh:244
│ │ │ │ -
typename IntersectionData::template GridLocalGeometry< inside > InsideLocalGeometry
Definition: intersection.hh:241
│ │ │ │ -
static constexpr int outsidePatch
Definition: intersection.hh:250
│ │ │ │ -
static constexpr auto mydim
Definition: intersection.hh:248
│ │ │ │ +
Definition: gridgluecommunicate.hh:26
│ │ │ │ +
GlobalId(int i)
Definition: gridgluecommunicate.hh:38
│ │ │ │ +
GlobalId()
Definition: gridgluecommunicate.hh:30
│ │ │ │ +
GlobalId(int i, int j, unsigned int n)
Definition: gridgluecommunicate.hh:48
│ │ │ │ +
describes the features of a data handle for communication in parallel runs using the GridGlue::commun...
Definition: gridgluecommunicate.hh:77
│ │ │ │ +
size_t size(RISType &i) const
Definition: gridgluecommunicate.hh:92
│ │ │ │ +
void scatter(MessageBufferImp &buff, const EntityType &e, const RISType &i, size_t n)
Definition: gridgluecommunicate.hh:118
│ │ │ │ +
void gather(MessageBufferImp &buff, const EntityType &e, const RISType &i) const
pack data from user to message buffer
Definition: gridgluecommunicate.hh:104
│ │ │ │ +
DataTypeImp DataType
data type of data to communicate
Definition: gridgluecommunicate.hh:80
│ │ │ │ +
CommDataHandle()
Definition: gridgluecommunicate.hh:84
│ │ │ │ +
Definition: gridgluecommunicate.hh:141
│ │ │ │ +
size_t j
Definition: gridgluecommunicate.hh:183
│ │ │ │ +
StreamingMessageBuffer(DT *p)
Definition: gridgluecommunicate.hh:146
│ │ │ │ +
DT * a
Definition: gridgluecommunicate.hh:181
│ │ │ │ +
size_t counter() const
Definition: gridgluecommunicate.hh:169
│ │ │ │ +
void write(const Y &data)
Definition: gridgluecommunicate.hh:155
│ │ │ │ +
void read(Y &data) const
Definition: gridgluecommunicate.hh:163
│ │ │ │ +
DT value_type
Definition: gridgluecommunicate.hh:143
│ │ │ │ +
size_t i
Definition: gridgluecommunicate.hh:182
│ │ │ │ +
void clear()
Definition: gridgluecommunicate.hh:171
│ │ │ │ +
forward gather scatter to user defined CommInfo class
Definition: gridgluecommunicate.hh:194
│ │ │ │ +
static void scatter(CommInfo &commInfo, const typename CommInfo::DataType &v, std::size_t i, std::size_t j=0)
Definition: gridgluecommunicate.hh:227
│ │ │ │ +
static const CommInfo::DataType & gather(const CommInfo &commInfo, size_t i, size_t j=0)
Definition: gridgluecommunicate.hh:197
│ │ │ │ +
collects all GridGlue data requried for communication
Definition: gridgluecommunicate.hh:272
│ │ │ │ +
Dune::CommunicationDirection dir
Definition: gridgluecommunicate.hh:288
│ │ │ │ +
DataTypeImp value_type
Definition: gridgluecommunicate.hh:273
│ │ │ │ +
DataTypeImp DataType
Definition: gridgluecommunicate.hh:275
│ │ │ │ +
::Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > * data
Definition: gridgluecommunicate.hh:282
│ │ │ │ +
GG GridGlue
Definition: gridgluecommunicate.hh:274
│ │ │ │ +
size_t currentsize
Definition: gridgluecommunicate.hh:287
│ │ │ │ +
CommInfo()
Definition: gridgluecommunicate.hh:277
│ │ │ │ +
mutable ::Dune::GridGlue::StreamingMessageBuffer< DataType > mbuffer
Definition: gridgluecommunicate.hh:286
│ │ │ │ +
const GridGlue * gridglue
Definition: gridgluecommunicate.hh:281
│ │ │ │ +
std::vector< DataType > buffer
Definition: gridgluecommunicate.hh:285
│ │ │ │ +
static size_t getSize(const Type &commInfo, size_t i)
Get the number of objects at an intersection.
Definition: gridgluecommunicate.hh:320
│ │ │ │ +
DataTypeImp IndexedType
The datatype that should be communicated.
Definition: gridgluecommunicate.hh:309
│ │ │ │ +
::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > Type
The type of the GridGlueCommInfo.
Definition: gridgluecommunicate.hh:304
│ │ │ │ +
VariableSize IndexedTypeFlag
Each intersection can communicate a different number of objects.
Definition: gridgluecommunicate.hh:315
│ │ │ │