Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
e95a674e
Commit
e95a674e
authored
Mar 05, 2021
by
Dennis Gläser
Committed by
Timo Koch
Mar 05, 2021
Browse files
[facet][box][localview] add isBound()/element() interfaces
parent
ff54a3c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/multidomain/facet/box/fvelementgeometry.hh
View file @
e95a674e
...
...
@@ -25,6 +25,7 @@
#define DUMUX_FACETCOUPLING_BOX_FV_ELEMENT_GEOMETRY_HH
#include
<algorithm>
#include
<optional>
#include
<dune/geometry/type.hh>
...
...
@@ -110,7 +111,7 @@ public:
//! Get a local finite element basis
const
FeLocalBasis
&
feLocalBasis
()
const
{
return
gridGeometry
().
feCache
().
get
(
elem
GeometryT
ype
_
).
localBasis
();
}
{
return
gridGeometry
().
feCache
().
get
(
elem
ent_
->
t
ype
()
).
localBasis
();
}
//! The total number of sub control volumes
std
::
size_t
numScv
()
const
...
...
@@ -133,7 +134,7 @@ public:
//! For compatibility reasons with the FVGeometry cache being disabled
void
bindElement
(
const
Element
&
element
)
{
elem
GeometryType
_
=
element
.
type
()
;
elem
ent
_
=
element
;
eIdx_
=
gridGeometry
().
elementMapper
().
index
(
element
);
}
...
...
@@ -141,11 +142,19 @@ public:
const
GridGeometry
&
gridGeometry
()
const
{
return
*
gridGeometryPtr_
;
}
//! Returns true if bind/bindElement has already been called
bool
isBound
()
const
{
return
static_cast
<
bool
>
(
element_
);
}
//! The bound element
const
Element
&
element
()
const
{
return
*
element_
;
}
private:
Dune
::
GeometryType
elemGeometryType_
;
const
GridGeometry
*
gridGeometryPtr_
;
GridIndexType
eIdx_
;
std
::
optional
<
Element
>
element_
;
};
//! specialization in case the geometries are not stored grid-wide
...
...
@@ -216,7 +225,7 @@ public:
//! Get a local finite element basis
const
FeLocalBasis
&
feLocalBasis
()
const
{
return
gridGeometry
().
feCache
().
get
(
elem
GeometryT
ype
_
).
localBasis
();
}
{
return
gridGeometry
().
feCache
().
get
(
elem
ent_
->
t
ype
()
).
localBasis
();
}
//! The total number of sub control volumes
std
::
size_t
numScv
()
const
...
...
@@ -239,23 +248,30 @@ public:
//! For compatibility reasons with the FVGeometry cache being disabled
void
bindElement
(
const
Element
&
element
)
{
element_
=
element
;
eIdx_
=
gridGeometry
().
elementMapper
().
index
(
element
);
makeElementGeometries
(
element
);
makeElementGeometries
_
();
}
//! The global finite volume geometry we are a restriction of
const
GridGeometry
&
gridGeometry
()
const
{
return
*
gridGeometryPtr_
;
}
//! Returns true if bind/bindElement has already been called
bool
isBound
()
const
{
return
static_cast
<
bool
>
(
element_
);
}
//! The bound element
const
Element
&
element
()
const
{
return
*
element_
;
}
private:
void
makeElementGeometries
(
const
Element
&
element
)
void
makeElementGeometries
_
()
{
auto
eIdx
=
gridGeometry
().
elementMapper
().
index
(
element
);
// get the element geometry
auto
element
Geometry
=
element
.
geometry
()
;
elemGeometry
Type_
=
element
G
eometry
.
type
();
const
auto
&
element
=
*
element
_
;
const
auto
elem
ent
Geometry
=
element
.
g
eometry
();
const
auto
refElement
=
referenceElement
(
elementGeometry
);
// get the sub control volume geometries of this element
...
...
@@ -268,7 +284,7 @@ private:
for
(
LocalIndexType
scvLocalIdx
=
0
;
scvLocalIdx
<
elementGeometry
.
corners
();
++
scvLocalIdx
)
scvs_
.
emplace_back
(
geometryHelper
,
scvLocalIdx
,
eIdx
,
eIdx
_
,
gridGeometry
().
vertexMapper
().
subIndex
(
element
,
scvLocalIdx
,
dim
));
// construct the sub control volume faces
...
...
@@ -338,13 +354,13 @@ private:
}
}
//! The bound element
Dune
::
GeometryType
elemGeometryType_
;
GridIndexType
eIdx_
;
//! The global geometry this is a restriction of
const
GridGeometry
*
gridGeometryPtr_
;
//! The bound element
GridIndexType
eIdx_
;
std
::
optional
<
Element
>
element_
;
//! vectors to store the geometries locally after binding an element
std
::
vector
<
SubControlVolume
>
scvs_
;
std
::
vector
<
SubControlVolumeFace
>
scvfs_
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment