version 3.8
discretization/box/fvgridgeometry.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//
14#ifndef DUMUX_DISCRETIZATION_BOX_GRID_FVGEOMETRY_HH
15#define DUMUX_DISCRETIZATION_BOX_GRID_FVGEOMETRY_HH
16
17#include <utility>
18#include <unordered_map>
19#include <array>
20#include <vector>
21
22#include <dune/localfunctions/lagrange/lagrangelfecache.hh>
23
33
34namespace Dumux {
35
36namespace Detail {
37template<class GV, class T>
38using BoxGeometryHelper_t = Dune::Std::detected_or_t<
41 T
42>;
43} // end namespace Detail
44
51template<class GridView, class MapperTraits = DefaultMapperTraits<GridView>>
53: public MapperTraits
54{
57
58 template<class GridGeometry, bool enableCache>
60};
61
68template<class Scalar,
69 class GridView,
70 bool enableGridGeometryCache = false,
73
80template<class Scalar, class GV, class Traits>
81class BoxFVGridGeometry<Scalar, GV, true, Traits>
82: public BaseGridGeometry<GV, Traits>
83{
86 using GridIndexType = typename IndexTraits<GV>::GridIndex;
87 using LocalIndexType = typename IndexTraits<GV>::LocalIndex;
88
89 using Element = typename GV::template Codim<0>::Entity;
90 using CoordScalar = typename GV::ctype;
91 static const int dim = GV::dimension;
92 static const int dimWorld = GV::dimensionworld;
93
94public:
97 static constexpr DiscretizationMethod discMethod{};
98
102 using LocalView = typename Traits::template LocalView<ThisType, true>;
104 using SubControlVolume = typename Traits::SubControlVolume;
106 using SubControlVolumeFace = typename Traits::SubControlVolumeFace;
110 using DofMapper = typename Traits::VertexMapper;
112 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
114 using GridView = GV;
115
117 BoxFVGridGeometry(std::shared_ptr<BasicGridGeometry> gg)
118 : ParentType(std::move(gg))
119 , cache_(*this)
120 {
121 update_();
122 }
123
126 : BoxFVGridGeometry(std::make_shared<BasicGridGeometry>(gridView))
127 {}
128
131 const DofMapper& dofMapper() const
132 { return this->vertexMapper(); }
133
135 std::size_t numScv() const
136 { return numScv_; }
137
139 std::size_t numScvf() const
140 { return numScvf_; }
141
144 std::size_t numBoundaryScvf() const
145 { return numBoundaryScvf_; }
146
148 std::size_t numDofs() const
149 { return this->vertexMapper().size(); }
150
151
153 void update(const GridView& gridView)
154 {
155 ParentType::update(gridView);
156 update_();
157 }
158
160 void update(GridView&& gridView)
161 {
162 ParentType::update(std::move(gridView));
163 update_();
164 }
165
167 const FeCache& feCache() const
168 { return feCache_; }
169
171 bool dofOnBoundary(GridIndexType dofIdx) const
172 { return boundaryDofIndices_[dofIdx]; }
173
175 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
176 { return periodicVertexMap_.count(dofIdx); }
177
179 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
180 { return periodicVertexMap_.at(dofIdx); }
181
183 const std::unordered_map<GridIndexType, GridIndexType>& periodicVertexMap() const
184 { return periodicVertexMap_; }
185
187 friend inline LocalView localView(const BoxFVGridGeometry& gg)
188 { return { gg.cache_ }; }
189
190private:
191
192 class BoxGridGeometryCache
193 {
194 friend class BoxFVGridGeometry;
195 public:
197 using GeometryHelper = Detail::BoxGeometryHelper_t<GV, Traits>;
198
199 explicit BoxGridGeometryCache(const BoxFVGridGeometry& gg)
200 : gridGeometry_(&gg)
201 {}
202
203 const BoxFVGridGeometry& gridGeometry() const
204 { return *gridGeometry_; }
205
207 const std::vector<SubControlVolume>& scvs(GridIndexType eIdx) const
208 { return scvs_[eIdx]; }
209
211 const std::vector<SubControlVolumeFace>& scvfs(GridIndexType eIdx) const
212 { return scvfs_[eIdx]; }
213
215 bool hasBoundaryScvf(GridIndexType eIdx) const
216 { return hasBoundaryScvf_[eIdx]; }
217
219 const std::vector<std::array<LocalIndexType, 2>>& scvfBoundaryGeometryKeys(GridIndexType eIdx) const
220 { return scvfBoundaryGeometryKeys_.at(eIdx); }
221
222 private:
223 void clear_()
224 {
225 scvs_.clear();
226 scvfs_.clear();
227 hasBoundaryScvf_.clear();
228 scvfBoundaryGeometryKeys_.clear();
229 }
230
231 std::vector<std::vector<SubControlVolume>> scvs_;
232 std::vector<std::vector<SubControlVolumeFace>> scvfs_;
233 std::vector<bool> hasBoundaryScvf_;
234 std::unordered_map<GridIndexType, std::vector<std::array<LocalIndexType, 2>>> scvfBoundaryGeometryKeys_;
235
236 const BoxFVGridGeometry* gridGeometry_;
237 };
238
239public:
242 using Cache = BoxGridGeometryCache;
243
244private:
245 using GeometryHelper = typename Cache::GeometryHelper;
246
247 void update_()
248 {
249 cache_.clear_();
250
251 const auto numElements = this->gridView().size(0);
252 cache_.scvs_.resize(numElements);
253 cache_.scvfs_.resize(numElements);
254 cache_.hasBoundaryScvf_.resize(numElements, false);
255
256 boundaryDofIndices_.assign(numDofs(), false);
257
258 numScv_ = 0;
259 numScvf_ = 0;
260 numBoundaryScvf_ = 0;
261 // Build the SCV and SCV faces
262 for (const auto& element : elements(this->gridView()))
263 {
264 // fill the element map with seeds
265 const auto eIdx = this->elementMapper().index(element);
266
267 // count
268 numScv_ += element.subEntities(dim);
269 numScvf_ += element.subEntities(dim-1);
270
271 // get the element geometry
272 auto elementGeometry = element.geometry();
273 const auto refElement = referenceElement(elementGeometry);
274
275 // instantiate the geometry helper
276 GeometryHelper geometryHelper(elementGeometry);
277
278 // construct the sub control volumes
279 cache_.scvs_[eIdx].resize(elementGeometry.corners());
280 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
281 {
282 const auto dofIdxGlobal = this->vertexMapper().subIndex(element, scvLocalIdx, dim);
283
284 cache_.scvs_[eIdx][scvLocalIdx] = SubControlVolume(
285 geometryHelper.getScvCorners(scvLocalIdx),
286 scvLocalIdx,
287 eIdx,
288 dofIdxGlobal
289 );
290 }
291
292 // construct the sub control volume faces
293 LocalIndexType scvfLocalIdx = 0;
294 cache_.scvfs_[eIdx].resize(element.subEntities(dim-1));
295 for (; scvfLocalIdx < element.subEntities(dim-1); ++scvfLocalIdx)
296 {
297 // find the global and local scv indices this scvf is belonging to
298 std::vector<LocalIndexType> localScvIndices({static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 0, dim)),
299 static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 1, dim))});
300
301 const auto& corners = geometryHelper.getScvfCorners(scvfLocalIdx);
302 cache_.scvfs_[eIdx][scvfLocalIdx] = SubControlVolumeFace(
303 corners,
304 geometryHelper.normal(corners, localScvIndices),
305 element,
306 elementGeometry,
307 scvfLocalIdx,
308 std::move(localScvIndices),
309 false
310 );
311 }
312
313 // construct the sub control volume faces on the domain boundary
314 for (const auto& intersection : intersections(this->gridView(), element))
315 {
316 if (intersection.boundary() && !intersection.neighbor())
317 {
318 const auto isGeometry = intersection.geometry();
319 cache_.hasBoundaryScvf_[eIdx] = true;
320
321 // count
322 numScvf_ += isGeometry.corners();
323 numBoundaryScvf_ += isGeometry.corners();
324
325 for (unsigned int isScvfLocalIdx = 0; isScvfLocalIdx < isGeometry.corners(); ++isScvfLocalIdx)
326 {
327 // find the scvs this scvf is belonging to
328 const LocalIndexType insideScvIdx = static_cast<LocalIndexType>(refElement.subEntity(intersection.indexInInside(), 1, isScvfLocalIdx, dim));
329 std::vector<LocalIndexType> localScvIndices = {insideScvIdx, insideScvIdx};
330
331 cache_.scvfs_[eIdx].emplace_back(
332 geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), isScvfLocalIdx),
333 intersection.centerUnitOuterNormal(),
334 intersection,
335 isGeometry,
336 isScvfLocalIdx,
337 scvfLocalIdx,
338 std::move(localScvIndices),
339 true
340 );
341
342 cache_.scvfBoundaryGeometryKeys_[eIdx].emplace_back(std::array<LocalIndexType, 2>{{
343 static_cast<LocalIndexType>(intersection.indexInInside()),
344 static_cast<LocalIndexType>(isScvfLocalIdx)
345 }});
346
347 // increment local counter
348 scvfLocalIdx++;
349 }
350
351 // add all vertices on the intersection to the set of
352 // boundary vertices
353 const auto fIdx = intersection.indexInInside();
354 const auto numFaceVerts = refElement.size(fIdx, 1, dim);
355 for (int localVIdx = 0; localVIdx < numFaceVerts; ++localVIdx)
356 {
357 const auto vIdx = refElement.subEntity(fIdx, 1, localVIdx, dim);
358 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdx, dim);
359 boundaryDofIndices_[vIdxGlobal] = true;
360 }
361 }
362
363 // inform the grid geometry if we have periodic boundaries
364 else if (intersection.boundary() && intersection.neighbor())
365 {
366 this->setPeriodic();
367
368 // find the mapped periodic vertex of all vertices on periodic boundaries
369 const auto fIdx = intersection.indexInInside();
370 const auto numFaceVerts = refElement.size(fIdx, 1, dim);
371 const auto eps = 1e-7*(elementGeometry.corner(1) - elementGeometry.corner(0)).two_norm();
372 for (int localVIdx = 0; localVIdx < numFaceVerts; ++localVIdx)
373 {
374 const auto vIdx = refElement.subEntity(fIdx, 1, localVIdx, dim);
375 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdx, dim);
376 const auto vPos = elementGeometry.corner(vIdx);
377
378 const auto& outside = intersection.outside();
379 const auto outsideGeometry = outside.geometry();
380 for (const auto& isOutside : intersections(this->gridView(), outside))
381 {
382 // only check periodic vertices of the periodic neighbor
383 if (isOutside.boundary() && isOutside.neighbor())
384 {
385 const auto fIdxOutside = isOutside.indexInInside();
386 const auto numFaceVertsOutside = refElement.size(fIdxOutside, 1, dim);
387 for (int localVIdxOutside = 0; localVIdxOutside < numFaceVertsOutside; ++localVIdxOutside)
388 {
389 const auto vIdxOutside = refElement.subEntity(fIdxOutside, 1, localVIdxOutside, dim);
390 const auto vPosOutside = outsideGeometry.corner(vIdxOutside);
391 const auto shift = std::abs((this->bBoxMax()-this->bBoxMin())*intersection.centerUnitOuterNormal());
392 if (std::abs((vPosOutside-vPos).two_norm() - shift) < eps)
393 periodicVertexMap_[vIdxGlobal] = this->vertexMapper().subIndex(outside, vIdxOutside, dim);
394 }
395 }
396 }
397 }
398 }
399 }
400 }
401
402 // error check: periodic boundaries currently don't work for box in parallel
403 if (this->isPeriodic() && this->gridView().comm().size() > 1)
404 DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for box method for parallel simulations!");
405 }
406
407 const FeCache feCache_;
408
409 std::size_t numScv_;
410 std::size_t numScvf_;
411 std::size_t numBoundaryScvf_;
412
413 // vertices on the boundary
414 std::vector<bool> boundaryDofIndices_;
415
416 // a map for periodic boundary vertices
417 std::unordered_map<GridIndexType, GridIndexType> periodicVertexMap_;
418
419 Cache cache_;
420};
421
429template<class Scalar, class GV, class Traits>
430class BoxFVGridGeometry<Scalar, GV, false, Traits>
431: public BaseGridGeometry<GV, Traits>
432{
435 using GridIndexType = typename IndexTraits<GV>::GridIndex;
436
437 static const int dim = GV::dimension;
438 static const int dimWorld = GV::dimensionworld;
439
440 using Element = typename GV::template Codim<0>::Entity;
441 using CoordScalar = typename GV::ctype;
442
443public:
446 static constexpr DiscretizationMethod discMethod{};
447
451 using LocalView = typename Traits::template LocalView<ThisType, false>;
453 using SubControlVolume = typename Traits::SubControlVolume;
455 using SubControlVolumeFace = typename Traits::SubControlVolumeFace;
459 using DofMapper = typename Traits::VertexMapper;
461 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
463 using GridView = GV;
464
466 BoxFVGridGeometry(std::shared_ptr<BasicGridGeometry> gg)
467 : ParentType(std::move(gg))
468 , cache_(*this)
469 {
470 update_();
471 }
472
475 : BoxFVGridGeometry(std::make_shared<BasicGridGeometry>(gridView))
476 {}
477
480 const DofMapper& dofMapper() const
481 { return this->vertexMapper(); }
482
484 std::size_t numScv() const
485 { return numScv_; }
486
488 std::size_t numScvf() const
489 { return numScvf_; }
490
493 std::size_t numBoundaryScvf() const
494 { return numBoundaryScvf_; }
495
497 std::size_t numDofs() const
498 { return this->vertexMapper().size(); }
499
500
502 void update(const GridView& gridView)
503 {
504 ParentType::update(gridView);
505 update_();
506 }
507
509 void update(GridView&& gridView)
510 {
511 ParentType::update(std::move(gridView));
512 update_();
513 }
514
516 const FeCache& feCache() const
517 { return feCache_; }
518
520 bool dofOnBoundary(GridIndexType dofIdx) const
521 { return boundaryDofIndices_[dofIdx]; }
522
524 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
525 { return periodicVertexMap_.count(dofIdx); }
526
528 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
529 { return periodicVertexMap_.at(dofIdx); }
530
532 const std::unordered_map<GridIndexType, GridIndexType>& periodicVertexMap() const
533 { return periodicVertexMap_; }
534
536 friend inline LocalView localView(const BoxFVGridGeometry& gg)
537 { return { gg.cache_ }; }
538
539private:
540
541 class BoxGridGeometryCache
542 {
543 friend class BoxFVGridGeometry;
544 public:
546 using GeometryHelper = Detail::BoxGeometryHelper_t<GV, Traits>;
547
548 explicit BoxGridGeometryCache(const BoxFVGridGeometry& gg)
549 : gridGeometry_(&gg)
550 {}
551
552 const BoxFVGridGeometry& gridGeometry() const
553 { return *gridGeometry_; }
554
555 private:
556 const BoxFVGridGeometry* gridGeometry_;
557 };
558
559public:
562 using Cache = BoxGridGeometryCache;
563
564private:
565
566 void update_()
567 {
568 boundaryDofIndices_.assign(numDofs(), false);
569
570 // save global data on the grid's scvs and scvfs
571 // TODO do we need those information?
572 numScv_ = 0;
573 numScvf_ = 0;
574 numBoundaryScvf_ = 0;
575 for (const auto& element : elements(this->gridView()))
576 {
577 numScv_ += element.subEntities(dim);
578 numScvf_ += element.subEntities(dim-1);
579
580 const auto elementGeometry = element.geometry();
581 const auto refElement = referenceElement(elementGeometry);
582
583 // store the sub control volume face indices on the domain boundary
584 for (const auto& intersection : intersections(this->gridView(), element))
585 {
586 if (intersection.boundary() && !intersection.neighbor())
587 {
588 const auto isGeometry = intersection.geometry();
589 numScvf_ += isGeometry.corners();
590 numBoundaryScvf_ += isGeometry.corners();
591
592 // add all vertices on the intersection to the set of
593 // boundary vertices
594 const auto fIdx = intersection.indexInInside();
595 const auto numFaceVerts = refElement.size(fIdx, 1, dim);
596 for (int localVIdx = 0; localVIdx < numFaceVerts; ++localVIdx)
597 {
598 const auto vIdx = refElement.subEntity(fIdx, 1, localVIdx, dim);
599 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdx, dim);
600 boundaryDofIndices_[vIdxGlobal] = true;
601 }
602 }
603
604 // inform the grid geometry if we have periodic boundaries
605 else if (intersection.boundary() && intersection.neighbor())
606 {
607 this->setPeriodic();
608
609 // find the mapped periodic vertex of all vertices on periodic boundaries
610 const auto fIdx = intersection.indexInInside();
611 const auto numFaceVerts = refElement.size(fIdx, 1, dim);
612 const auto eps = 1e-7*(elementGeometry.corner(1) - elementGeometry.corner(0)).two_norm();
613 for (int localVIdx = 0; localVIdx < numFaceVerts; ++localVIdx)
614 {
615 const auto vIdx = refElement.subEntity(fIdx, 1, localVIdx, dim);
616 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdx, dim);
617 const auto vPos = elementGeometry.corner(vIdx);
618
619 const auto& outside = intersection.outside();
620 const auto outsideGeometry = outside.geometry();
621 for (const auto& isOutside : intersections(this->gridView(), outside))
622 {
623 // only check periodic vertices of the periodic neighbor
624 if (isOutside.boundary() && isOutside.neighbor())
625 {
626 const auto fIdxOutside = isOutside.indexInInside();
627 const auto numFaceVertsOutside = refElement.size(fIdxOutside, 1, dim);
628 for (int localVIdxOutside = 0; localVIdxOutside < numFaceVertsOutside; ++localVIdxOutside)
629 {
630 const auto vIdxOutside = refElement.subEntity(fIdxOutside, 1, localVIdxOutside, dim);
631 const auto vPosOutside = outsideGeometry.corner(vIdxOutside);
632 const auto shift = std::abs((this->bBoxMax()-this->bBoxMin())*intersection.centerUnitOuterNormal());
633 if (std::abs((vPosOutside-vPos).two_norm() - shift) < eps)
634 periodicVertexMap_[vIdxGlobal] = this->vertexMapper().subIndex(outside, vIdxOutside, dim);
635 }
636 }
637 }
638 }
639 }
640 }
641 }
642
643 // error check: periodic boundaries currently don't work for box in parallel
644 if (this->isPeriodic() && this->gridView().comm().size() > 1)
645 DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for box method for parallel simulations!");
646 }
647
648 const FeCache feCache_;
649
650 // Information on the global number of geometries
651 // TODO do we need those information?
652 std::size_t numScv_;
653 std::size_t numScvf_;
654 std::size_t numBoundaryScvf_;
655
656 // vertices on the boundary
657 std::vector<bool> boundaryDofIndices_;
658
659 // a map for periodic boundary vertices
660 std::unordered_map<GridIndexType, GridIndexType> periodicVertexMap_;
661
662 Cache cache_;
663};
664
665} // end namespace Dumux
666
667#endif
Base class for grid geometries.
Helper class constructing the dual grid finite volume geometries for the box discretizazion method.
Base class for all grid geometries.
Definition: basegridgeometry.hh:52
typename BaseImplementation::GridView GridView
export the grid view type
Definition: basegridgeometry.hh:60
Base class for the finite volume geometry vector for box models This builds up the sub control volume...
Definition: discretization/box/fvelementgeometry.hh:41
Base class for the finite volume geometry vector for box schemes This builds up the sub control volum...
Definition: discretization/box/fvgridgeometry.hh:432
std::size_t numBoundaryScvf() const
Definition: discretization/box/fvgridgeometry.hh:493
friend LocalView localView(const BoxFVGridGeometry &gg)
local view of this object (constructed with the internal cache)
Definition: discretization/box/fvgridgeometry.hh:536
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition: discretization/box/fvgridgeometry.hh:524
typename Traits::template LocalView< ThisType, false > LocalView
export the type of the fv element geometry (the local view type)
Definition: discretization/box/fvgridgeometry.hh:451
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition: discretization/box/fvgridgeometry.hh:455
BoxFVGridGeometry(const GridView &gridView)
Constructor.
Definition: discretization/box/fvgridgeometry.hh:474
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition: discretization/box/fvgridgeometry.hh:453
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition: discretization/box/fvgridgeometry.hh:528
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition: discretization/box/fvgridgeometry.hh:516
BoxGridGeometryCache Cache
Definition: discretization/box/fvgridgeometry.hh:562
std::size_t numScvf() const
The total number of sun control volume faces.
Definition: discretization/box/fvgridgeometry.hh:488
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition: discretization/box/fvgridgeometry.hh:459
BasicGridGeometry_t< GV, Traits > BasicGridGeometry
export basic grid geometry type for the alternative constructor
Definition: discretization/box/fvgridgeometry.hh:449
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition: discretization/box/fvgridgeometry.hh:520
const DofMapper & dofMapper() const
Definition: discretization/box/fvgridgeometry.hh:480
void update(GridView &&gridView)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/box/fvgridgeometry.hh:509
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: discretization/box/fvgridgeometry.hh:457
std::size_t numDofs() const
The total number of degrees of freedom.
Definition: discretization/box/fvgridgeometry.hh:497
const std::unordered_map< GridIndexType, GridIndexType > & periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition: discretization/box/fvgridgeometry.hh:532
BoxFVGridGeometry(std::shared_ptr< BasicGridGeometry > gg)
Constructor with basic grid geometry used to share state with another grid geometry on the same grid ...
Definition: discretization/box/fvgridgeometry.hh:466
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/box/fvgridgeometry.hh:484
void update(const GridView &gridView)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/box/fvgridgeometry.hh:502
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition: discretization/box/fvgridgeometry.hh:461
Base class for the finite volume geometry vector for box schemes This builds up the sub control volum...
Definition: discretization/box/fvgridgeometry.hh:83
friend LocalView localView(const BoxFVGridGeometry &gg)
local view of this object (constructed with the internal cache)
Definition: discretization/box/fvgridgeometry.hh:187
BoxGridGeometryCache Cache
Definition: discretization/box/fvgridgeometry.hh:242
const std::unordered_map< GridIndexType, GridIndexType > & periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition: discretization/box/fvgridgeometry.hh:183
void update(const GridView &gridView)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/box/fvgridgeometry.hh:153
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition: discretization/box/fvgridgeometry.hh:179
std::size_t numDofs() const
The total number of degrees of freedom.
Definition: discretization/box/fvgridgeometry.hh:148
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/box/fvgridgeometry.hh:135
BasicGridGeometry_t< GV, Traits > BasicGridGeometry
export basic grid geometry type for the alternative constructor
Definition: discretization/box/fvgridgeometry.hh:100
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition: discretization/box/fvgridgeometry.hh:167
std::size_t numBoundaryScvf() const
Definition: discretization/box/fvgridgeometry.hh:144
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition: discretization/box/fvgridgeometry.hh:112
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition: discretization/box/fvgridgeometry.hh:106
const DofMapper & dofMapper() const
Definition: discretization/box/fvgridgeometry.hh:131
BoxFVGridGeometry(const GridView &gridView)
Constructor.
Definition: discretization/box/fvgridgeometry.hh:125
BoxFVGridGeometry(std::shared_ptr< BasicGridGeometry > gg)
Constructor with basic grid geometry used to share state with another grid geometry on the same grid ...
Definition: discretization/box/fvgridgeometry.hh:117
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: discretization/box/fvgridgeometry.hh:108
typename Traits::template LocalView< ThisType, true > LocalView
export the type of the fv element geometry (the local view type)
Definition: discretization/box/fvgridgeometry.hh:102
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition: discretization/box/fvgridgeometry.hh:171
std::size_t numScvf() const
The total number of sun control volume faces.
Definition: discretization/box/fvgridgeometry.hh:139
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition: discretization/box/fvgridgeometry.hh:175
void update(GridView &&gridView)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/box/fvgridgeometry.hh:160
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition: discretization/box/fvgridgeometry.hh:104
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition: discretization/box/fvgridgeometry.hh:110
Base class for the finite volume geometry vector for box schemes This builds up the sub control volum...
Definition: discretization/box/fvgridgeometry.hh:72
Create sub control volumes and sub control volume face geometries.
Definition: boxgeometryhelper.hh:257
Class for a sub control volume face in the box method, i.e a part of the boundary of a sub control vo...
Definition: discretization/box/subcontrolvolumeface.hh:62
the sub control volume for the box scheme
Definition: discretization/box/subcontrolvolume.hh:60
Defines the default element and vertex mapper types.
Base class for the local finite volume geometry for box models This builds up the sub control volumes...
the sub control volume for the box scheme
Base class for a sub control volume face.
Helper classes to compute the integration elements.
Dune::Std::detected_or_t< Dumux::BasicGridGeometry< GV, typename T::ElementMapper, typename T::VertexMapper >, Detail::SpecifiesBaseGridGeometry, T > BasicGridGeometry_t
Type of the basic grid geometry implementation used as backend.
Definition: basegridgeometry.hh:42
Defines the index types used for grid and local indices.
The available discretization methods in Dumux.
Dune::Std::detected_or_t< Dumux::BoxGeometryHelper< GV, GV::dimension, typename T::SubControlVolume, typename T::SubControlVolumeFace >, SpecifiesGeometryHelper, T > BoxGeometryHelper_t
Definition: discretization/box/fvgridgeometry.hh:42
typename T::GeometryHelper SpecifiesGeometryHelper
Definition: basegridgeometry.hh:30
CVFE< CVFEMethods::PQ1 > Box
Definition: method.hh:94
Definition: adapt.hh:17
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:166
The default traits for the box finite volume grid geometry Defines the scv and scvf types and the map...
Definition: discretization/box/fvgridgeometry.hh:54
Definition: method.hh:46
Structure to define the index types used for grid and local indices.
Definition: indextraits.hh:26