Skip to content
GitLab
Menu
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
aa99e831
Commit
aa99e831
authored
Mar 05, 2021
by
Dennis Gläser
Committed by
Timo Koch
Mar 05, 2021
Browse files
[boxdfm][localview] add isBound()/element() interfaces
parent
e95a674e
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/porousmediumflow/boxdfm/fvelementgeometry.hh
View file @
aa99e831
...
...
@@ -29,6 +29,8 @@
#ifndef DUMUX_POROUSMEDIUMFLOW_BOXDFM_FV_ELEMENT_GEOMETRY_HH
#define DUMUX_POROUSMEDIUMFLOW_BOXDFM_FV_ELEMENT_GEOMETRY_HH
#include
<optional>
#include
<dune/common/version.hh>
#include
<dune/geometry/type.hh>
#include
<dune/localfunctions/lagrange/pqkfactory.hh>
...
...
@@ -119,7 +121,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
...
...
@@ -144,7 +146,7 @@ public:
*/
void
bindElement
(
const
Element
&
element
)
{
elem
GeometryType
_
=
element
.
type
()
;
elem
ent
_
=
element
;
eIdx_
=
gridGeometry
().
elementMapper
().
index
(
element
);
}
...
...
@@ -152,9 +154,18 @@ 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_
;
std
::
optional
<
Element
>
element_
;
GridIndexType
eIdx_
;
};
...
...
@@ -229,7 +240,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,8 +250,12 @@ public:
std
::
size_t
numScvf
()
const
{
return
scvfs_
.
size
();
}
//! This function is for compatibility reasons with cc methods
//! The box stencil is always element-local so bind and bindElement are identical.
/*!
* \brief Binding of an element, has to be called before using the fvgeometries
* Prepares all the volume variables within the element.
* \note For the box scheme, bind() and bindElement() are identical, but the
* distinction is here for the sake of compatibility with cc schemes.
*/
void
bind
(
const
Element
&
element
)
{
this
->
bindElement
(
element
);
...
...
@@ -248,29 +263,34 @@ public:
/*!
* \brief Binding of an element, has to be called before using the fvgeometries
*
* Prepares all the volume variables within the element.
* For compatibility reasons with the FVGeometry cache being disabled.
* Prepares all the volume variables within the element.
*/
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
(
element
);
// get the sub control volume geometries of this element
...
...
@@ -287,7 +307,7 @@ private:
// add scv to the local container
scvs_
[
scvLocalIdx
]
=
SubControlVolume
(
geometryHelper
,
scvLocalIdx
,
eIdx
,
eIdx
_
,
dofIdxGlobal
);
}
...
...
@@ -368,7 +388,7 @@ private:
static_cast
<
LocalIndexType
>
(
refElement
.
subEntity
(
idxInInside
,
1
,
vIdxLocal
,
dim
)),
scvLocalIdx
++
,
idxInInside
,
eIdx
,
eIdx
_
,
isVertexIndices
[
vIdxLocal
]);
// add fracture scvf for each edge of the intersection in 3d
...
...
@@ -422,19 +442,13 @@ private:
}
//! The bound element
Dune
::
GeometryType
elemGeometryType
_
;
std
::
optional
<
Element
>
element
_
;
GridIndexType
eIdx_
;
//! The global geometry this is a restriction of
const
GridGeometry
*
gridGeometryPtr_
;
/*!
* \brief Binding of an element, has to be called before using the fvgeometries
*
* Prepares all the volume variables within the element.
* For compatibility reasons with the FVGeometry cache being disabled.
* vectors to store the geometries locally after binding an element
*/
//! The element-local scvs & scvfs
std
::
vector
<
SubControlVolume
>
scvs_
;
std
::
vector
<
SubControlVolumeFace
>
scvfs_
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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