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
53595b63
Commit
53595b63
authored
Nov 06, 2017
by
Dennis Gläser
Browse files
[mpfa][fvgridgeom] use correct helper function for determination of number of scvfs
parent
d12f1671
Changes
2
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh
View file @
53595b63
...
...
@@ -178,7 +178,7 @@ public:
// determine the number of geometric entities
const
auto
numVert
=
this
->
gridView
().
size
(
dim
);
const
auto
numScvs
=
numDofs
();
std
::
size_t
numScvf
=
MpfaHelper
::
estimate
NumScvf
(
this
->
gridView
());
std
::
size_t
numScvf
=
MpfaHelper
::
getGlobal
NumScvf
(
this
->
gridView
());
// resize containers
scvs_
.
resize
(
numScvs
);
...
...
dumux/discretization/cellcentered/mpfa/helper.hh
View file @
53595b63
...
...
@@ -102,9 +102,17 @@ public:
return
abs
(
crossProduct
<
Scalar
>
(
scvBasis
[
0
],
scvBasis
[
1
]));
}
// returns the global number of scvfs in the grid
/*!
* \brief Returns the global number of scvfs in the grid. Assumes the grid to be made up of only
* basic geometry types. Overlad this function if you want to use different geometry types.
*
* \param gridView The grid view to be checked
*/
static
std
::
size_t
getGlobalNumScvf
(
const
GridView
&
gridView
)
{
return
gridView
.
size
(
Dune
::
GeometryTypes
::
triangle
)
*
6
+
gridView
.
size
(
Dune
::
GeometryTypes
::
quadrilateral
)
*
8
;
}
{
assert
(
gridView
.
size
(
0
)
==
gridView
.
size
(
Dune
::
GeometryTypes
::
triangle
)
+
gridView
.
size
(
Dune
::
GeometryTypes
::
quadrilateral
));
return
gridView
.
size
(
Dune
::
GeometryTypes
::
triangle
)
*
6
+
gridView
.
size
(
Dune
::
GeometryTypes
::
quadrilateral
)
*
8
;
}
/*!
* \brief Checks whether or not a given scv basis forms a right hand system.
...
...
@@ -314,31 +322,22 @@ public:
}
/*!
* \brief Returns the total number of scvfs in a given grid view. This number can be used to
* to resize e.g. geometry vectors during initialization. However, if generic element
* geometry types are used by the grid, this method should be overloaded as it currently
* only works for basic geometry types. Furthermore, on locally refined grids the computed
* value will be smaller than the actual number of scvfs, thus the name "estimate"
* TODO: return accurate value also for locally refined grids?
* \brief Returns the global number of scvfs in the grid. Assumes the grid to be made up of only
* basic geometry types. Overlad this function if you want to use different geometry types.
*
* \param gridView The grid view to be checked
*/
static
std
::
size_t
estimate
NumScvf
(
const
GridView
&
gridView
)
static
std
::
size_t
getGlobal
NumScvf
(
const
GridView
&
gridView
)
{
Dune
::
GeometryType
simplex
,
pyramid
,
prism
,
cube
;
simplex
.
makeTetrahedron
();
pyramid
.
makePyramid
();
prism
.
makePrism
();
cube
.
makeHexahedron
();
// This assumes the grid to be entirely made up of triangles and quadrilaterals
assert
(
gridView
.
size
(
simplex
)
+
gridView
.
size
(
pyramid
)
+
gridView
.
size
(
prism
)
+
gridView
.
size
(
cube
)
==
gridView
.
size
(
0
)
&&
"Current implementation of mpfa schemes only supports simplices, pyramids, prisms & cubes in 3d."
);
return
gridView
.
size
(
simplex
)
*
12
+
gridView
.
size
(
pyramid
)
*
16
+
gridView
.
size
(
prism
)
*
18
+
gridView
.
size
(
cube
)
*
24
;
assert
(
gridView
.
size
(
Dune
::
GeometryTypes
::
tetrahedron
)
+
gridView
.
size
(
Dune
::
GeometryTypes
::
pyramid
)
+
gridView
.
size
(
Dune
::
GeometryTypes
::
prism
)
+
gridView
.
size
(
Dune
::
GeometryTypes
::
cube
)
==
gridView
.
size
(
0
));
return
gridView
.
size
(
Dune
::
GeometryTypes
::
tetrahedron
)
*
12
+
gridView
.
size
(
Dune
::
GeometryTypes
::
pyramid
)
*
16
+
gridView
.
size
(
Dune
::
GeometryTypes
::
prism
)
*
18
+
gridView
.
size
(
Dune
::
GeometryTypes
::
cube
)
*
24
;
}
/*!
...
...
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