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
db174bd4
Commit
db174bd4
authored
Jul 16, 2021
by
Timo Koch
Browse files
[mapper] Allow for new interface mapper.update(gridView) and deprecate usage of old mappers
parent
9af849b7
Changes
6
Hide whitespace changes
Inline
Side-by-side
dumux/common/intersectionmapper.hh
View file @
db174bd4
...
...
@@ -29,6 +29,7 @@
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/grid/common/rangegenerators.hh>
#include <dumux/common/deprecated.hh>
namespace
Dumux
{
...
...
@@ -306,7 +307,10 @@ public:
void
update
()
{
elementMapper_
.
update
();
if
constexpr
(
Deprecated
::
hasUpdateGridView
<
ElementMapper
,
GridView
>
())
elementMapper_
.
update
(
gridView_
);
else
Deprecated
::
update
(
elementMapper_
);
intersectionMapGlobal_
.
clear
();
intersectionMapGlobal_
.
resize
(
elementMapper_
.
size
());
...
...
dumux/discretization/basegridgeometry.hh
View file @
db174bd4
...
...
@@ -28,6 +28,7 @@
#include <dune/grid/common/mcmgmapper.hh>
#include <dumux/common/deprecated.hh>
#include <dumux/common/entitymap.hh>
#include <dumux/common/indextraits.hh>
#include <dumux/geometry/boundingboxtree.hh>
...
...
@@ -90,8 +91,15 @@ public:
void
update
()
{
//! Update the mappers
vertexMapper_
.
update
();
elementMapper_
.
update
();
if
constexpr
(
Deprecated
::
hasUpdateGridView
<
ElementMapper
,
GridView
>
())
elementMapper_
.
update
(
gridView_
);
else
Deprecated
::
update
(
elementMapper_
);
if
constexpr
(
Deprecated
::
hasUpdateGridView
<
VertexMapper
,
GridView
>
())
vertexMapper_
.
update
(
gridView_
);
else
Deprecated
::
update
(
vertexMapper_
);
//! Compute the bouding box of the entire domain, for e.g. setting boundary conditions
computeGlobalBoundingBox_
();
...
...
dumux/io/vtkmultiwriter.hh
View file @
db174bd4
...
...
@@ -38,6 +38,8 @@
#include <dune/grid/io/file/vtk/vtkwriter.hh>
#include <dune/grid/io/file/vtk/function.hh>
#include <dumux/common/deprecated.hh>
#if HAVE_MPI
#include <mpi.h>
#endif
...
...
@@ -196,8 +198,15 @@ public:
*/
void
gridChanged
()
{
elementMapper_
.
update
();
vertexMapper_
.
update
();
if
constexpr
(
Deprecated
::
hasUpdateGridView
<
ElementMapper
,
GridView
>
())
elementMapper_
.
update
(
gridView_
);
else
Deprecated
::
update
(
elementMapper_
);
if
constexpr
(
Deprecated
::
hasUpdateGridView
<
VertexMapper
,
GridView
>
())
vertexMapper_
.
update
(
gridView_
);
else
Deprecated
::
update
(
vertexMapper_
);
}
/*!
...
...
dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperator.hh
View file @
db174bd4
...
...
@@ -41,6 +41,7 @@
#include<dune/istl/operators.hh>
#include<dune/istl/bcrsmatrix.hh>
#include <dumux/common/deprecated.hh>
#include <dumux/porousmediumflow/sequential/pressureproperties.hh>
#include <dumux/common/boundaryconditions.hh>
#include "localstiffness.hh"
...
...
@@ -111,7 +112,10 @@ public:
//! Initialize the CR operator assembler
void
initialize
()
{
faceMapper_
.
update
();
if
constexpr
(
Deprecated
::
hasUpdateGridView
<
FaceMapper
,
GridView
>
())
faceMapper_
.
update
(
gridView_
);
else
Deprecated
::
update
(
faceMapper_
);
size_
=
faceMapper_
.
size
();
A_
.
setSize
(
size_
,
size_
,
nnz
());
...
...
dumux/porousmediumflow/sequential/gridadapt.hh
View file @
db174bd4
...
...
@@ -25,6 +25,7 @@
#include <unordered_map>
#include <dune/grid/common/partitionset.hh>
#include <dumux/common/deprecated.hh>
#include "properties.hh"
#include "gridadaptproperties.hh"
...
...
@@ -187,7 +188,11 @@ public:
// forceRefineRatio(1);
// update mapper to new cell indices
problem_
.
variables
().
elementMapper
().
update
();
using
ElementMapper
=
std
::
decay_t
<
decltype
(
problem_
.
variables
().
elementMapper
())
>
;
if
constexpr
(
Deprecated
::
hasUpdateGridView
<
ElementMapper
,
GridView
>
())
problem_
.
variables
().
elementMapper
().
update
(
problem_
.
gridView
());
else
Deprecated
::
update
(
problem_
.
variables
().
elementMapper
());
// adapt size of vectors
problem_
.
variables
().
adaptVariableSize
(
problem_
.
variables
().
elementMapper
().
size
());
...
...
dumux/porousmediumflow/sequential/variableclass.hh
View file @
db174bd4
...
...
@@ -20,7 +20,7 @@
#define DUMUX_VARIABLECLASS_HH
#include "properties.hh"
#include <dumux/common/deprecated.hh>
// for parallelization
//#include <dumux/parallel/elementhandles.hh>
...
...
@@ -89,8 +89,16 @@ public:
*/
void
initialize
()
{
elementMapper_
.
update
();
vertexMapper_
.
update
();
if
constexpr
(
Deprecated
::
hasUpdateGridView
<
ElementMapper
,
GridView
>
())
elementMapper_
.
update
(
gridView_
);
else
Deprecated
::
update
(
elementMapper_
);
if
constexpr
(
Deprecated
::
hasUpdateGridView
<
VertexMapper
,
GridView
>
())
vertexMapper_
.
update
(
gridView_
);
else
Deprecated
::
update
(
vertexMapper_
);
cellDataVector_
.
resize
(
gridView_
.
size
(
0
));
}
...
...
Hanchuan Wu
@hanchuan
mentioned in commit
3592dcb3
·
Jul 17, 2021
mentioned in commit
3592dcb3
mentioned in commit 3592dcb358560b9e4dfebb238cc87c1178aad6e5
Toggle commit list
Timo Koch
@timok
mentioned in merge request
!2714 (merged)
·
Jul 17, 2021
mentioned in merge request
!2714 (merged)
mentioned in merge request !2714
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