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
4bd51a4b
Commit
4bd51a4b
authored
6 years ago
by
Dennis Gläser
Committed by
Timo Koch
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[mpfa][elemfluxvarscache] add return functions for iv & datahandles
parent
40d0f109
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1286
[cc/staggered] Do not cache Dirichlet volVars
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/discretization/cellcentered/mpfa/elementfluxvariablescache.hh
+45
-6
45 additions, 6 deletions
...retization/cellcentered/mpfa/elementfluxvariablescache.hh
with
45 additions
and
6 deletions
dumux/discretization/cellcentered/mpfa/elementfluxvariablescache.hh
+
45
−
6
View file @
4bd51a4b
...
...
@@ -273,15 +273,42 @@ public:
//! access operators in the case of caching
template
<
class
SubControlVolumeFace
>
const
FluxVariablesCache
&
operator
[](
const
SubControlVolumeFace
&
scvf
)
const
{
return
!
isEmbeddedInBoundaryIV_
(
scvf
)
?
(
*
gridFluxVarsCachePtr_
)[
scvf
]
:
boundaryCacheData_
[
scvf
];
}
//! access to the interaction volume an scvf is embedded in
template
<
class
SubControlVolumeFace
>
const
PrimaryInteractionVolume
&
primaryInteractionVolume
(
const
SubControlVolumeFace
&
scvf
)
const
{
const
auto
&
fvGridGeometry
=
gridFluxVarsCachePtr_
->
problem
().
fvGridGeometry
();
const
auto
&
gridIvIndexSets
=
fvGridGeometry
.
gridInteractionVolumeIndexSets
();
return
isEmbeddedInBoundaryIV_
(
scvf
)
?
boundaryCacheData_
.
ivDataStorage_
.
primaryInteractionVolumes
[
(
*
this
)[
scvf
].
ivIndexInContainer
()
]
:
gridFluxVarsCachePtr_
->
primaryInteractionVolume
(
scvf
);
}
bool
touchesBoundary
=
fvGridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
())
?
gridIvIndexSets
.
secondaryIndexSet
(
scvf
).
nodalIndexSet
().
numBoundaryScvfs
()
>
0
:
gridIvIndexSets
.
primaryIndexSet
(
scvf
).
nodalIndexSet
().
numBoundaryScvfs
()
>
0
;
//! access to the data handle of an interaction volume an scvf is embedded in
template
<
class
SubControlVolumeFace
>
const
PrimaryIvDataHandle
&
primaryDataHandle
(
const
SubControlVolumeFace
&
scvf
)
const
{
return
isEmbeddedInBoundaryIV_
(
scvf
)
?
boundaryCacheData_
.
ivDataStorage_
.
primaryDataHandles
[
(
*
this
)[
scvf
].
ivIndexInContainer
()
]
:
gridFluxVarsCachePtr_
->
primaryDataHandle
(
scvf
);
}
//! access to the interaction volume an scvf is embedded in
template
<
class
SubControlVolumeFace
>
const
SecondaryInteractionVolume
&
secondaryInteractionVolume
(
const
SubControlVolumeFace
&
scvf
)
const
{
return
isEmbeddedInBoundaryIV_
(
scvf
)
?
boundaryCacheData_
.
ivDataStorage_
.
secondaryInteractionVolumes
[
(
*
this
)[
scvf
].
ivIndexInContainer
()
]
:
gridFluxVarsCachePtr_
->
secondaryInteractionVolume
(
scvf
);
}
return
!
touchesBoundary
?
(
*
gridFluxVarsCachePtr_
)[
scvf
]
:
boundaryCacheData_
[
scvf
];
//! access to the data handle of an interaction volume an scvf is embedded in
template
<
class
SubControlVolumeFace
>
const
SecondaryIvDataHandle
&
secondaryDataHandle
(
const
SubControlVolumeFace
&
scvf
)
const
{
return
isEmbeddedInBoundaryIV_
(
scvf
)
?
boundaryCacheData_
.
ivDataStorage_
.
secondaryDataHandles
[
(
*
this
)[
scvf
].
ivIndexInContainer
()
]
:
gridFluxVarsCachePtr_
->
secondaryDataHandle
(
scvf
);
}
//! The global object we are a restriction of
...
...
@@ -289,6 +316,18 @@ public:
{
return
*
gridFluxVarsCachePtr_
;
}
private
:
//! returns true if an scvf is contained in an interaction volume that touches the boundary
template
<
class
SubControlVolumeFace
>
bool
isEmbeddedInBoundaryIV_
(
const
SubControlVolumeFace
&
scvf
)
const
{
const
auto
&
fvGridGeometry
=
gridFluxVarsCachePtr_
->
problem
().
fvGridGeometry
();
const
auto
&
gridIvIndexSets
=
fvGridGeometry
.
gridInteractionVolumeIndexSets
();
if
(
fvGridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
()))
return
gridIvIndexSets
.
secondaryIndexSet
(
scvf
).
nodalIndexSet
().
numBoundaryScvfs
()
>
0
;
else
return
gridIvIndexSets
.
primaryIndexSet
(
scvf
).
nodalIndexSet
().
numBoundaryScvfs
()
>
0
;
}
const
GridFluxVariablesCache
*
gridFluxVarsCachePtr_
;
// we store those caches that touch the boundary locally here
...
...
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