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
a6ac757d
Commit
a6ac757d
authored
Nov 06, 2017
by
Dennis Gläser
Browse files
[mpfa-o][ivindexset] make scheme work on surface grids
parent
53595b63
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/cellcentered/mpfa/omethod/interactionvolumeindexset.hh
View file @
a6ac757d
...
...
@@ -40,27 +40,28 @@ class CCMpfaOInteractionVolumeIndexSet
public:
CCMpfaOInteractionVolumeIndexSet
(
const
DualGridNodalIndexSet
&
nodalIndexSet
)
:
nodalIndexSet_
(
nodalIndexSet
)
{
//! determine the number of iv-local faces
//! determine the number of iv-local faces for memory reservation
//! note that this might be a vast overestimation on surface grids!
const
auto
numNodalScvfs
=
nodalIndexSet
.
numScvfs
();
const
auto
numBoundaryScvfs
=
nodalIndexSet
.
numBoundaryScvfs
();
numFaces_
=
numBoundaryScvfs
+
(
numNodalScvfs
-
numBoundaryScvfs
)
/
2
;
const
std
::
size_t
numFaceEstimate
=
numBoundaryScvfs
+
(
numNodalScvfs
-
numBoundaryScvfs
)
/
2
;
// make sure we found a reasonable number of faces
assert
((
numNodalScvfs
-
numBoundaryScvfs
)
%
2
==
0
);
//! index transformation from interaction-volume-local to node-local
ivToNodeScvf_
.
reserve
(
numFace
s_
);
ivToNodeScvf_
.
reserve
(
numFace
Estimate
);
nodeToIvScvf_
.
resize
(
numNodalScvfs
);
//! the local neighboring scv indices of the faces
scvfNeighborScvLocalIndices_
.
reserve
(
numFace
s_
);
scvfNeighborScvLocalIndices_
.
reserve
(
numFace
Estimate
);
//! keeps track of which nodal scvfs have been handled already
std
::
vector
<
bool
>
isHandled
(
numNodalScvfs
,
false
);
//! go over faces in nodal index set, check if iv-local face has been
//! inserted already for this scvf and if not, insert index mapping
unsigned
int
findCounter
=
0
;
numFaces_
=
0
;
for
(
LocalIndexType
i
=
0
;
i
<
numNodalScvfs
;
++
i
)
{
//! check if the nodal scvf still has to be handled
...
...
@@ -73,7 +74,8 @@ public:
nodeToIvScvf_
[
i
]
=
ivToNodeScvf_
.
size
();
isHandled
[
i
]
=
true
;
ivToNodeScvf_
.
push_back
(
i
);
findCounter
++
;
continue
;
numFaces_
++
;
continue
;
}
//! We insert a new iv-local face and find all "outside" scvfs that map
...
...
@@ -119,12 +121,9 @@ public:
isHandled
[
nodeLocalScvfIdx
]
=
true
;
}
ivToNodeScvf_
.
push_back
(
i
);
findCounter
++
;
numFaces_
++
;
}
//! ensure we found as many faces as anticipated
assert
(
findCounter
==
numFaces_
&&
"Couldn't find as many faces as anticipated"
);
// compute local neighboring scv indices for the iv-local scvfs
scvfNeighborScvLocalIndices_
.
resize
(
numFaces
());
for
(
unsigned
int
i
=
0
;
i
<
numFaces
();
++
i
)
...
...
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