13#ifndef DUMUX_DISCRETIZATION_BOX_GEOMETRY_HELPER_HH
14#define DUMUX_DISCRETIZATION_BOX_GEOMETRY_HELPER_HH
18#include <dune/common/exceptions.hh>
20#include <dune/geometry/type.hh>
21#include <dune/geometry/typeindex.hh>
22#include <dune/geometry/referenceelements.hh>
23#include <dune/geometry/multilineargeometry.hh>
25#include <dune/common/rangeutilities.hh>
40 template<
int mydim,
int cdim >
43 using Type = std::array< Dune::FieldVector< ct, cdim >, (1<<(mydim)) >;
50 static const bool v =
true;
51 static const unsigned int topologyId = Dune::GeometryTypes::cube(mydim).id();
57template<Dune::GeometryType::Id gt>
63 using Key = std::pair<std::uint8_t, std::uint8_t>;
64 static constexpr std::array<std::array<Key, 2>, 2>
keys = {{
73 using Key = std::pair<std::uint8_t, std::uint8_t>;
74 static constexpr std::array<std::array<Key, 4>, 3>
keys = {{
84 using Key = std::pair<std::uint8_t, std::uint8_t>;
85 static constexpr std::array<std::array<Key, 4>, 4>
keys = {{
96 using Key = std::pair<std::uint8_t, std::uint8_t>;
97 static constexpr std::array<std::array<Key, 8>, 4>
keys = {{
98 {
Key{0, 3},
Key{0, 2},
Key{1, 2},
Key{0, 1},
Key{3, 2},
Key{1, 1},
Key{2, 1},
Key{0, 0} },
99 {
Key{1, 3},
Key{2, 2},
Key{0, 2},
Key{0, 1},
Key{4, 2},
Key{3, 1},
Key{1, 1},
Key{0, 0} },
100 {
Key{2, 3},
Key{1, 2},
Key{2, 2},
Key{0, 1},
Key{5, 2},
Key{2, 1},
Key{3, 1},
Key{0, 0} },
101 {
Key{3, 3},
Key{3, 2},
Key{5, 2},
Key{2, 1},
Key{4, 2},
Key{1, 1},
Key{3, 1},
Key{0, 0} }
108 using Key = std::pair<std::uint8_t, std::uint8_t>;
109 static constexpr std::array<std::array<Key, 8>, 6>
keys = {{
110 {
Key{0, 3},
Key{3, 2},
Key{4, 2},
Key{3, 1},
Key{0, 2},
Key{0, 1},
Key{1, 1},
Key{0, 0} },
111 {
Key{1, 3},
Key{5, 2},
Key{3, 2},
Key{3, 1},
Key{1, 2},
Key{2, 1},
Key{0, 1},
Key{0, 0} },
112 {
Key{2, 3},
Key{4, 2},
Key{5, 2},
Key{3, 1},
Key{2, 2},
Key{1, 1},
Key{2, 1},
Key{0, 0} },
113 {
Key{3, 3},
Key{7, 2},
Key{6, 2},
Key{4, 1},
Key{0, 2},
Key{1, 1},
Key{0, 1},
Key{0, 0} },
114 {
Key{4, 3},
Key{6, 2},
Key{8, 2},
Key{4, 1},
Key{1, 2},
Key{0, 1},
Key{2, 1},
Key{0, 0} },
115 {
Key{5, 3},
Key{8, 2},
Key{7, 2},
Key{4, 1},
Key{2, 2},
Key{2, 1},
Key{1, 1},
Key{0, 0} }
122 using Key = std::pair<std::uint8_t, std::uint8_t>;
123 static constexpr std::array<std::array<Key, 8>, 8>
keys = {{
124 {
Key{0, 3},
Key{6, 2},
Key{4, 2},
Key{4, 1},
Key{0, 2},
Key{2, 1},
Key{0, 1},
Key{0, 0} },
125 {
Key{1, 3},
Key{5, 2},
Key{6, 2},
Key{4, 1},
Key{1, 2},
Key{1, 1},
Key{2, 1},
Key{0, 0} },
126 {
Key{2, 3},
Key{4, 2},
Key{7, 2},
Key{4, 1},
Key{2, 2},
Key{0, 1},
Key{3, 1},
Key{0, 0} },
127 {
Key{3, 3},
Key{7, 2},
Key{5, 2},
Key{4, 1},
Key{3, 2},
Key{3, 1},
Key{1, 1},
Key{0, 0} },
128 {
Key{4, 3},
Key{8, 2},
Key{10, 2},
Key{5, 1},
Key{0, 2},
Key{0, 1},
Key{2, 1},
Key{0, 0} },
129 {
Key{5, 3},
Key{10, 2},
Key{9, 2},
Key{5, 1},
Key{1, 2},
Key{2, 1},
Key{1, 1},
Key{0, 0} },
130 {
Key{6, 3},
Key{11, 2},
Key{8, 2},
Key{5, 1},
Key{2, 2},
Key{3, 1},
Key{0, 1},
Key{0, 0} },
131 {
Key{7, 3},
Key{9, 2},
Key{11, 2},
Key{5, 1},
Key{3, 2},
Key{1, 1},
Key{3, 1},
Key{0, 0} }
135template<Dune::GeometryType::Id gt>
141 using Key = std::pair<std::uint8_t, std::uint8_t>;
142 static constexpr std::array<std::array<Key, 1>, 1>
keys = {{
150 using Key = std::pair<std::uint8_t, std::uint8_t>;
151 static constexpr std::array<std::array<Key, 2>, 3>
keys = {{
161 using Key = std::pair<std::uint8_t, std::uint8_t>;
162 static constexpr std::array<std::array<Key, 2>, 4>
keys = {{
173 using Key = std::pair<std::uint8_t, std::uint8_t>;
174 static constexpr std::array<std::array<Key, 4>, 6>
keys = {{
187 using Key = std::pair<std::uint8_t, std::uint8_t>;
188 static constexpr std::array<std::array<Key, 4>, 9>
keys = {{
204 using Key = std::pair<std::uint8_t, std::uint8_t>;
205 static constexpr std::array<std::array<Key, 4>, 12>
keys = {{
223template<
class S,
class ReferenceElement,
class Transformation,
class KeyArray, std::size_t... I>
224S
keyToCornerStorageImpl(
const ReferenceElement& ref, Transformation&& trans,
const KeyArray& key, std::index_sequence<I...>)
227 return { trans(ref.position(key[I].first, key[I].second))... };
231template<
class S,
class ReferenceElement,
class Transformation,
class T, std::
size_t N,
class Indices = std::make_index_sequence<N>>
232S
keyToCornerStorage(
const ReferenceElement& ref, Transformation&& trans,
const std::array<T, N>& key)
239template<
class S,
class ReferenceElement,
class Transformation,
class KeyArray, std::size_t... I>
241 unsigned int i,
unsigned int c,
const KeyArray& key, std::index_sequence<I...>)
245 return { trans(ref.position(ref.subEntity(i, c, key[I].first, c+key[I].second), c+key[I].second))... };
250template<
class S,
class ReferenceElement,
class Transformation,
class T, std::
size_t N,
class Indices = std::make_index_sequence<N>>
252 unsigned int i,
unsigned int c,
const std::array<T, N>& key)
260template<
class Gr
idView,
int dim,
class ScvType,
class ScvfType>
264template <
class Gr
idView,
class ScvType,
class ScvfType>
268 using Scalar =
typename GridView::ctype;
269 using GlobalPosition =
typename Dune::FieldVector<Scalar, GridView::dimensionworld>;
270 using ScvCornerStorage =
typename ScvType::Traits::CornerStorage;
271 using ScvfCornerStorage =
typename ScvfType::Traits::CornerStorage;
272 using ScvGeometry =
typename ScvType::Traits::Geometry;
273 using ScvfGeometry =
typename ScvfType::Traits::Geometry;
274 using LocalIndexType =
typename ScvType::Traits::LocalIndexType;
276 using Element =
typename GridView::template Codim<0>::Entity;
277 using Intersection =
typename GridView::Intersection;
279 static constexpr int dim = 1;
290 return getScvCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvIdx);
294 template<
class Transformation>
295 static ScvCornerStorage
getScvCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvIdx)
297 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
304 return { Dune::GeometryTypes::line,
getScvCorners(localScvIdx) };
310 return getScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvfIdx);
314 template<
class Transformation>
315 static ScvfCornerStorage
getScvfCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvfIdx)
317 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
326 return ScvfCornerStorage{{ geo_.corner(localFacetIndex) }};
330 template<
class Transformation>
332 Transformation&& trans,
333 unsigned int localFacetIndex,
334 unsigned int indexInFacet)
336 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
337 return trans(ref.position(localFacetIndex, dim));
341 GlobalPosition
normal(
const ScvfCornerStorage& scvfCorners,
342 const std::array<LocalIndexType, 2>&)
const
344 auto normal = geo_.corner(1) - geo_.corner(0);
352 return referenceElement(geo_).size(dim-1);
358 return Dune::referenceElement<Scalar, dim>(type).size(dim-1);
364 return referenceElement(geo_).size(dim);
372 static Element::Geometry::LocalCoordinate
localScvfCenter(Dune::GeometryType type,
unsigned int localScvfIdx)
374 return Dumux::center(getScvfCorners_(type, [&](
const auto& local){
return local; }, localScvfIdx));
378 static Element::Geometry::LocalCoordinate
localBoundaryScvfCenter(Dune::GeometryType type,
unsigned int localFacetIndex,
unsigned int)
380 return Dune::referenceElement<Scalar, dim>(type).position(localFacetIndex, dim);
384 const typename Element::Geometry& geo_;
388template <
class Gr
idView,
class ScvType,
class ScvfType>
391 using Scalar =
typename GridView::ctype;
392 using GlobalPosition =
typename Dune::FieldVector<Scalar, GridView::dimensionworld>;
393 using ScvCornerStorage =
typename ScvType::Traits::CornerStorage;
394 using ScvfCornerStorage =
typename ScvfType::Traits::CornerStorage;
395 using LocalIndexType =
typename ScvType::Traits::LocalIndexType;
397 using Element =
typename GridView::template Codim<0>::Entity;
398 using Intersection =
typename GridView::Intersection;
400 static constexpr auto dim = GridView::dimension;
401 static constexpr auto dimWorld = GridView::dimensionworld;
412 return getScvCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvIdx);
416 template<
class Transformation>
417 static ScvCornerStorage
getScvCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvIdx)
420 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
421 if (type == Dune::GeometryTypes::triangle)
426 else if (type == Dune::GeometryTypes::quadrilateral)
432 DUNE_THROW(Dune::NotImplemented,
"Box scv geometries for dim=" << dim
433 <<
" dimWorld=" << dimWorld
434 <<
" type=" << type);
440 return getScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvfIdx);
444 template<
class Transformation>
445 static ScvfCornerStorage
getScvfCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvfIdx)
448 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
449 if (type == Dune::GeometryTypes::triangle)
454 else if (type == Dune::GeometryTypes::quadrilateral)
460 DUNE_THROW(Dune::NotImplemented,
"Box scvf geometries for dim=" << dim
461 <<
" dimWorld=" << dimWorld
462 <<
" type=" << type);
467 unsigned int indexInFacet)
const
469 return getBoundaryScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localFacetIndex, indexInFacet);
473 template<
class Transformation>
475 Transformation&& trans,
476 unsigned int localFacetIndex,
477 unsigned int indexInFacet)
482 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
484 constexpr int facetCodim = 1;
489 template <
int w = dimWorld>
490 typename std::enable_if<w == 3, GlobalPosition>::type
491 normal(
const ScvfCornerStorage& scvfCorners,
492 const std::array<LocalIndexType, 2>& scvIndices)
const
494 const auto v1 = geo_.corner(1) - geo_.corner(0);
495 const auto v2 = geo_.corner(2) - geo_.corner(0);
497 const auto t = scvfCorners[1] - scvfCorners[0];
502 const auto v = geo_.corner(scvIndices[1]) - geo_.corner(scvIndices[0]);
511 template <
int w = dimWorld>
512 typename std::enable_if<w == 2, GlobalPosition>::type
513 normal(
const ScvfCornerStorage& scvfCorners,
514 const std::array<LocalIndexType, 2>& scvIndices)
const
517 const auto t = scvfCorners[1] - scvfCorners[0];
518 GlobalPosition
normal({-t[1], t[0]});
522 const auto v = geo_.corner(scvIndices[1]) - geo_.corner(scvIndices[0]);
533 return referenceElement(geo_).size(dim-1);
539 return Dune::referenceElement<Scalar, dim>(type).size(dim-1);
545 return referenceElement(geo_).size(dim);
553 static Element::Geometry::LocalCoordinate
localScvfCenter(Dune::GeometryType type,
unsigned int localScvfIdx)
559 static Element::Geometry::LocalCoordinate
localBoundaryScvfCenter(Dune::GeometryType type,
unsigned int localFacetIndex,
unsigned int indexInFace)
565 const typename Element::Geometry& geo_;
569template <
class Gr
idView,
class ScvType,
class ScvfType>
572 using Scalar =
typename GridView::ctype;
573 using GlobalPosition =
typename Dune::FieldVector<Scalar, GridView::dimensionworld>;
574 using ScvCornerStorage =
typename ScvType::Traits::CornerStorage;
575 using ScvfCornerStorage =
typename ScvfType::Traits::CornerStorage;
576 using LocalIndexType =
typename ScvType::Traits::LocalIndexType;
578 using Element =
typename GridView::template Codim<0>::Entity;
579 using Intersection =
typename GridView::Intersection;
581 static constexpr auto dim = GridView::dimension;
582 static constexpr auto dimWorld = GridView::dimensionworld;
594 return getScvCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvIdx);
598 template<
class Transformation>
599 static ScvCornerStorage
getScvCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvIdx)
601 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
602 if (type == Dune::GeometryTypes::tetrahedron)
607 else if (type == Dune::GeometryTypes::prism)
612 else if (type == Dune::GeometryTypes::hexahedron)
618 DUNE_THROW(Dune::NotImplemented,
"Box scv geometries for dim=" << dim
619 <<
" dimWorld=" << dimWorld
620 <<
" type=" << type);
626 return getScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvfIdx);
630 template<
class Transformation>
631 static ScvfCornerStorage
getScvfCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvfIdx)
634 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
635 if (type == Dune::GeometryTypes::tetrahedron)
640 else if (type == Dune::GeometryTypes::prism)
645 else if (type == Dune::GeometryTypes::hexahedron)
651 DUNE_THROW(Dune::NotImplemented,
"Box scvf geometries for dim=" << dim
652 <<
" dimWorld=" << dimWorld
653 <<
" type=" << type);
658 unsigned int indexInFacet)
const
660 return getBoundaryScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localFacetIndex, indexInFacet);
664 template<
class Transformation>
666 Transformation&& trans,
667 unsigned localFacetIndex,
668 unsigned int indexInFacet)
670 constexpr int facetCodim = 1;
675 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
676 const auto facetType = ref.type(localFacetIndex, facetCodim);
677 if (facetType == Dune::GeometryTypes::triangle)
682 else if (facetType == Dune::GeometryTypes::quadrilateral)
688 DUNE_THROW(Dune::NotImplemented,
"Box boundary scvf geometries for dim=" << dim
689 <<
" dimWorld=" << dimWorld
690 <<
" type=" << facetType);
694 GlobalPosition
normal(
const ScvfCornerStorage& p,
695 const std::array<LocalIndexType, 2>& scvIndices)
const
700 const auto v = geo_.corner(scvIndices[1]) - geo_.corner(scvIndices[0]);
711 return referenceElement(geo_).size(dim-1);
717 return Dune::referenceElement<Scalar, dim>(type).size(dim-1);
723 return referenceElement(geo_).size(dim);
731 static Element::Geometry::LocalCoordinate
localScvfCenter(Dune::GeometryType type,
unsigned int localScvfIdx)
737 static Element::Geometry::LocalCoordinate
localBoundaryScvfCenter(Dune::GeometryType type,
unsigned int localFacetIndex,
unsigned int indexInFace)
743 const typename Element::Geometry& geo_;
Compute the center point of a convex polytope geometry or a random-access container of corner points.
const Element::Geometry & elementGeometry() const
the wrapped element geometry
Definition boxgeometryhelper.hh:368
std::size_t numInteriorScvf() const
number of sub control volume faces (number of edges)
Definition boxgeometryhelper.hh:350
static Element::Geometry::LocalCoordinate localScvfCenter(Dune::GeometryType type, unsigned int localScvfIdx)
local scvf center
Definition boxgeometryhelper.hh:372
BoxGeometryHelper(const typename Element::Geometry &geometry)
Definition boxgeometryhelper.hh:283
ScvCornerStorage getScvCorners(unsigned int localScvIdx) const
Create a vector with the scv corners.
Definition boxgeometryhelper.hh:288
PQ1LagrangeDofHelper< GridView > DofHelper
Definition boxgeometryhelper.hh:281
ScvfCornerStorage getBoundaryScvfCorners(unsigned int localFacetIndex, unsigned int) const
Create the sub control volume face geometries on the boundary.
Definition boxgeometryhelper.hh:323
static ScvCornerStorage getScvCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvIdx)
Create a vector with the scv corners.
Definition boxgeometryhelper.hh:295
GlobalPosition normal(const ScvfCornerStorage &scvfCorners, const std::array< LocalIndexType, 2 > &) const
get scvf normal vector
Definition boxgeometryhelper.hh:341
std::size_t numScv() const
number of sub control volumes (number of vertices)
Definition boxgeometryhelper.hh:362
ScvGeometry scvGeometry(unsigned int localScvIdx) const
Definition boxgeometryhelper.hh:302
static ScvfCornerStorage getBoundaryScvfCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localFacetIndex, unsigned int indexInFacet)
Create the sub control volume face geometries on the boundary.
Definition boxgeometryhelper.hh:331
ScvfCornerStorage getScvfCorners(unsigned int localScvfIdx) const
Create a vector with the corners of sub control volume faces.
Definition boxgeometryhelper.hh:308
static auto numInteriorScvf(Dune::GeometryType type)
number of interior sub control volume faces (number of edges)
Definition boxgeometryhelper.hh:356
static Element::Geometry::LocalCoordinate localBoundaryScvfCenter(Dune::GeometryType type, unsigned int localFacetIndex, unsigned int)
local boundary scvf center
Definition boxgeometryhelper.hh:378
static ScvfCornerStorage getScvfCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvfIdx)
Create a vector with the corners of sub control volume faces.
Definition boxgeometryhelper.hh:315
std::size_t numScv() const
number of sub control volumes (number of vertices)
Definition boxgeometryhelper.hh:543
std::size_t numInteriorScvf() const
number of sub control volume faces (number of edges)
Definition boxgeometryhelper.hh:531
static Element::Geometry::LocalCoordinate localScvfCenter(Dune::GeometryType type, unsigned int localScvfIdx)
local scvf center
Definition boxgeometryhelper.hh:553
static ScvfCornerStorage getScvfCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvfIdx)
Create a vector with the corners of sub control volume faces.
Definition boxgeometryhelper.hh:445
static ScvCornerStorage getScvCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvIdx)
Create a vector with the scv corners.
Definition boxgeometryhelper.hh:417
ScvfCornerStorage getScvfCorners(unsigned int localScvfIdx) const
Create a vector with the corners of sub control volume faces.
Definition boxgeometryhelper.hh:438
PQ1LagrangeDofHelper< GridView > DofHelper
Definition boxgeometryhelper.hh:403
std::enable_if< w==3, GlobalPosition >::type normal(const ScvfCornerStorage &scvfCorners, const std::array< LocalIndexType, 2 > &scvIndices) const
get scvf normal vector for dim == 2, dimworld == 3
Definition boxgeometryhelper.hh:491
BoxGeometryHelper(const typename Element::Geometry &geometry)
Definition boxgeometryhelper.hh:405
static ScvfCornerStorage getBoundaryScvfCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localFacetIndex, unsigned int indexInFacet)
Create the sub control volume face geometries on the boundary.
Definition boxgeometryhelper.hh:474
ScvfCornerStorage getBoundaryScvfCorners(unsigned int localFacetIndex, unsigned int indexInFacet) const
Create the sub control volume face geometries on the boundary.
Definition boxgeometryhelper.hh:466
const Element::Geometry & elementGeometry() const
the wrapped element geometry
Definition boxgeometryhelper.hh:549
static Element::Geometry::LocalCoordinate localBoundaryScvfCenter(Dune::GeometryType type, unsigned int localFacetIndex, unsigned int indexInFace)
local boundary scvf center
Definition boxgeometryhelper.hh:559
static auto numInteriorScvf(Dune::GeometryType type)
number of interior sub control volume faces (number of edges)
Definition boxgeometryhelper.hh:537
ScvCornerStorage getScvCorners(unsigned int localScvIdx) const
Create a vector with the scv corners.
Definition boxgeometryhelper.hh:410
std::enable_if< w==2, GlobalPosition >::type normal(const ScvfCornerStorage &scvfCorners, const std::array< LocalIndexType, 2 > &scvIndices) const
get scvf normal vector for dim == 2, dimworld == 2
Definition boxgeometryhelper.hh:513
static auto numInteriorScvf(Dune::GeometryType type)
number of interior sub control volume faces (number of edges)
Definition boxgeometryhelper.hh:715
GlobalPosition normal(const ScvfCornerStorage &p, const std::array< LocalIndexType, 2 > &scvIndices) const
get scvf normal vector
Definition boxgeometryhelper.hh:694
BoxGeometryHelper(const typename Element::Geometry &geometry)
Definition boxgeometryhelper.hh:587
const Element::Geometry & elementGeometry() const
the wrapped element geometry
Definition boxgeometryhelper.hh:727
static ScvfCornerStorage getScvfCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvfIdx)
Create a vector with the scvf corners.
Definition boxgeometryhelper.hh:631
ScvfCornerStorage getBoundaryScvfCorners(unsigned int localFacetIndex, unsigned int indexInFacet) const
Create the sub control volume face geometries on the boundary.
Definition boxgeometryhelper.hh:657
ScvCornerStorage getScvCorners(unsigned int localScvIdx) const
Create a vector with the scv corners.
Definition boxgeometryhelper.hh:592
static Element::Geometry::LocalCoordinate localBoundaryScvfCenter(Dune::GeometryType type, unsigned int localFacetIndex, unsigned int indexInFace)
local boundary scvf center
Definition boxgeometryhelper.hh:737
static Element::Geometry::LocalCoordinate localScvfCenter(Dune::GeometryType type, unsigned int localScvfIdx)
local scvf center
Definition boxgeometryhelper.hh:731
ScvfCornerStorage getScvfCorners(unsigned int localScvfIdx) const
Create a vector with the scvf corners.
Definition boxgeometryhelper.hh:624
static ScvCornerStorage getScvCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvIdx)
Create a vector with the scv corners.
Definition boxgeometryhelper.hh:599
std::size_t numScv() const
number of sub control volumes (number of vertices)
Definition boxgeometryhelper.hh:721
std::size_t numInteriorScvf() const
number of sub control volume faces (number of edges)
Definition boxgeometryhelper.hh:709
static ScvfCornerStorage getBoundaryScvfCorners(Dune::GeometryType type, Transformation &&trans, unsigned localFacetIndex, unsigned int indexInFacet)
Create the sub control volume face geometries on the boundary.
Definition boxgeometryhelper.hh:665
PQ1LagrangeDofHelper< GridView > DofHelper
Definition boxgeometryhelper.hh:585
Create sub control volumes and sub control volume face geometries.
Definition boxgeometryhelper.hh:261
Helper class providing degree of freedom information for the PQ1 Lagrange basis. The pq1 basis uses v...
Definition pq1/dofhelper.hh:32
Dune::FieldVector< Scalar, 3 > crossProduct(const Dune::FieldVector< Scalar, 3 > &vec1, const Dune::FieldVector< Scalar, 3 > &vec2)
Cross product of two vectors in three-dimensional Euclidean space.
Definition math.hh:671
Vector normal(const Vector &v)
Create a vector normal to the given one (v is expected to be non-zero).
Definition normal.hh:26
Corners::value_type center(const Corners &corners)
The center of a given list of corners.
Definition center.hh:24
Define some often used mathematical functions.
Definition boxgeometryhelper.hh:55
S subEntityKeyToCornerStorage(const ReferenceElement &ref, Transformation &&trans, unsigned int i, unsigned int c, const std::array< T, N > &key)
Definition boxgeometryhelper.hh:251
S keyToCornerStorageImpl(const ReferenceElement &ref, Transformation &&trans, const KeyArray &key, std::index_sequence< I... >)
Definition boxgeometryhelper.hh:224
S keyToCornerStorage(const ReferenceElement &ref, Transformation &&trans, const std::array< T, N > &key)
Definition boxgeometryhelper.hh:232
S subEntityKeyToCornerStorageImpl(const ReferenceElement &ref, Transformation &&trans, unsigned int i, unsigned int c, const KeyArray &key, std::index_sequence< I... >)
Definition boxgeometryhelper.hh:240
Definition common/pdesolver.hh:24
Helper class providing degree of freedom information for the PQ1 Lagrange basis.
Definition boxgeometryhelper.hh:42
std::array< Dune::FieldVector< ct, cdim >,(1<<(mydim)) > Type
Definition boxgeometryhelper.hh:43
Definition boxgeometryhelper.hh:49
static const bool v
Definition boxgeometryhelper.hh:50
static const unsigned int topologyId
Definition boxgeometryhelper.hh:51
Traits for an efficient corner storage for box method sub control volumes.
Definition boxgeometryhelper.hh:37
static constexpr std::array< std::array< Key, 8 >, 8 > keys
Definition boxgeometryhelper.hh:123
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:122
static constexpr std::array< std::array< Key, 2 >, 2 > keys
Definition boxgeometryhelper.hh:64
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:63
static constexpr std::array< std::array< Key, 8 >, 6 > keys
Definition boxgeometryhelper.hh:109
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:108
static constexpr std::array< std::array< Key, 4 >, 4 > keys
Definition boxgeometryhelper.hh:85
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:84
static constexpr std::array< std::array< Key, 8 >, 4 > keys
Definition boxgeometryhelper.hh:97
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:96
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:73
static constexpr std::array< std::array< Key, 4 >, 3 > keys
Definition boxgeometryhelper.hh:74
Definition boxgeometryhelper.hh:58
static constexpr std::array< std::array< Key, 4 >, 12 > keys
Definition boxgeometryhelper.hh:205
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:204
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:141
static constexpr std::array< std::array< Key, 1 >, 1 > keys
Definition boxgeometryhelper.hh:142
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:187
static constexpr std::array< std::array< Key, 4 >, 9 > keys
Definition boxgeometryhelper.hh:188
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:161
static constexpr std::array< std::array< Key, 2 >, 4 > keys
Definition boxgeometryhelper.hh:162
static constexpr std::array< std::array< Key, 4 >, 6 > keys
Definition boxgeometryhelper.hh:174
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:173
static constexpr std::array< std::array< Key, 2 >, 3 > keys
Definition boxgeometryhelper.hh:151
std::pair< std::uint8_t, std::uint8_t > Key
Definition boxgeometryhelper.hh:150
Definition boxgeometryhelper.hh:136