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
905895ee
Commit
905895ee
authored
Nov 09, 2017
by
Kilian Weishaupt
Browse files
[fvGridGeometry] Add numDofs() for convenience
* specialized for box/cc
parent
f110b8ca
Changes
6
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/box/fvgridgeometry.hh
View file @
905895ee
...
...
@@ -88,6 +88,10 @@ public:
std
::
size_t
numBoundaryScvf
()
const
{
return
numBoundaryScvf_
;
}
//! The total number of degrees of freedom
std
::
size_t
numDofs
()
{
return
this
->
gridView
().
size
(
dim
);
}
//! update all fvElementGeometries (do this again after grid adaption)
void
update
()
{
...
...
@@ -100,7 +104,7 @@ public:
scvs_
.
resize
(
numElements
);
scvfs_
.
resize
(
numElements
);
boundaryDofIndices_
.
resize
(
this
->
gridView
().
size
(
dim
),
false
);
boundaryDofIndices_
.
resize
(
numDofs
(
),
false
);
numScv_
=
0
;
numScvf_
=
0
;
...
...
@@ -268,12 +272,16 @@ public:
std
::
size_t
numBoundaryScvf
()
const
{
return
numBoundaryScvf_
;
}
//! The total number of degrees of freedom
std
::
size_t
numDofs
()
const
{
return
this
->
gridView
().
size
(
dim
);
}
//! update all fvElementGeometries (do this again after grid adaption)
void
update
()
{
ParentType
::
update
();
boundaryDofIndices_
.
resize
(
this
->
gridView
().
size
(
dim
),
false
);
boundaryDofIndices_
.
resize
(
numDofs
(
),
false
);
// save global data on the grid's scvs and scvfs
// TODO do we need those information?
...
...
dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh
View file @
905895ee
...
...
@@ -102,6 +102,13 @@ public:
std
::
size_t
numBoundaryScvf
()
const
{
return
numBoundaryScvf_
;
}
/*!
* \brief Returns the total number of degrees of freedom.
*/
std
::
size_t
numDofs
()
const
{
return
this
->
gridView
().
size
(
0
);
}
/*!
* \brief Gets an element from a sub control volume contained in it.
*/
...
...
@@ -164,7 +171,7 @@ public:
// determine the number of geometric entities
const
auto
numVert
=
this
->
gridView
().
size
(
dim
);
const
auto
numScvs
=
this
->
gridView
().
size
(
0
);
const
auto
numScvs
=
numDofs
(
);
std
::
size_t
numScvf
=
MpfaHelper
::
estimateNumScvf
(
this
->
gridView
());
// resize containers
...
...
@@ -475,6 +482,12 @@ public:
std
::
size_t
numBoundaryScvf
()
const
{
return
numBoundaryScvf_
;
}
/*!
* \brief Returns the total number of degrees of freedom.
*/
std
::
size_t
numDofs
()
const
{
return
this
->
gridView
().
size
(
0
);
}
/*!
* \brief Gets an element from a sub control volume contained in it.
*/
...
...
@@ -548,7 +561,7 @@ public:
elementMap_
.
clear
();
// resize containers
numScvs_
=
this
->
gridView
().
size
(
0
);
numScvs_
=
numDofs
(
);
scvfIndicesOfScv_
.
resize
(
numScvs_
);
neighborVolVarIndices_
.
resize
(
numScvs_
);
elementMap_
.
resize
(
numScvs_
);
...
...
dumux/discretization/cellcentered/mpfa/hybridfps/fvgridgeometry.hh
View file @
905895ee
...
...
@@ -93,6 +93,10 @@ public:
std
::
size_t
numBoundaryScvf
()
const
{
return
numBoundaryScvf_
;
}
//! The total number of degrees of freedom
std
::
size_t
numDofs
()
const
{
return
this
->
gridView
().
size
(
0
);
}
// Get an element from a sub control volume contained in it
Element
element
(
const
SubControlVolume
&
scv
)
const
{
return
elementMap_
.
element
(
scv
.
elementIndex
());
}
...
...
@@ -120,7 +124,7 @@ public:
scvfs_
.
clear
();
// reserve memory
IndexType
numScvs
=
gridView_
.
size
(
0
);
IndexType
numScvs
=
numDofs
(
);
scvs_
.
resize
(
numScvs
);
scvfs_
.
reserve
(
getNumScvf_
());
scvfIndicesOfScv_
.
resize
(
numScvs
);
...
...
dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh
View file @
905895ee
...
...
@@ -95,6 +95,10 @@ public:
return
numBoundaryScvf_
;
}
//! The total number of degrees of freedom
std
::
size_t
numDofs
()
const
{
return
this
->
gridView
().
size
(
0
);
}
// Get an element from a sub control volume contained in it
Element
element
(
const
SubControlVolume
&
scv
)
const
{
return
elementMap_
.
element
(
scv
.
elementIndex
());
}
...
...
@@ -116,7 +120,7 @@ public:
elementMap_
.
clear
();
// determine size of containers
IndexType
numScvs
=
this
->
gridView
().
size
(
0
);
IndexType
numScvs
=
numDofs
(
);
IndexType
numScvf
=
0
;
for
(
const
auto
&
element
:
elements
(
this
->
gridView
()))
numScvf
+=
element
.
subEntities
(
1
);
...
...
@@ -343,6 +347,10 @@ public:
return
numBoundaryScvf_
;
}
//! The total number of degrees of freedom
std
::
size_t
numDofs
()
const
{
return
this
->
gridView
().
size
(
0
);
}
// Get an element from a sub control volume contained in it
Element
element
(
const
SubControlVolume
&
scv
)
const
{
return
elementMap_
.
element
(
scv
.
elementIndex
());
}
...
...
@@ -362,7 +370,7 @@ public:
neighborVolVarIndices_
.
clear
();
// reserve memory or resize the containers
numScvs_
=
this
->
gridView
().
size
(
0
);
numScvs_
=
numDofs
(
);
numScvf_
=
0
;
numBoundaryScvf_
=
0
;
elementMap_
.
resize
(
numScvs_
);
...
...
test/porousmediumflow/1p/implicit/incompressible/test_1p_box.cc
View file @
905895ee
...
...
@@ -87,7 +87,7 @@ int main(int argc, char** argv) try
// the solution vector
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
SolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
SolutionVector
);
SolutionVector
x
(
leafGridView
.
size
(
GridView
::
dimension
));
SolutionVector
x
(
fvGridGeometry
->
numDofs
(
));
// the grid variables
using
GridVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVariables
);
...
...
test/porousmediumflow/1p/implicit/incompressible/test_1p_cc.cc
View file @
905895ee
...
...
@@ -86,7 +86,7 @@ int main(int argc, char** argv) try
// the solution vector
using
SolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
SolutionVector
);
SolutionVector
x
(
leafGridView
.
size
(
0
));
SolutionVector
x
(
fvGridGeometry
->
numDofs
(
));
// the grid variables
using
GridVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVariables
);
...
...
Timo Koch
@timok
mentioned in issue
#408 (closed)
·
Nov 10, 2017
mentioned in issue
#408 (closed)
mentioned in issue #408
Toggle commit list
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