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>
36 template<
int mydim,
int cdim >
39 using Type = std::array< Dune::FieldVector< ct, cdim >, (1<<(mydim)) >;
46 static const bool v =
true;
47 static const unsigned int topologyId = Dune::GeometryTypes::cube(mydim).id();
53template<Dune::GeometryType::Id gt>
59 using Key = std::pair<std::uint8_t, std::uint8_t>;
60 static constexpr std::array<std::array<Key, 2>, 2> keys = {{
69 using Key = std::pair<std::uint8_t, std::uint8_t>;
70 static constexpr std::array<std::array<Key, 4>, 3> keys = {{
80 using Key = std::pair<std::uint8_t, std::uint8_t>;
81 static constexpr std::array<std::array<Key, 4>, 4> keys = {{
92 using Key = std::pair<std::uint8_t, std::uint8_t>;
93 static constexpr std::array<std::array<Key, 8>, 4> keys = {{
94 {
Key{0, 3},
Key{0, 2},
Key{1, 2},
Key{0, 1},
Key{3, 2},
Key{1, 1},
Key{2, 1},
Key{0, 0} },
95 {
Key{1, 3},
Key{2, 2},
Key{0, 2},
Key{0, 1},
Key{4, 2},
Key{3, 1},
Key{1, 1},
Key{0, 0} },
96 {
Key{2, 3},
Key{1, 2},
Key{2, 2},
Key{0, 1},
Key{5, 2},
Key{2, 1},
Key{3, 1},
Key{0, 0} },
97 {
Key{3, 3},
Key{3, 2},
Key{5, 2},
Key{2, 1},
Key{4, 2},
Key{1, 1},
Key{3, 1},
Key{0, 0} }
104 using Key = std::pair<std::uint8_t, std::uint8_t>;
105 static constexpr std::array<std::array<Key, 8>, 6> keys = {{
106 {
Key{0, 3},
Key{3, 2},
Key{4, 2},
Key{3, 1},
Key{0, 2},
Key{0, 1},
Key{1, 1},
Key{0, 0} },
107 {
Key{1, 3},
Key{5, 2},
Key{3, 2},
Key{3, 1},
Key{1, 2},
Key{2, 1},
Key{0, 1},
Key{0, 0} },
108 {
Key{2, 3},
Key{4, 2},
Key{5, 2},
Key{3, 1},
Key{2, 2},
Key{1, 1},
Key{2, 1},
Key{0, 0} },
109 {
Key{3, 3},
Key{7, 2},
Key{6, 2},
Key{4, 1},
Key{0, 2},
Key{1, 1},
Key{0, 1},
Key{0, 0} },
110 {
Key{4, 3},
Key{6, 2},
Key{8, 2},
Key{4, 1},
Key{1, 2},
Key{0, 1},
Key{2, 1},
Key{0, 0} },
111 {
Key{5, 3},
Key{8, 2},
Key{7, 2},
Key{4, 1},
Key{2, 2},
Key{2, 1},
Key{1, 1},
Key{0, 0} }
118 using Key = std::pair<std::uint8_t, std::uint8_t>;
119 static constexpr std::array<std::array<Key, 8>, 8> keys = {{
120 {
Key{0, 3},
Key{6, 2},
Key{4, 2},
Key{4, 1},
Key{0, 2},
Key{2, 1},
Key{0, 1},
Key{0, 0} },
121 {
Key{1, 3},
Key{5, 2},
Key{6, 2},
Key{4, 1},
Key{1, 2},
Key{1, 1},
Key{2, 1},
Key{0, 0} },
122 {
Key{2, 3},
Key{4, 2},
Key{7, 2},
Key{4, 1},
Key{2, 2},
Key{0, 1},
Key{3, 1},
Key{0, 0} },
123 {
Key{3, 3},
Key{7, 2},
Key{5, 2},
Key{4, 1},
Key{3, 2},
Key{3, 1},
Key{1, 1},
Key{0, 0} },
124 {
Key{4, 3},
Key{8, 2},
Key{10, 2},
Key{5, 1},
Key{0, 2},
Key{0, 1},
Key{2, 1},
Key{0, 0} },
125 {
Key{5, 3},
Key{10, 2},
Key{9, 2},
Key{5, 1},
Key{1, 2},
Key{2, 1},
Key{1, 1},
Key{0, 0} },
126 {
Key{6, 3},
Key{11, 2},
Key{8, 2},
Key{5, 1},
Key{2, 2},
Key{3, 1},
Key{0, 1},
Key{0, 0} },
127 {
Key{7, 3},
Key{9, 2},
Key{11, 2},
Key{5, 1},
Key{3, 2},
Key{1, 1},
Key{3, 1},
Key{0, 0} }
131template<Dune::GeometryType::Id gt>
137 using Key = std::pair<std::uint8_t, std::uint8_t>;
138 static constexpr std::array<std::array<Key, 1>, 1> keys = {{
146 using Key = std::pair<std::uint8_t, std::uint8_t>;
147 static constexpr std::array<std::array<Key, 2>, 3> keys = {{
157 using Key = std::pair<std::uint8_t, std::uint8_t>;
158 static constexpr std::array<std::array<Key, 2>, 4> keys = {{
169 using Key = std::pair<std::uint8_t, std::uint8_t>;
170 static constexpr std::array<std::array<Key, 4>, 6> keys = {{
183 using Key = std::pair<std::uint8_t, std::uint8_t>;
184 static constexpr std::array<std::array<Key, 4>, 9> keys = {{
200 using Key = std::pair<std::uint8_t, std::uint8_t>;
201 static constexpr std::array<std::array<Key, 4>, 12> keys = {{
219template<
class S,
class ReferenceElement,
class Transformation,
class KeyArray, std::size_t... I>
220S
keyToCornerStorageImpl(
const ReferenceElement& ref, Transformation&& trans,
const KeyArray& key, std::index_sequence<I...>)
223 return { trans(ref.position(key[I].first, key[I].second))... };
227template<
class S,
class ReferenceElement,
class Transformation,
class T, std::
size_t N,
class Indices = std::make_index_sequence<N>>
228S
keyToCornerStorage(
const ReferenceElement& ref, Transformation&& trans,
const std::array<T, N>& key)
230 return keyToCornerStorageImpl<S>(ref, trans, key, Indices{});
235template<
class S,
class ReferenceElement,
class Transformation,
class KeyArray, std::size_t... I>
237 unsigned int i,
unsigned int c,
const KeyArray& key, std::index_sequence<I...>)
241 return { trans(ref.position(ref.subEntity(i, c, key[I].first, c+key[I].second), c+key[I].second))... };
246template<
class S,
class ReferenceElement,
class Transformation,
class T, std::
size_t N,
class Indices = std::make_index_sequence<N>>
248 unsigned int i,
unsigned int c,
const std::array<T, N>& key)
250 return subEntityKeyToCornerStorageImpl<S>(ref, trans, i, c, key, Indices{});
256template<
class Gr
idView,
int dim,
class ScvType,
class ScvfType>
260template <
class Gr
idView,
class ScvType,
class ScvfType>
264 using Scalar =
typename GridView::ctype;
265 using GlobalPosition =
typename Dune::FieldVector<Scalar, GridView::dimensionworld>;
266 using ScvCornerStorage =
typename ScvType::Traits::CornerStorage;
267 using ScvfCornerStorage =
typename ScvfType::Traits::CornerStorage;
268 using ScvGeometry =
typename ScvType::Traits::Geometry;
269 using ScvfGeometry =
typename ScvfType::Traits::Geometry;
270 using LocalIndexType =
typename ScvType::Traits::LocalIndexType;
272 using Element =
typename GridView::template Codim<0>::Entity;
273 using Intersection =
typename GridView::Intersection;
275 static constexpr int dim = 1;
285 return getScvCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvIdx);
289 template<
class Transformation>
290 static ScvCornerStorage
getScvCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvIdx)
292 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
294 return Detail::Box::keyToCornerStorage<ScvCornerStorage>(ref, trans, Corners::keys[localScvIdx]);
305 return getScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvfIdx);
309 template<
class Transformation>
310 static ScvfCornerStorage
getScvfCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvfIdx)
312 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
314 return Detail::Box::keyToCornerStorage<ScvfCornerStorage>(ref, trans, Corners::keys[localScvfIdx]);
321 return ScvfCornerStorage{{ geo_.corner(localFacetIndex) }};
325 template<
class Transformation>
327 Transformation&& trans,
328 unsigned int localFacetIndex,
329 unsigned int indexInFacet)
331 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
332 return trans(ref.position(localFacetIndex, dim));
336 GlobalPosition
normal(
const ScvfCornerStorage& scvfCorners,
337 const std::array<LocalIndexType, 2>&)
const
339 auto normal = geo_.corner(1) - geo_.corner(0);
347 return referenceElement(geo_).size(dim-1);
353 return Dune::referenceElement<Scalar, dim>(type).size(dim-1);
359 return referenceElement(geo_).size(dim);
367 template<
class LocalKey>
368 static Element::Geometry::LocalCoordinate
localDofPosition(Dune::GeometryType type,
const LocalKey& localKey)
370 return Dune::referenceElement<Scalar, dim>(type).position(localKey.subEntity(), localKey.codim());
374 static Element::Geometry::LocalCoordinate
localScvfCenter(Dune::GeometryType type,
unsigned int localScvfIdx)
376 return Dumux::center(getScvfCorners_(type, [&](
const auto& local){
return local; }, localScvfIdx));
380 static Element::Geometry::LocalCoordinate
localBoundaryScvfCenter(Dune::GeometryType type,
unsigned int localFacetIndex,
unsigned int)
382 return Dune::referenceElement<Scalar, dim>(type).position(localFacetIndex, dim);
386 const typename Element::Geometry& geo_;
390template <
class Gr
idView,
class ScvType,
class ScvfType>
393 using Scalar =
typename GridView::ctype;
394 using GlobalPosition =
typename Dune::FieldVector<Scalar, GridView::dimensionworld>;
395 using ScvCornerStorage =
typename ScvType::Traits::CornerStorage;
396 using ScvfCornerStorage =
typename ScvfType::Traits::CornerStorage;
397 using LocalIndexType =
typename ScvType::Traits::LocalIndexType;
399 using Element =
typename GridView::template Codim<0>::Entity;
400 using Intersection =
typename GridView::Intersection;
402 static constexpr auto dim = GridView::dimension;
403 static constexpr auto dimWorld = GridView::dimensionworld;
413 return getScvCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvIdx);
417 template<
class Transformation>
418 static ScvCornerStorage
getScvCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvIdx)
421 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
422 if (type == Dune::GeometryTypes::triangle)
425 return Detail::Box::keyToCornerStorage<ScvCornerStorage>(ref, trans, Corners::keys[localScvIdx]);
427 else if (type == Dune::GeometryTypes::quadrilateral)
430 return Detail::Box::keyToCornerStorage<ScvCornerStorage>(ref, trans, Corners::keys[localScvIdx]);
433 DUNE_THROW(Dune::NotImplemented,
"Box scv geometries for dim=" << dim
434 <<
" dimWorld=" << dimWorld
435 <<
" type=" << type);
441 return getScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvfIdx);
445 template<
class Transformation>
446 static ScvfCornerStorage
getScvfCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvfIdx)
449 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
450 if (type == Dune::GeometryTypes::triangle)
453 return Detail::Box::keyToCornerStorage<ScvfCornerStorage>(ref, trans, Corners::keys[localScvfIdx]);
455 else if (type == Dune::GeometryTypes::quadrilateral)
458 return Detail::Box::keyToCornerStorage<ScvfCornerStorage>(ref, trans, Corners::keys[localScvfIdx]);
461 DUNE_THROW(Dune::NotImplemented,
"Box scvf geometries for dim=" << dim
462 <<
" dimWorld=" << dimWorld
463 <<
" type=" << type);
468 unsigned int indexInFacet)
const
470 return getBoundaryScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localFacetIndex, indexInFacet);
474 template<
class Transformation>
476 Transformation&& trans,
477 unsigned int localFacetIndex,
478 unsigned int indexInFacet)
483 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
485 constexpr int facetCodim = 1;
486 return Detail::Box::subEntityKeyToCornerStorage<ScvfCornerStorage>(ref, trans, localFacetIndex, facetCodim, Corners::keys[indexInFacet]);
490 template <
int w = dimWorld>
491 typename std::enable_if<w == 3, GlobalPosition>::type
492 normal(
const ScvfCornerStorage& scvfCorners,
493 const std::array<LocalIndexType, 2>& scvIndices)
const
495 const auto v1 = geo_.corner(1) - geo_.corner(0);
496 const auto v2 = geo_.corner(2) - geo_.corner(0);
498 const auto t = scvfCorners[1] - scvfCorners[0];
503 const auto v = geo_.corner(scvIndices[1]) - geo_.corner(scvIndices[0]);
512 template <
int w = dimWorld>
513 typename std::enable_if<w == 2, GlobalPosition>::type
514 normal(
const ScvfCornerStorage& scvfCorners,
515 const std::array<LocalIndexType, 2>& scvIndices)
const
518 const auto t = scvfCorners[1] - scvfCorners[0];
519 GlobalPosition
normal({-t[1], t[0]});
523 const auto v = geo_.corner(scvIndices[1]) - geo_.corner(scvIndices[0]);
534 return referenceElement(geo_).size(dim-1);
540 return Dune::referenceElement<Scalar, dim>(type).size(dim-1);
546 return referenceElement(geo_).size(dim);
554 template<
class LocalKey>
555 static Element::Geometry::LocalCoordinate
localDofPosition(Dune::GeometryType type,
const LocalKey& localKey)
557 return Dune::referenceElement<Scalar, dim>(type).position(localKey.subEntity(), localKey.codim());
561 static Element::Geometry::LocalCoordinate
localScvfCenter(Dune::GeometryType type,
unsigned int localScvfIdx)
563 return Dumux::center(getScvfCorners(type, [&](
const auto& local){
return local; }, localScvfIdx));
567 static Element::Geometry::LocalCoordinate
localBoundaryScvfCenter(Dune::GeometryType type,
unsigned int localFacetIndex,
unsigned int indexInFace)
569 return Dumux::center(getBoundaryScvfCorners(type, [&](
const auto& local){
return local; }, localFacetIndex, indexInFace));
573 const typename Element::Geometry& geo_;
577template <
class Gr
idView,
class ScvType,
class ScvfType>
580 using Scalar =
typename GridView::ctype;
581 using GlobalPosition =
typename Dune::FieldVector<Scalar, GridView::dimensionworld>;
582 using ScvCornerStorage =
typename ScvType::Traits::CornerStorage;
583 using ScvfCornerStorage =
typename ScvfType::Traits::CornerStorage;
584 using LocalIndexType =
typename ScvType::Traits::LocalIndexType;
586 using Element =
typename GridView::template Codim<0>::Entity;
587 using Intersection =
typename GridView::Intersection;
589 static constexpr auto dim = GridView::dimension;
590 static constexpr auto dimWorld = GridView::dimensionworld;
600 return getScvCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvIdx);
604 template<
class Transformation>
605 static ScvCornerStorage
getScvCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvIdx)
607 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
608 if (type == Dune::GeometryTypes::tetrahedron)
611 return Detail::Box::keyToCornerStorage<ScvCornerStorage>(ref, trans, Corners::keys[localScvIdx]);
613 else if (type == Dune::GeometryTypes::prism)
616 return Detail::Box::keyToCornerStorage<ScvCornerStorage>(ref, trans, Corners::keys[localScvIdx]);
618 else if (type == Dune::GeometryTypes::hexahedron)
621 return Detail::Box::keyToCornerStorage<ScvCornerStorage>(ref, trans, Corners::keys[localScvIdx]);
624 DUNE_THROW(Dune::NotImplemented,
"Box scv geometries for dim=" << dim
625 <<
" dimWorld=" << dimWorld
626 <<
" type=" << type);
632 return getScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localScvfIdx);
636 template<
class Transformation>
637 static ScvfCornerStorage
getScvfCorners(Dune::GeometryType type, Transformation&& trans,
unsigned int localScvfIdx)
640 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
641 if (type == Dune::GeometryTypes::tetrahedron)
644 return Detail::Box::keyToCornerStorage<ScvfCornerStorage>(ref, trans, Corners::keys[localScvfIdx]);
646 else if (type == Dune::GeometryTypes::prism)
649 return Detail::Box::keyToCornerStorage<ScvfCornerStorage>(ref, trans, Corners::keys[localScvfIdx]);
651 else if (type == Dune::GeometryTypes::hexahedron)
654 return Detail::Box::keyToCornerStorage<ScvfCornerStorage>(ref, trans, Corners::keys[localScvfIdx]);
657 DUNE_THROW(Dune::NotImplemented,
"Box scvf geometries for dim=" << dim
658 <<
" dimWorld=" << dimWorld
659 <<
" type=" << type);
664 unsigned int indexInFacet)
const
666 return getBoundaryScvfCorners(geo_.type(), [&](
const auto& local){ return geo_.global(local); }, localFacetIndex, indexInFacet);
670 template<
class Transformation>
672 Transformation&& trans,
673 unsigned localFacetIndex,
674 unsigned int indexInFacet)
676 constexpr int facetCodim = 1;
681 const auto& ref = Dune::referenceElement<Scalar, dim>(type);
682 const auto facetType = ref.type(localFacetIndex, facetCodim);
683 if (facetType == Dune::GeometryTypes::triangle)
686 return Detail::Box::subEntityKeyToCornerStorage<ScvfCornerStorage>(ref, trans, localFacetIndex, facetCodim, Corners::keys[indexInFacet]);
688 else if (facetType == Dune::GeometryTypes::quadrilateral)
691 return Detail::Box::subEntityKeyToCornerStorage<ScvfCornerStorage>(ref, trans, localFacetIndex, facetCodim, Corners::keys[indexInFacet]);
694 DUNE_THROW(Dune::NotImplemented,
"Box boundary scvf geometries for dim=" << dim
695 <<
" dimWorld=" << dimWorld
696 <<
" type=" << facetType);
700 GlobalPosition
normal(
const ScvfCornerStorage& p,
701 const std::array<LocalIndexType, 2>& scvIndices)
const
706 const auto v = geo_.corner(scvIndices[1]) - geo_.corner(scvIndices[0]);
717 return referenceElement(geo_).size(dim-1);
723 return Dune::referenceElement<Scalar, dim>(type).size(dim-1);
729 return referenceElement(geo_).size(dim);
737 template<
class LocalKey>
738 static Element::Geometry::LocalCoordinate
localDofPosition(Dune::GeometryType type,
const LocalKey& localKey)
740 return Dune::referenceElement<Scalar, dim>(type).position(localKey.subEntity(), localKey.codim());
744 static Element::Geometry::LocalCoordinate
localScvfCenter(Dune::GeometryType type,
unsigned int localScvfIdx)
746 return Dumux::center(getScvfCorners(type, [&](
const auto& local){
return local; }, localScvfIdx));
750 static Element::Geometry::LocalCoordinate
localBoundaryScvfCenter(Dune::GeometryType type,
unsigned int localFacetIndex,
unsigned int indexInFace)
752 return Dumux::center(getBoundaryScvfCorners(type, [&](
const auto& local){
return local; }, localFacetIndex, indexInFace));
756 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:363
std::size_t numInteriorScvf() const
number of sub control volume faces (number of edges)
Definition: boxgeometryhelper.hh:345
static Element::Geometry::LocalCoordinate localScvfCenter(Dune::GeometryType type, unsigned int localScvfIdx)
local scvf center
Definition: boxgeometryhelper.hh:374
BoxGeometryHelper(const typename Element::Geometry &geometry)
Definition: boxgeometryhelper.hh:278
ScvCornerStorage getScvCorners(unsigned int localScvIdx) const
Create a vector with the scv corners.
Definition: boxgeometryhelper.hh:283
ScvfCornerStorage getBoundaryScvfCorners(unsigned int localFacetIndex, unsigned int) const
Create the sub control volume face geometries on the boundary.
Definition: boxgeometryhelper.hh:318
static ScvCornerStorage getScvCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvIdx)
Create a vector with the scv corners.
Definition: boxgeometryhelper.hh:290
GlobalPosition normal(const ScvfCornerStorage &scvfCorners, const std::array< LocalIndexType, 2 > &) const
get scvf normal vector
Definition: boxgeometryhelper.hh:336
std::size_t numScv() const
number of sub control volumes (number of vertices)
Definition: boxgeometryhelper.hh:357
ScvGeometry scvGeometry(unsigned int localScvIdx) const
Definition: boxgeometryhelper.hh:297
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:326
ScvfCornerStorage getScvfCorners(unsigned int localScvfIdx) const
Create a vector with the corners of sub control volume faces.
Definition: boxgeometryhelper.hh:303
static auto numInteriorScvf(Dune::GeometryType type)
number of interior sub control volume faces (number of edges)
Definition: boxgeometryhelper.hh:351
static Element::Geometry::LocalCoordinate localBoundaryScvfCenter(Dune::GeometryType type, unsigned int localFacetIndex, unsigned int)
local boundary scvf center
Definition: boxgeometryhelper.hh:380
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:310
static Element::Geometry::LocalCoordinate localDofPosition(Dune::GeometryType type, const LocalKey &localKey)
local dof position
Definition: boxgeometryhelper.hh:368
std::size_t numScv() const
number of sub control volumes (number of vertices)
Definition: boxgeometryhelper.hh:544
std::size_t numInteriorScvf() const
number of sub control volume faces (number of edges)
Definition: boxgeometryhelper.hh:532
static Element::Geometry::LocalCoordinate localScvfCenter(Dune::GeometryType type, unsigned int localScvfIdx)
local scvf center
Definition: boxgeometryhelper.hh:561
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:446
static ScvCornerStorage getScvCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvIdx)
Create a vector with the scv corners.
Definition: boxgeometryhelper.hh:418
ScvfCornerStorage getScvfCorners(unsigned int localScvfIdx) const
Create a vector with the corners of sub control volume faces.
Definition: boxgeometryhelper.hh:439
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:492
BoxGeometryHelper(const typename Element::Geometry &geometry)
Definition: boxgeometryhelper.hh:406
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:475
static Element::Geometry::LocalCoordinate localDofPosition(Dune::GeometryType type, const LocalKey &localKey)
local dof position
Definition: boxgeometryhelper.hh:555
ScvfCornerStorage getBoundaryScvfCorners(unsigned int localFacetIndex, unsigned int indexInFacet) const
Create the sub control volume face geometries on the boundary.
Definition: boxgeometryhelper.hh:467
const Element::Geometry & elementGeometry() const
the wrapped element geometry
Definition: boxgeometryhelper.hh:550
static Element::Geometry::LocalCoordinate localBoundaryScvfCenter(Dune::GeometryType type, unsigned int localFacetIndex, unsigned int indexInFace)
local boundary scvf center
Definition: boxgeometryhelper.hh:567
static auto numInteriorScvf(Dune::GeometryType type)
number of interior sub control volume faces (number of edges)
Definition: boxgeometryhelper.hh:538
ScvCornerStorage getScvCorners(unsigned int localScvIdx) const
Create a vector with the scv corners.
Definition: boxgeometryhelper.hh:411
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:514
static auto numInteriorScvf(Dune::GeometryType type)
number of interior sub control volume faces (number of edges)
Definition: boxgeometryhelper.hh:721
static Element::Geometry::LocalCoordinate localDofPosition(Dune::GeometryType type, const LocalKey &localKey)
local dof position
Definition: boxgeometryhelper.hh:738
GlobalPosition normal(const ScvfCornerStorage &p, const std::array< LocalIndexType, 2 > &scvIndices) const
get scvf normal vector
Definition: boxgeometryhelper.hh:700
BoxGeometryHelper(const typename Element::Geometry &geometry)
Definition: boxgeometryhelper.hh:593
const Element::Geometry & elementGeometry() const
the wrapped element geometry
Definition: boxgeometryhelper.hh:733
static ScvfCornerStorage getScvfCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvfIdx)
Create a vector with the scvf corners.
Definition: boxgeometryhelper.hh:637
ScvfCornerStorage getBoundaryScvfCorners(unsigned int localFacetIndex, unsigned int indexInFacet) const
Create the sub control volume face geometries on the boundary.
Definition: boxgeometryhelper.hh:663
ScvCornerStorage getScvCorners(unsigned int localScvIdx) const
Create a vector with the scv corners.
Definition: boxgeometryhelper.hh:598
static Element::Geometry::LocalCoordinate localBoundaryScvfCenter(Dune::GeometryType type, unsigned int localFacetIndex, unsigned int indexInFace)
local boundary scvf center
Definition: boxgeometryhelper.hh:750
static Element::Geometry::LocalCoordinate localScvfCenter(Dune::GeometryType type, unsigned int localScvfIdx)
local scvf center
Definition: boxgeometryhelper.hh:744
ScvfCornerStorage getScvfCorners(unsigned int localScvfIdx) const
Create a vector with the scvf corners.
Definition: boxgeometryhelper.hh:630
static ScvCornerStorage getScvCorners(Dune::GeometryType type, Transformation &&trans, unsigned int localScvIdx)
Create a vector with the scv corners.
Definition: boxgeometryhelper.hh:605
std::size_t numScv() const
number of sub control volumes (number of vertices)
Definition: boxgeometryhelper.hh:727
std::size_t numInteriorScvf() const
number of sub control volume faces (number of edges)
Definition: boxgeometryhelper.hh:715
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:671
Create sub control volumes and sub control volume face geometries.
Definition: boxgeometryhelper.hh:257
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.
S subEntityKeyToCornerStorage(const ReferenceElement &ref, Transformation &&trans, unsigned int i, unsigned int c, const std::array< T, N > &key)
Definition: boxgeometryhelper.hh:247
S keyToCornerStorageImpl(const ReferenceElement &ref, Transformation &&trans, const KeyArray &key, std::index_sequence< I... >)
Definition: boxgeometryhelper.hh:220
S keyToCornerStorage(const ReferenceElement &ref, Transformation &&trans, const std::array< T, N > &key)
Definition: boxgeometryhelper.hh:228
S subEntityKeyToCornerStorageImpl(const ReferenceElement &ref, Transformation &&trans, unsigned int i, unsigned int c, const KeyArray &key, std::index_sequence< I... >)
Definition: boxgeometryhelper.hh:236
CVFE< CVFEMethods::PQ1 > Box
Definition: method.hh:94
constexpr Line line
Definition: couplingmanager1d3d_line.hh:31
Definition: common/pdesolver.hh:24
Definition: boxgeometryhelper.hh:38
std::array< Dune::FieldVector< ct, cdim >,(1<<(mydim)) > Type
Definition: boxgeometryhelper.hh:39
Definition: boxgeometryhelper.hh:45
static const bool v
Definition: boxgeometryhelper.hh:46
static const unsigned int topologyId
Definition: boxgeometryhelper.hh:47
Traits for an efficient corner storage for box method sub control volumes.
Definition: boxgeometryhelper.hh:33
Definition: boxgeometryhelper.hh:117
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:118
Definition: boxgeometryhelper.hh:58
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:59
Definition: boxgeometryhelper.hh:103
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:104
Definition: boxgeometryhelper.hh:79
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:80
Definition: boxgeometryhelper.hh:91
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:92
Definition: boxgeometryhelper.hh:68
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:69
Definition: boxgeometryhelper.hh:54
Definition: boxgeometryhelper.hh:199
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:200
Definition: boxgeometryhelper.hh:136
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:137
Definition: boxgeometryhelper.hh:182
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:183
Definition: boxgeometryhelper.hh:156
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:157
Definition: boxgeometryhelper.hh:168
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:169
Definition: boxgeometryhelper.hh:145
std::pair< std::uint8_t, std::uint8_t > Key
Definition: boxgeometryhelper.hh:146
Definition: boxgeometryhelper.hh:132