Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
44c7e062
Commit
44c7e062
authored
5 years ago
by
Simon Emmert
Committed by
Bernd Flemisch
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[discretization][staggered] generalize FVGridGeometry to GridGeometry
parent
7c7ce0a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1647
Feature/generalize fvgridgeometry
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/discretization/staggered/fvelementgeometry.hh
+28
-24
28 additions, 24 deletions
dumux/discretization/staggered/fvelementgeometry.hh
with
28 additions
and
24 deletions
dumux/discretization/staggered/fvelementgeometry.hh
+
28
−
24
View file @
44c7e062
...
@@ -65,14 +65,14 @@ public:
...
@@ -65,14 +65,14 @@ public:
//! Constructor getting a auxiliary cell center of face specific FvGridGeometry type.
//! Constructor getting a auxiliary cell center of face specific FvGridGeometry type.
//! Needed for the multi-domain framework.
//! Needed for the multi-domain framework.
template
<
class
CellCenterOrFaceFVGridGeometry
>
template
<
class
CellCenterOrFaceFVGridGeometry
>
StaggeredFVElementGeometry
(
const
CellCenterOrFaceFVGridGeometry
&
fvG
ridGeometry
)
StaggeredFVElementGeometry
(
const
CellCenterOrFaceFVGridGeometry
&
g
ridGeometry
)
:
ParentType
(
fvG
ridGeometry
.
actualfvGridGeometry
())
{}
:
ParentType
(
g
ridGeometry
.
actualfvGridGeometry
())
{}
//! Get a sub control volume face with an element index and a local scvf index
//! Get a sub control volume face with an element index and a local scvf index
using
ParentType
::
scvf
;
using
ParentType
::
scvf
;
const
SubControlVolumeFace
&
scvf
(
GridIndexType
eIdx
,
LocalIndexType
localScvfIdx
)
const
const
SubControlVolumeFace
&
scvf
(
GridIndexType
eIdx
,
LocalIndexType
localScvfIdx
)
const
{
{
return
this
->
fvG
ridGeometry
().
scvf
(
eIdx
,
localScvfIdx
);
return
this
->
g
ridGeometry
().
scvf
(
eIdx
,
localScvfIdx
);
}
}
};
};
...
@@ -98,22 +98,23 @@ public:
...
@@ -98,22 +98,23 @@ public:
//! export type of subcontrol volume face
//! export type of subcontrol volume face
using
SubControlVolumeFace
=
typename
GG
::
SubControlVolumeFace
;
using
SubControlVolumeFace
=
typename
GG
::
SubControlVolumeFace
;
//! export type of finite volume grid geometry
//! export type of finite volume grid geometry
using
FVGridGeometry
=
GG
;
using
GridGeometry
=
GG
;
using
FVGridGeometry
[[
deprecated
(
"Use more general GridGeometry instead. Will be removed after 3.1!"
)]]
=
GridGeometry
;
//! Constructor getting a auxiliary cell center of face specific FvGridGeometry type.
//! Constructor getting a auxiliary cell center of face specific FvGridGeometry type.
//! Needed for the multi-domain framework.
//! Needed for the multi-domain framework.
template
<
class
CellCenterOrFaceFVGridGeometry
>
template
<
class
CellCenterOrFaceFVGridGeometry
>
StaggeredFVElementGeometry
(
const
CellCenterOrFaceFVGridGeometry
&
fvG
ridGeometry
)
StaggeredFVElementGeometry
(
const
CellCenterOrFaceFVGridGeometry
&
g
ridGeometry
)
:
fvG
ridGeometryPtr_
(
&
fvG
ridGeometry
.
actualfvGridGeometry
())
{}
:
g
ridGeometryPtr_
(
&
g
ridGeometry
.
actualfvGridGeometry
())
{}
//! Constructor
//! Constructor
StaggeredFVElementGeometry
(
const
FV
GridGeometry
&
fvG
ridGeometry
)
StaggeredFVElementGeometry
(
const
GridGeometry
&
g
ridGeometry
)
:
fvG
ridGeometryPtr_
(
&
fvG
ridGeometry
)
{}
:
g
ridGeometryPtr_
(
&
g
ridGeometry
)
{}
//! Get a sub control volume face with an element index and a local scvf index
//! Get a sub control volume face with an element index and a local scvf index
const
SubControlVolumeFace
&
scvf
(
GridIndexType
eIdx
,
LocalIndexType
localScvfIdx
)
const
const
SubControlVolumeFace
&
scvf
(
GridIndexType
eIdx
,
LocalIndexType
localScvfIdx
)
const
{
{
return
scvf
(
this
->
fvG
ridGeometry
().
localToGlobalScvfIndex
(
eIdx
,
localScvfIdx
));
return
scvf
(
this
->
g
ridGeometry
().
localToGlobalScvfIndex
(
eIdx
,
localScvfIdx
));
}
}
//! Get an elment sub control volume with a global scv index
//! Get an elment sub control volume with a global scv index
...
@@ -181,12 +182,12 @@ public:
...
@@ -181,12 +182,12 @@ public:
std
::
vector
<
GridIndexType
>
handledNeighbors
;
std
::
vector
<
GridIndexType
>
handledNeighbors
;
handledNeighbors
.
reserve
(
element
.
subEntities
(
1
));
handledNeighbors
.
reserve
(
element
.
subEntities
(
1
));
for
(
const
auto
&
intersection
:
intersections
(
fvG
ridGeometry
().
gridView
(),
element
))
for
(
const
auto
&
intersection
:
intersections
(
g
ridGeometry
().
gridView
(),
element
))
{
{
if
(
intersection
.
neighbor
())
if
(
intersection
.
neighbor
())
{
{
const
auto
outside
=
intersection
.
outside
();
const
auto
outside
=
intersection
.
outside
();
const
auto
outsideIdx
=
fvG
ridGeometry
().
elementMapper
().
index
(
outside
);
const
auto
outsideIdx
=
g
ridGeometry
().
elementMapper
().
index
(
outside
);
// make outside geometries only if not done yet (could happen on non-conforming grids)
// make outside geometries only if not done yet (could happen on non-conforming grids)
if
(
std
::
find
(
handledNeighbors
.
begin
(),
handledNeighbors
.
end
(),
outsideIdx
)
==
handledNeighbors
.
end
()
)
if
(
std
::
find
(
handledNeighbors
.
begin
(),
handledNeighbors
.
end
(),
outsideIdx
)
==
handledNeighbors
.
end
()
)
...
@@ -209,8 +210,11 @@ public:
...
@@ -209,8 +210,11 @@ public:
}
}
//! The global finite volume geometry we are a restriction of
//! The global finite volume geometry we are a restriction of
[[
deprecated
(
"Use more general GridGeometry instead. Will be removed after 3.1!"
)]]
const
FVGridGeometry
&
fvGridGeometry
()
const
const
FVGridGeometry
&
fvGridGeometry
()
const
{
return
*
fvGridGeometryPtr_
;
}
{
return
gridGeometry
();
}
const
GridGeometry
&
gridGeometry
()
const
{
return
*
gridGeometryPtr_
;
}
//! Returns whether one of the geometry's scvfs lies on a boundary
//! Returns whether one of the geometry's scvfs lies on a boundary
bool
hasBoundaryScvf
()
const
bool
hasBoundaryScvf
()
const
...
@@ -221,23 +225,23 @@ private:
...
@@ -221,23 +225,23 @@ private:
//! create scvs and scvfs of the bound element
//! create scvs and scvfs of the bound element
void
makeElementGeometries_
(
const
Element
&
element
)
void
makeElementGeometries_
(
const
Element
&
element
)
{
{
const
auto
eIdx
=
fvG
ridGeometry
().
elementMapper
().
index
(
element
);
const
auto
eIdx
=
g
ridGeometry
().
elementMapper
().
index
(
element
);
scvs_
[
0
]
=
SubControlVolume
(
element
.
geometry
(),
eIdx
);
scvs_
[
0
]
=
SubControlVolume
(
element
.
geometry
(),
eIdx
);
scvIndices_
[
0
]
=
eIdx
;
scvIndices_
[
0
]
=
eIdx
;
const
auto
&
scvFaceIndices
=
fvG
ridGeometry
().
scvfIndicesOfScv
(
eIdx
);
const
auto
&
scvFaceIndices
=
g
ridGeometry
().
scvfIndicesOfScv
(
eIdx
);
const
auto
&
neighborVolVarIndices
=
fvG
ridGeometry
().
neighborVolVarIndices
(
eIdx
);
const
auto
&
neighborVolVarIndices
=
g
ridGeometry
().
neighborVolVarIndices
(
eIdx
);
typename
FV
GridGeometry
::
GeometryHelper
geometryHelper
(
element
,
fvG
ridGeometry
().
gridView
());
typename
GridGeometry
::
GeometryHelper
geometryHelper
(
element
,
g
ridGeometry
().
gridView
());
int
scvfCounter
=
0
;
int
scvfCounter
=
0
;
for
(
const
auto
&
intersection
:
intersections
(
fvG
ridGeometry
().
gridView
(),
element
))
for
(
const
auto
&
intersection
:
intersections
(
g
ridGeometry
().
gridView
(),
element
))
{
{
const
auto
&
scvfNeighborVolVarIndex
=
neighborVolVarIndices
[
scvfCounter
];
const
auto
&
scvfNeighborVolVarIndex
=
neighborVolVarIndices
[
scvfCounter
];
if
(
intersection
.
neighbor
()
||
intersection
.
boundary
())
if
(
intersection
.
neighbor
()
||
intersection
.
boundary
())
{
{
geometryHelper
.
updateLocalFace
(
fvG
ridGeometry
().
intersectionMapper
(),
intersection
);
geometryHelper
.
updateLocalFace
(
g
ridGeometry
().
intersectionMapper
(),
intersection
);
std
::
vector
<
GridIndexType
>
scvIndices
{
eIdx
,
scvfNeighborVolVarIndex
};
std
::
vector
<
GridIndexType
>
scvIndices
{
eIdx
,
scvfNeighborVolVarIndex
};
scvfs_
.
emplace_back
(
intersection
,
scvfs_
.
emplace_back
(
intersection
,
intersection
.
geometry
(),
intersection
.
geometry
(),
...
@@ -262,16 +266,16 @@ private:
...
@@ -262,16 +266,16 @@ private:
neighborScvs_
.
emplace_back
(
element
.
geometry
(),
eIdx
);
neighborScvs_
.
emplace_back
(
element
.
geometry
(),
eIdx
);
neighborScvIndices_
.
push_back
(
eIdx
);
neighborScvIndices_
.
push_back
(
eIdx
);
const
auto
&
scvFaceIndices
=
fvG
ridGeometry
().
scvfIndicesOfScv
(
eIdx
);
const
auto
&
scvFaceIndices
=
g
ridGeometry
().
scvfIndicesOfScv
(
eIdx
);
const
auto
&
neighborVolVarIndices
=
fvG
ridGeometry
().
neighborVolVarIndices
(
eIdx
);
const
auto
&
neighborVolVarIndices
=
g
ridGeometry
().
neighborVolVarIndices
(
eIdx
);
typename
FV
GridGeometry
::
GeometryHelper
geometryHelper
(
element
,
fvG
ridGeometry
().
gridView
());
typename
GridGeometry
::
GeometryHelper
geometryHelper
(
element
,
g
ridGeometry
().
gridView
());
int
scvfCounter
=
0
;
int
scvfCounter
=
0
;
for
(
const
auto
&
intersection
:
intersections
(
fvG
ridGeometry
().
gridView
(),
element
))
for
(
const
auto
&
intersection
:
intersections
(
g
ridGeometry
().
gridView
(),
element
))
{
{
const
auto
&
scvfNeighborVolVarIndex
=
neighborVolVarIndices
[
scvfCounter
];
const
auto
&
scvfNeighborVolVarIndex
=
neighborVolVarIndices
[
scvfCounter
];
geometryHelper
.
updateLocalFace
(
fvG
ridGeometry
().
intersectionMapper
(),
intersection
);
geometryHelper
.
updateLocalFace
(
g
ridGeometry
().
intersectionMapper
(),
intersection
);
if
(
intersection
.
neighbor
())
if
(
intersection
.
neighbor
())
{
{
...
@@ -317,7 +321,7 @@ private:
...
@@ -317,7 +321,7 @@ private:
}
}
const
Element
*
elementPtr_
;
//!< the element to which this fvgeometry is bound
const
Element
*
elementPtr_
;
//!< the element to which this fvgeometry is bound
const
FV
GridGeometry
*
fvG
ridGeometryPtr_
;
//!< the grid fvgeometry
const
GridGeometry
*
g
ridGeometryPtr_
;
//!< the grid fvgeometry
// local storage after binding an element
// local storage after binding an element
std
::
array
<
GridIndexType
,
1
>
scvIndices_
;
std
::
array
<
GridIndexType
,
1
>
scvIndices_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment