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
7ea708ad
Commit
7ea708ad
authored
Jul 05, 2019
by
Dennis Gläser
Browse files
[box][fvgeom] avoid storing element pointer
parent
9f8b4305
Changes
3
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/box/fvelementgeometry.hh
View file @
7ea708ad
...
...
@@ -26,6 +26,7 @@
#ifndef DUMUX_DISCRETIZATION_BOX_FV_ELEMENT_GEOMETRY_HH
#define DUMUX_DISCRETIZATION_BOX_FV_ELEMENT_GEOMETRY_HH
#include
<dune/geometry/type.hh>
#include
<dune/geometry/referenceelements.hh>
#include
<dune/localfunctions/lagrange/pqkfactory.hh>
...
...
@@ -114,7 +115,7 @@ public:
//! Get a local finite element basis
const
FeLocalBasis
&
feLocalBasis
()
const
{
return
fvGridGeometry
().
feCache
().
get
(
elem
entPtr_
->
g
eometry
().
t
ype
()
).
localBasis
();
return
fvGridGeometry
().
feCache
().
get
(
elem
G
eometry
T
ype
_
).
localBasis
();
}
//! The total number of sub control volumes
...
...
@@ -142,7 +143,7 @@ public:
//! For compatibility reasons with the FVGeometry cache being disabled
void
bindElement
(
const
Element
&
element
)
{
elem
entPtr
_
=
&
element
;
elem
GeometryType
_
=
element
.
geometry
().
type
()
;
eIdx_
=
fvGridGeometry
().
elementMapper
().
index
(
element
);
}
...
...
@@ -155,7 +156,7 @@ public:
{
return
fvGridGeometry
().
hasBoundaryScvf
(
eIdx_
);
}
private:
const
Element
*
elementPtr
_
;
Dune
::
GeometryType
elemGeometryType
_
;
const
FVGridGeometry
*
fvGridGeometryPtr_
;
GridIndexType
eIdx_
;
...
...
@@ -231,7 +232,7 @@ public:
//! Get a local finite element basis
const
FeLocalBasis
&
feLocalBasis
()
const
{
return
fvGridGeometry
().
feCache
().
get
(
elem
entPtr_
->
g
eometry
().
t
ype
()
).
localBasis
();
return
fvGridGeometry
().
feCache
().
get
(
elem
G
eometry
T
ype
_
).
localBasis
();
}
//! The total number of sub control volumes
...
...
@@ -259,7 +260,6 @@ public:
//! For compatibility reasons with the FVGeometry cache being disabled
void
bindElement
(
const
Element
&
element
)
{
elementPtr_
=
&
element
;
eIdx_
=
fvGridGeometry
().
elementMapper
().
index
(
element
);
makeElementGeometries
(
element
);
}
...
...
@@ -280,7 +280,8 @@ private:
// get the element geometry
auto
elementGeometry
=
element
.
geometry
();
const
auto
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
elemGeometryType_
=
elementGeometry
.
type
();
const
auto
referenceElement
=
ReferenceElements
::
general
(
elemGeometryType_
);
// get the sub control volume geometries of this element
GeometryHelper
geometryHelper
(
elementGeometry
);
...
...
@@ -348,7 +349,7 @@ private:
}
//! The bound element
const
Element
*
elementPtr
_
;
Dune
::
GeometryType
elemGeometryType
_
;
GridIndexType
eIdx_
;
//! The global geometry this is a restriction of
...
...
dumux/multidomain/facet/box/fvelementgeometry.hh
View file @
7ea708ad
...
...
@@ -26,6 +26,7 @@
#include
<algorithm>
#include
<dune/geometry/type.hh>
#include
<dune/geometry/referenceelements.hh>
#include
<dumux/common/indextraits.hh>
...
...
@@ -110,7 +111,7 @@ public:
//! Get a local finite element basis
const
FeLocalBasis
&
feLocalBasis
()
const
{
return
fvGridGeometry
().
feCache
().
get
(
elem
entPtr_
->
g
eometry
().
t
ype
()
).
localBasis
();
}
{
return
fvGridGeometry
().
feCache
().
get
(
elem
G
eometry
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
entPtr
_
=
&
element
;
elem
GeometryType
_
=
element
.
geometry
().
type
()
;
eIdx_
=
fvGridGeometry
().
elementMapper
().
index
(
element
);
}
...
...
@@ -142,7 +143,7 @@ public:
{
return
*
fvGridGeometryPtr_
;
}
private:
const
Element
*
elementPtr
_
;
Dune
::
GeometryType
elemGeometryType
_
;
const
FVGridGeometry
*
fvGridGeometryPtr_
;
GridIndexType
eIdx_
;
...
...
@@ -216,7 +217,7 @@ public:
//! Get a local finite element basis
const
FeLocalBasis
&
feLocalBasis
()
const
{
return
fvGridGeometry
().
feCache
().
get
(
elem
entPtr_
->
g
eometry
().
t
ype
()
).
localBasis
();
}
{
return
fvGridGeometry
().
feCache
().
get
(
elem
G
eometry
T
ype
_
).
localBasis
();
}
//! The total number of sub control volumes
std
::
size_t
numScv
()
const
...
...
@@ -239,7 +240,6 @@ public:
//! For compatibility reasons with the FVGeometry cache being disabled
void
bindElement
(
const
Element
&
element
)
{
elementPtr_
=
&
element
;
eIdx_
=
fvGridGeometry
().
elementMapper
().
index
(
element
);
makeElementGeometries
(
element
);
}
...
...
@@ -256,7 +256,8 @@ private:
// get the element geometry
auto
elementGeometry
=
element
.
geometry
();
const
auto
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
elemGeometryType_
=
elementGeometry
.
type
();
const
auto
referenceElement
=
ReferenceElements
::
general
(
elemGeometryType_
);
// get the sub control volume geometries of this element
GeometryHelper
geometryHelper
(
elementGeometry
);
...
...
@@ -339,7 +340,7 @@ private:
}
//! The bound element
const
Element
*
elementPtr
_
;
Dune
::
GeometryType
elemGeometryType
_
;
GridIndexType
eIdx_
;
//! The global geometry this is a restriction of
...
...
dumux/porousmediumflow/boxdfm/fvelementgeometry.hh
View file @
7ea708ad
...
...
@@ -30,6 +30,7 @@
#define DUMUX_POROUSMEDIUMFLOW_BOXDFM_FV_ELEMENT_GEOMETRY_HH
#include
<dune/common/version.hh>
#include
<dune/geometry/type.hh>
#include
<dune/geometry/referenceelements.hh>
#include
<dune/localfunctions/lagrange/pqkfactory.hh>
...
...
@@ -119,7 +120,7 @@ public:
//! Get a local finite element basis
const
FeLocalBasis
&
feLocalBasis
()
const
{
return
fvGridGeometry
().
feCache
().
get
(
elem
entPtr_
->
g
eometry
().
t
ype
()
).
localBasis
();
}
{
return
fvGridGeometry
().
feCache
().
get
(
elem
G
eometry
T
ype
_
).
localBasis
();
}
//! The total number of sub control volumes
std
::
size_t
numScv
()
const
...
...
@@ -144,7 +145,7 @@ public:
*/
void
bindElement
(
const
Element
&
element
)
{
elem
entPtr
_
=
&
element
;
elem
GeometryType
_
=
element
.
geometry
().
type
()
;
eIdx_
=
fvGridGeometry
().
elementMapper
().
index
(
element
);
}
...
...
@@ -153,7 +154,7 @@ public:
{
return
*
fvGridGeometryPtr_
;
}
private:
const
Element
*
elementPtr
_
;
Dune
::
GeometryType
elemGeometryType
_
;
const
FVGridGeometry
*
fvGridGeometryPtr_
;
GridIndexType
eIdx_
;
};
...
...
@@ -232,7 +233,7 @@ public:
//! Get a local finite element basis
const
FeLocalBasis
&
feLocalBasis
()
const
{
return
fvGridGeometry
().
feCache
().
get
(
elem
entPtr_
->
g
eometry
().
t
ype
()
).
localBasis
();
}
{
return
fvGridGeometry
().
feCache
().
get
(
elem
G
eometry
T
ype
_
).
localBasis
();
}
//! The total number of sub control volumes
std
::
size_t
numScv
()
const
...
...
@@ -257,7 +258,6 @@ public:
*/
void
bindElement
(
const
Element
&
element
)
{
elementPtr_
=
&
element
;
eIdx_
=
fvGridGeometry
().
elementMapper
().
index
(
element
);
makeElementGeometries
(
element
);
}
...
...
@@ -274,11 +274,8 @@ private:
// get the element geometry
auto
elementGeometry
=
element
.
geometry
();
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
#else
const
auto
&
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
#endif
elemGeometryType_
=
elementGeometry
.
type
();
const
auto
referenceElement
=
ReferenceElements
::
general
(
elemGeometryType_
);
// get the sub control volume geometries of this element
GeometryHelper
geometryHelper
(
elementGeometry
);
...
...
@@ -429,7 +426,7 @@ private:
}
//! The bound element
const
Element
*
elementPtr
_
;
Dune
::
GeometryType
elemGeometryType
_
;
GridIndexType
eIdx_
;
//! The global geometry this is a restriction of
...
...
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