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
f321584a
Commit
f321584a
authored
3 years ago
by
Kilian Weishaupt
Browse files
Options
Downloads
Patches
Plain Diff
[staggered][gridgeometry] Place scvs directly in global vector using index
parent
3183070a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2901
Feature/improve staggered gridgeometry
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/discretization/facecentered/staggered/fvgridgeometry.hh
+18
-20
18 additions, 20 deletions
...x/discretization/facecentered/staggered/fvgridgeometry.hh
with
18 additions
and
20 deletions
dumux/discretization/facecentered/staggered/fvgridgeometry.hh
+
18
−
20
View file @
f321584a
...
...
@@ -276,7 +276,6 @@ private:
GeometryHelper
geometryHelper
(
this
->
gridView
());
// get the global scv indices first
GridIndexType
scvIdx
=
0
;
GridIndexType
scvfIdx
=
0
;
for
(
const
auto
&
element
:
elements
(
this
->
gridView
()))
{
...
...
@@ -350,7 +349,7 @@ private:
// reserve memory
const
auto
numInteriorScvs
=
numElements
*
numScvsPerElement
;
scvs_
.
res
erv
e
(
numInteriorScvs
);
scvs_
.
res
iz
e
(
numInteriorScvs
);
scvfs_
.
reserve
((
numScvsPerElement
/*one interior frontal scvf per scv*/
+
numLateralScvfsPerElement
)
*
numElements
+
numBoundaryScv_
);
...
...
@@ -361,13 +360,14 @@ private:
const
auto
&
globalScvfIndices
=
scvfIndicesOfElement_
[
eIdx
];
scvfOfScvInfo_
[
eIdx
].
reserve
(
globalScvfIndices
.
size
());
auto
globalScvIdx
=
[
&
](
const
auto
elementIdx
,
const
auto
localScvIdx
)
auto
g
etG
lobalScvIdx
=
[
&
](
const
auto
elementIdx
,
const
auto
localScvIdx
)
{
return
numScvsPerElement
*
elementIdx
+
localScvIdx
;
};
SmallLocalIndexType
localScvIdx
=
0
;
// also corresponds to local element face index (one scv per face)
SmallLocalIndexType
localScvfIdx
=
0
;
for
(
const
auto
&
intersection
:
intersections
(
this
->
gridView
(),
element
))
{
const
auto
localScvIdx
=
intersection
.
indexInInside
();
const
auto
globalScvIdx
=
getGlobalScvIdx
(
eIdx
,
localScvIdx
);
const
auto
dofIndex
=
intersectionMapper
().
globalIntersectionIndex
(
element
,
localScvIdx
);
const
auto
localOppositeScvIdx
=
geometryHelper
.
localOppositeIdx
(
localScvIdx
);
const
auto
&
intersectionGeometry
=
intersection
.
geometry
();
...
...
@@ -403,19 +403,19 @@ private:
}
// the sub control volume
scvs_
.
emplace_back
(
elementGeometry
,
intersectionGeometry
,
globalScvIdx
(
eIdx
,
localScvIdx
)
,
localScvIdx
,
dofIndex
,
Dumux
::
normalAxis
(
intersection
.
centerUnitOuterNormal
()),
this
->
elementMapper
().
index
(
element
),
onDomainBoundary_
(
intersection
));
scvs_
[
globalScvIdx
]
=
SubControlVolume
(
elementGeometry
,
intersectionGeometry
,
globalScvIdx
,
localScvIdx
,
dofIndex
,
Dumux
::
normalAxis
(
intersection
.
centerUnitOuterNormal
()),
this
->
elementMapper
().
index
(
element
),
onDomainBoundary_
(
intersection
));
// the frontal sub control volume face at the element center
scvfs_
.
emplace_back
(
elementGeometry
,
intersectionGeometry
,
std
::
array
{
globalScvIdx
(
eIdx
,
localScvIdx
)
,
globalScvIdx
(
eIdx
,
localOppositeScvIdx
)},
std
::
array
{
globalScvIdx
,
g
etG
lobalScvIdx
(
eIdx
,
localOppositeScvIdx
)},
localScvfIdx
,
globalScvfIndices
[
localScvfIdx
],
intersection
.
centerUnitOuterNormal
(),
...
...
@@ -446,13 +446,13 @@ private:
{
const
auto
parallelElemIdx
=
this
->
elementMapper
().
index
(
lateralIntersection
.
outside
());
const
auto
localOutsideScvIdx
=
geometryHelper
.
localFaceIndexInOtherElement
(
localScvIdx
);
return
globalScvIdx
(
parallelElemIdx
,
localOutsideScvIdx
);
return
g
etG
lobalScvIdx
(
parallelElemIdx
,
localOutsideScvIdx
);
}
else
return
numInteriorScvs
+
outSideBoundaryVolVarIdx_
++
;
}();
return
std
::
array
{
globalScvIdx
(
eIdx
,
localScvIdx
)
,
globalOutsideScvIdx
};
return
std
::
array
{
globalScvIdx
,
globalOutsideScvIdx
};
}();
scvfs_
.
emplace_back
(
elementGeometry
,
...
...
@@ -473,22 +473,22 @@ private:
}
}
// end loop over lateral facets
++
localScvIdx
;
}
// end first loop over intersections
// do a second loop over all intersections to add frontal boundary faces
localScvIdx
=
0
;
for
(
const
auto
&
intersection
:
intersections
(
this
->
gridView
(),
element
))
{
// the frontal sub control volume face at a domain boundary (coincides with element face)
if
(
onDomainBoundary_
(
intersection
))
{
const
auto
localScvIdx
=
intersection
.
indexInInside
();
const
auto
globalScvIdx
=
getGlobalScvIdx
(
eIdx
,
localScvIdx
);
++
numBoundaryScvf_
;
// the frontal sub control volume face at the boundary
scvfs_
.
emplace_back
(
element
.
geometry
(),
intersection
.
geometry
(),
std
::
array
{
globalScvIdx
(
eIdx
,
localScvIdx
),
globalScvIdx
(
eIdx
,
localScvIdx
)
},
// TODO outside boundary, periodic, parallel?
std
::
array
{
globalScvIdx
,
globalScvIdx
},
// TODO outside boundary, periodic, parallel?
localScvfIdx
,
globalScvfIndices
[
localScvfIdx
],
intersection
.
centerUnitOuterNormal
(),
...
...
@@ -497,8 +497,6 @@ private:
++
localScvfIdx
;
hasBoundaryScvf_
[
eIdx
]
=
true
;
}
++
localScvIdx
;
}
}
...
...
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