Skip to content
GitLab
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
d4a2ff2f
Commit
d4a2ff2f
authored
Apr 27, 2018
by
Bernd Flemisch
Committed by
Timo Koch
May 02, 2018
Browse files
remove preprocessor branchings for Dune < 2.6
parent
c39701bb
Changes
54
Hide whitespace changes
Inline
Side-by-side
dumux/assembly/staggeredlocalassembler.hh
View file @
d4a2ff2f
...
...
@@ -26,12 +26,8 @@
#define DUMUX_STAGGERED_LOCAL_ASSEMBLER_HH
#include
<dune/common/version.hh>
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
#include
<dune/common/hybridutilities.hh>
#include
<dune/common/rangeutilities.hh>
#else
#include
<dumux/common/intrange.hh>
#endif
#include
<dune/istl/matrixindexset.hh>
#include
<dune/istl/bvector.hh>
...
...
@@ -601,11 +597,7 @@ protected:
static
auto
priVarIndices_
(
typename
FVGridGeometry
::
DofTypeIndices
::
CellCenterIdx
)
{
constexpr
auto
numEqCellCenter
=
GET_PROP_VALUE
(
TypeTag
,
NumEqCellCenter
);
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
Dune
::
range
(
0
,
numEqCellCenter
);
#else
return
IntRange
(
0
,
numEqCellCenter
);
#endif
}
//! Helper function that returns an iterable range of primary variable indices.
...
...
@@ -613,11 +605,7 @@ protected:
static
auto
priVarIndices_
(
typename
FVGridGeometry
::
DofTypeIndices
::
FaceIdx
)
{
constexpr
auto
numEqFace
=
GET_PROP_VALUE
(
TypeTag
,
NumEqFace
);
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
Dune
::
range
(
0
,
numEqFace
);
#else
return
IntRange
(
0
,
numEqFace
);
#endif
}
private:
...
...
dumux/common/defaultmappertraits.hh
View file @
d4a2ff2f
...
...
@@ -32,13 +32,8 @@ namespace Dumux {
template
<
class
GridView
>
struct
DefaultMapperTraits
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
using
ElementMapper
=
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
>
;
using
VertexMapper
=
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
>
;
#else
using
ElementMapper
=
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
,
Dune
::
MCMGElementLayout
>
;
using
VertexMapper
=
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
,
Dune
::
MCMGVertexLayout
>
;
#endif
};
}
// namespace Dumux
...
...
dumux/common/geometry/geometricentityset.hh
View file @
d4a2ff2f
...
...
@@ -40,21 +40,12 @@ namespace Dumux {
template
<
class
GridView
,
int
codim
=
0
>
class
GridViewGeometricEntitySet
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
using
Mapper
=
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
>
;
#else
// Only works for codim == 0, fixed in dune version 2.6
using
Mapper
=
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
,
Dune
::
MCMGElementLayout
>
;
#endif
using
Entity
=
typename
GridView
::
template
Codim
<
codim
>
::
Entity
;
public:
GridViewGeometricEntitySet
(
const
GridView
&
gridView
)
:
gridView_
(
gridView
)
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
,
mapper_
(
gridView
,
Dune
::
mcmgLayout
(
Dune
::
Codim
<
codim
>
()))
#else
,
mapper_
(
gridView
)
#endif
,
entityMap_
(
std
::
make_shared
<
EntityMap
<
GridView
,
codim
>>
(
gridView
.
grid
(),
mapper_
))
{}
...
...
dumux/common/geometry/geometryintersection.hh
View file @
d4a2ff2f
...
...
@@ -228,13 +228,8 @@ public:
using
PolyhedronFaceGeometry
=
Dune
::
MultiLinearGeometry
<
ctype
,
2
,
dimworld
>
;
using
SegGeometry
=
Dune
::
MultiLinearGeometry
<
ctype
,
1
,
dimworld
>
;
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement1
=
ReferenceElementsGeo1
::
general
(
geo1
.
type
());
const
auto
referenceElement2
=
ReferenceElementsGeo2
::
general
(
geo2
.
type
());
#else
const
auto
&
referenceElement1
=
ReferenceElementsGeo1
::
general
(
geo1
.
type
());
const
auto
&
referenceElement2
=
ReferenceElementsGeo2
::
general
(
geo2
.
type
());
#endif
// add intersection points of all polyhedron edges (codim dim-1) with the polygon
for
(
int
i
=
0
;
i
<
referenceElement1
.
size
(
dim1
-
1
);
++
i
)
...
...
@@ -242,12 +237,7 @@ public:
const
auto
localEdgeGeom
=
referenceElement1
.
template
geometry
<
dim1
-
1
>(
i
);
const
auto
p
=
geo1
.
global
(
localEdgeGeom
.
corner
(
0
));
const
auto
q
=
geo1
.
global
(
localEdgeGeom
.
corner
(
1
));
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
segGeo
=
SegGeometry
(
Dune
::
GeometryTypes
::
line
,
std
::
vector
<
Point
>
{
p
,
q
});
#else
static
const
Dune
::
GeometryType
gt
(
1
);
const
auto
segGeo
=
SegGeometry
(
gt
,
std
::
vector
<
Point
>
{
p
,
q
});
#endif
using
PolySegTest
=
GeometryIntersection
<
Geometry2
,
SegGeometry
>
;
typename
PolySegTest
::
IntersectionType
intersection
;
...
...
@@ -267,24 +257,16 @@ public:
const
auto
b
=
geo1
.
global
(
localFaceGeo
.
corner
(
1
));
const
auto
c
=
geo1
.
global
(
localFaceGeo
.
corner
(
2
));
const
auto
d
=
geo1
.
global
(
localFaceGeo
.
corner
(
3
));
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
PolyhedronFaceGeometry
(
Dune
::
GeometryTypes
::
cube
(
2
),
std
::
vector
<
Point
>
{
a
,
b
,
c
,
d
});
#else
static
const
Dune
::
GeometryType
gt
(
Dune
::
GeometryType
::
cube
,
2
);
return
PolyhedronFaceGeometry
(
gt
,
std
::
vector
<
Point
>
{
a
,
b
,
c
,
d
});
#endif
}
else
{
const
auto
a
=
geo1
.
global
(
localFaceGeo
.
corner
(
0
));
const
auto
b
=
geo1
.
global
(
localFaceGeo
.
corner
(
1
));
const
auto
c
=
geo1
.
global
(
localFaceGeo
.
corner
(
2
));
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
PolyhedronFaceGeometry
(
Dune
::
GeometryTypes
::
simplex
(
2
),
std
::
vector
<
Point
>
{
a
,
b
,
c
});
#else
static
const
Dune
::
GeometryType
gt
(
Dune
::
GeometryType
::
simplex
,
2
);
return
PolyhedronFaceGeometry
(
gt
,
std
::
vector
<
Point
>
{
a
,
b
,
c
});
#endif
}
}();
...
...
@@ -293,12 +275,8 @@ public:
const
auto
localEdgeGeom
=
referenceElement2
.
template
geometry
<
1
>(
j
);
const
auto
p
=
geo2
.
global
(
localEdgeGeom
.
corner
(
0
));
const
auto
q
=
geo2
.
global
(
localEdgeGeom
.
corner
(
1
));
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
segGeo
=
SegGeometry
(
Dune
::
GeometryTypes
::
line
,
std
::
vector
<
Point
>
{
p
,
q
});
#else
static
const
Dune
::
GeometryType
gt
(
1
);
const
auto
segGeo
=
SegGeometry
(
gt
,
std
::
vector
<
Point
>
{
p
,
q
});
#endif
using
PolySegTest
=
GeometryIntersection
<
PolyhedronFaceGeometry
,
SegGeometry
>
;
typename
PolySegTest
::
IntersectionType
intersection
;
...
...
dumux/common/geometry/makegeometry.hh
View file @
d4a2ff2f
...
...
@@ -126,14 +126,7 @@ auto makeDuneQuadrilaterial(const std::vector<Dune::FieldVector<Scalar, 3>>& poi
// if no sanity check if desired, use the given points directly to construct the geometry
if
(
!
enableSanityCheck
)
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
GeometryType
(
Dune
::
GeometryTypes
::
quadrilateral
,
points
);
#else
{
static
Dune
::
GeometryType
gt
(
Dune
::
GeometryType
::
cube
,
dim
);
return
GeometryType
(
gt
,
points
);
}
#endif
// otherwise, perform a number of checks and corrections
if
(
!
pointsAreCoplanar
(
points
))
...
...
@@ -146,12 +139,7 @@ auto makeDuneQuadrilaterial(const std::vector<Dune::FieldVector<Scalar, 3>>& poi
if
(
std
::
any_of
(
orientations
.
begin
(),
orientations
.
end
(),
[](
auto
i
){
return
i
==
0
;
}))
DUNE_THROW
(
Dune
::
InvalidStateException
,
"More than two points lie on the same line."
);
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
quadrilateral
=
GeometryType
(
Dune
::
GeometryTypes
::
quadrilateral
,
corners
);
#else
static
Dune
::
GeometryType
gt
(
Dune
::
GeometryType
::
cube
,
dim
);
const
auto
quadrilateral
=
GeometryType
(
gt
,
corners
);
#endif
const
auto
eps
=
1e-20
;
if
(
quadrilateral
.
volume
()
<
eps
)
...
...
dumux/common/intersectionmapper.hh
View file @
d4a2ff2f
...
...
@@ -188,20 +188,12 @@ class IntersectionMapper
enum
{
dim
=
Grid
::
dimension
};
using
Element
=
typename
Grid
::
template
Codim
<
0
>
::
Entity
;
using
Intersection
=
typename
GridView
::
Intersection
;
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
using
ElementMapper
=
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
>
;
#else
using
ElementMapper
=
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GridView
,
Dune
::
MCMGElementLayout
>
;
#endif
public:
IntersectionMapper
(
const
GridView
&
gridview
)
:
gridView_
(
gridview
)
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
,
elementMapper_
(
gridView_
,
Dune
::
mcmgElementLayout
())
#else
,
elementMapper_
(
gridView_
)
#endif
,
size_
(
gridView_
.
size
(
1
))
,
intersectionMapGlobal_
(
gridView_
.
size
(
0
))
,
intersectionMapLocal_
(
gridView_
.
size
(
0
))
...
...
dumux/common/staggeredfvproblem.hh
View file @
d4a2ff2f
...
...
@@ -25,11 +25,7 @@
#define DUMUX_STAGGERD_FV_PROBLEM_HH
#include
<dune/common/version.hh>
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
#include
<dune/common/rangeutilities.hh>
#else
#include
<dumux/common/intrange.hh>
#endif
#include
<dumux/common/properties.hh>
#include
<dumux/common/fvproblem.hh>
...
...
@@ -227,11 +223,7 @@ protected:
static
auto
priVarIndices_
(
typename
FVGridGeometry
::
DofTypeIndices
::
CellCenterIdx
)
{
constexpr
auto
numEqCellCenter
=
GET_PROP_VALUE
(
TypeTag
,
NumEqCellCenter
);
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
Dune
::
range
(
0
,
numEqCellCenter
);
#else
return
IntRange
(
0
,
numEqCellCenter
);
#endif
}
//! Helper function that returns an iterable range of primary variable indices.
...
...
@@ -239,11 +231,7 @@ protected:
static
auto
priVarIndices_
(
typename
FVGridGeometry
::
DofTypeIndices
::
FaceIdx
)
{
constexpr
auto
numEqFace
=
GET_PROP_VALUE
(
TypeTag
,
NumEqFace
);
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
Dune
::
range
(
0
,
numEqFace
);
#else
return
IntRange
(
0
,
numEqFace
);
#endif
}
};
...
...
dumux/discretization/basefvgridgeometry.hh
View file @
d4a2ff2f
...
...
@@ -67,13 +67,8 @@ public:
//! Constructor computes the bouding box of the entire domain, for e.g. setting boundary conditions
BaseFVGridGeometry
(
const
GridView
&
gridView
)
:
gridView_
(
gridView
)
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
,
elementMapper_
(
gridView
,
Dune
::
mcmgElementLayout
())
,
vertexMapper_
(
gridView
,
Dune
::
mcmgVertexLayout
())
#else
,
elementMapper_
(
gridView
)
,
vertexMapper_
(
gridView
)
#endif
,
bBoxMin_
(
std
::
numeric_limits
<
double
>::
max
())
,
bBoxMax_
(
-
std
::
numeric_limits
<
double
>::
max
())
{
...
...
dumux/discretization/box/boxgeometryhelper.hh
View file @
d4a2ff2f
...
...
@@ -141,11 +141,7 @@ public:
:
elementGeometry_
(
geometry
)
,
corners_
(
geometry
.
corners
())
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement
=
ReferenceElements
::
general
(
geometry
.
type
());
#else
const
auto
&
referenceElement
=
ReferenceElements
::
general
(
geometry
.
type
());
#endif
// the element center
p
[
0
]
=
geometry
.
center
();
...
...
@@ -255,11 +251,7 @@ public:
const
typename
Intersection
::
Geometry
&
isGeom
,
unsigned
int
indexInIntersection
)
const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement
=
ReferenceElements
::
general
(
elementGeometry_
.
type
());
#else
const
auto
&
referenceElement
=
ReferenceElements
::
general
(
elementGeometry_
.
type
());
#endif
const
auto
vIdxLocal
=
referenceElement
.
subEntity
(
is
.
indexInInside
(),
1
,
indexInIntersection
,
dim
);
if
(
indexInIntersection
==
0
)
...
...
@@ -368,11 +360,7 @@ public:
:
elementGeometry_
(
geometry
)
,
corners_
(
geometry
.
corners
())
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement
=
ReferenceElements
::
general
(
geometry
.
type
());
#else
const
auto
&
referenceElement
=
ReferenceElements
::
general
(
geometry
.
type
());
#endif
// the element center
p
[
0
]
=
geometry
.
center
();
...
...
@@ -517,14 +505,8 @@ public:
const
typename
Intersection
::
Geometry
&
geometry
,
unsigned
int
indexInIntersection
)
const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement
=
ReferenceElements
::
general
(
elementGeometry_
.
type
());
const
auto
faceRefElem
=
FaceReferenceElements
::
general
(
geometry
.
type
());
#else
const
auto
&
referenceElement
=
ReferenceElements
::
general
(
elementGeometry_
.
type
());
const
auto
&
faceRefElem
=
FaceReferenceElements
::
general
(
geometry
.
type
());
#endif
GlobalPosition
pi
[
9
];
auto
corners
=
geometry
.
corners
();
...
...
dumux/discretization/box/fvelementgeometry.hh
View file @
d4a2ff2f
...
...
@@ -272,11 +272,7 @@ private:
// get the element geometry
auto
elementGeometry
=
element
.
geometry
();
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
#else
const
auto
&
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
#endif
// get the sub control volume geometries of this element
GeometryHelper
geometryHelper
(
elementGeometry
);
...
...
dumux/discretization/box/fvgridgeometry.hh
View file @
d4a2ff2f
...
...
@@ -165,11 +165,7 @@ public:
// get the element geometry
auto
elementGeometry
=
element
.
geometry
();
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
#else
const
auto
&
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
#endif
// instantiate the geometry helper
GeometryHelper
geometryHelper
(
elementGeometry
);
...
...
@@ -362,11 +358,7 @@ public:
numScvf_
+=
element
.
subEntities
(
dim
-
1
);
const
auto
elementGeometry
=
element
.
geometry
();
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
#else
const
auto
&
referenceElement
=
ReferenceElements
::
general
(
elementGeometry
.
type
());
#endif
// store the sub control volume face indices on the domain boundary
for
(
const
auto
&
intersection
:
intersections
(
this
->
gridView
(),
element
))
...
...
dumux/discretization/box/subcontrolvolume.hh
View file @
d4a2ff2f
...
...
@@ -138,11 +138,7 @@ public:
// e.g. for integration
Geometry
geometry
()
const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
Geometry
(
Dune
::
GeometryTypes
::
cube
(
dim
),
corners_
);
#else
return
Geometry
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
dim
),
corners_
);
#endif
}
//! The element-local index of the dof this scv is embedded in
...
...
dumux/discretization/box/subcontrolvolumeface.hh
View file @
d4a2ff2f
...
...
@@ -210,11 +210,7 @@ public:
//! The geometry of the sub control volume face
Geometry
geometry
()
const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
Geometry
(
Dune
::
GeometryTypes
::
cube
(
Geometry
::
mydimension
),
corners_
);
#else
return
Geometry
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
Geometry
::
mydimension
),
corners_
);
#endif
}
//! Return the boundary flag
...
...
dumux/discretization/cellcentered/mpfa/fvelementgeometry.hh
View file @
d4a2ff2f
...
...
@@ -368,11 +368,7 @@ private:
const
auto
&
e
=
useNeighbor
?
is
.
outside
()
:
element
;
const
auto
indexInElement
=
useNeighbor
?
is
.
indexInOutside
()
:
is
.
indexInInside
();
const
auto
eg
=
e
.
geometry
();
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
refElement
=
ReferenceElements
::
general
(
eg
.
type
());
#else
const
auto
&
refElement
=
ReferenceElements
::
general
(
eg
.
type
());
#endif
// Set up a container with all relevant positions for scvf corner computation
const
auto
numCorners
=
is
.
geometry
().
corners
();
...
...
@@ -452,11 +448,7 @@ private:
const
auto
&
e
=
useNeighbor
?
is
.
outside
()
:
element
;
const
auto
indexInElement
=
useNeighbor
?
is
.
indexInOutside
()
:
is
.
indexInInside
();
const
auto
eg
=
e
.
geometry
();
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
refElement
=
ReferenceElements
::
general
(
eg
.
type
());
#else
const
auto
&
refElement
=
ReferenceElements
::
general
(
eg
.
type
());
#endif
// Set up a container with all relevant positions for scvf corner computation
const
auto
numCorners
=
is
.
geometry
().
corners
();
...
...
dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh
View file @
d4a2ff2f
...
...
@@ -226,11 +226,7 @@ public:
const
auto
&
e
=
useNeighbor
?
is
.
outside
()
:
element
;
const
auto
indexInElement
=
useNeighbor
?
is
.
indexInOutside
()
:
indexInInside
;
const
auto
eg
=
e
.
geometry
();
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
refElement
=
ReferenceElements
::
general
(
eg
.
type
());
#else
const
auto
&
refElement
=
ReferenceElements
::
general
(
eg
.
type
());
#endif
// Set up a container with all relevant positions for scvf corner computation
const
auto
numCorners
=
is
.
geometry
().
corners
();
...
...
@@ -585,11 +581,7 @@ public:
const
auto
&
e
=
useNeighbor
?
is
.
outside
()
:
element
;
const
auto
indexInElement
=
useNeighbor
?
is
.
indexInOutside
()
:
indexInInside
;
const
auto
eg
=
e
.
geometry
();
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
refElement
=
ReferenceElements
::
general
(
eg
.
type
());
#else
const
auto
&
refElement
=
ReferenceElements
::
general
(
eg
.
type
());
#endif
// evaluate if vertices on this intersection use primary/secondary IVs
const
bool
isBranchingPoint
=
dim
<
dimWorld
?
outsideIndices
[
indexInInside
].
size
()
>
1
:
false
;
...
...
dumux/discretization/cellcentered/mpfa/helper.hh
View file @
d4a2ff2f
...
...
@@ -106,7 +106,6 @@ public:
*/
static
std
::
size_t
getGlobalNumScvf
(
const
GridView
&
gridView
)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
assert
(
gridView
.
size
(
Dune
::
GeometryTypes
::
triangle
)
+
gridView
.
size
(
Dune
::
GeometryTypes
::
quadrilateral
)
==
gridView
.
size
(
0
));
...
...
@@ -114,13 +113,6 @@ public:
*
getNumLocalScvfs
(
Dune
::
GeometryTypes
::
triangle
)
+
gridView
.
size
(
Dune
::
GeometryTypes
::
quadrilateral
)
*
getNumLocalScvfs
(
Dune
::
GeometryTypes
::
quadrilateral
);
#else
assert
(
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
simplex
,
2
))
+
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
2
))
==
gridView
.
size
(
0
));
return
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
simplex
,
2
))
*
6
+
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
2
))
*
8
;
#endif
}
/*!
...
...
@@ -200,21 +192,12 @@ public:
*/
static
std
::
size_t
getNumLocalScvfs
(
const
Dune
::
GeometryType
gt
)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
if
(
gt
==
Dune
::
GeometryTypes
::
triangle
)
return
6
;
else
if
(
gt
==
Dune
::
GeometryTypes
::
quadrilateral
)
return
8
;
else
DUNE_THROW
(
Dune
::
NotImplemented
,
"Mpfa for 2d geometry type "
<<
gt
);
#else
if
(
gt
.
isTriangle
())
return
6
;
else
if
(
gt
.
isQuadrilateral
())
return
8
;
else
DUNE_THROW
(
Dune
::
NotImplemented
,
"Mpfa for 2d geometry type "
<<
gt
);
#endif
}
};
...
...
@@ -347,7 +330,6 @@ public:
*/
static
std
::
size_t
getGlobalNumScvf
(
const
GridView
&
gridView
)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
assert
(
gridView
.
size
(
Dune
::
GeometryTypes
::
tetrahedron
)
+
gridView
.
size
(
Dune
::
GeometryTypes
::
pyramid
)
+
gridView
.
size
(
Dune
::
GeometryTypes
::
prism
)
...
...
@@ -361,17 +343,6 @@ public:
*
getNumLocalScvfs
(
Dune
::
GeometryTypes
::
prism
)
+
gridView
.
size
(
Dune
::
GeometryTypes
::
hexahedron
)
*
getNumLocalScvfs
(
Dune
::
GeometryTypes
::
hexahedron
);
#else
assert
(
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
simplex
,
3
))
+
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
pyramid
,
3
))
+
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
prism
,
3
))
+
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
3
))
==
gridView
.
size
(
0
));
return
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
simplex
,
3
))
*
12
+
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
pyramid
,
3
))
*
16
+
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
prism
,
3
))
*
18
+
gridView
.
size
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
3
))
*
24
;
#endif
}
/*!
...
...
@@ -522,7 +493,6 @@ public:
*/
static
std
::
size_t
getNumLocalScvfs
(
const
Dune
::
GeometryType
gt
)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
if
(
gt
==
Dune
::
GeometryTypes
::
tetrahedron
)
return
12
;
else
if
(
gt
==
Dune
::
GeometryTypes
::
pyramid
)
...
...
@@ -531,16 +501,6 @@ public:
return
18
;
else
if
(
gt
==
Dune
::
GeometryTypes
::
hexahedron
)
return
24
;
#else
if
(
gt
==
Dune
::
GeometryType
(
Dune
::
GeometryType
::
simplex
,
3
))
return
12
;
else
if
(
gt
==
Dune
::
GeometryType
(
Dune
::
GeometryType
::
pyramid
,
3
))
return
16
;
else
if
(
gt
==
Dune
::
GeometryType
(
Dune
::
GeometryType
::
prism
,
3
))
return
18
;
else
if
(
gt
==
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
3
))
return
24
;
#endif
else
DUNE_THROW
(
Dune
::
NotImplemented
,
"Mpfa for 3d geometry type "
<<
gt
);
}
...
...
@@ -617,11 +577,8 @@ public:
{
if
(
!
is
.
neighbor
()
&&
!
is
.
boundary
())
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
refElement
=
ReferenceElements
::
general
(
element
.
geometry
().
type
());
#else
const
auto
&
refElement
=
ReferenceElements
::
general
(
element
.
geometry
().
type
());
#endif
for
(
int
isVertex
=
0
;
isVertex
<
is
.
geometry
().
corners
();
++
isVertex
)
{
const
auto
vIdxLocal
=
refElement
.
subEntity
(
is
.
indexInInside
(),
1
,
isVertex
,
dim
);
...
...
dumux/discretization/cellcentered/mpfa/subcontrolvolumeface.hh
View file @
d4a2ff2f
...
...
@@ -202,11 +202,7 @@ public:
const
GlobalPosition
&
unitOuterNormal
()
const
{
return
unitOuterNormal_
;
}
//! The geometry of the sub control volume face
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
Geometry
geometry
()
const
{
return
Geometry
(
Dune
::
GeometryTypes
::
cube
(
Geometry
::
mydimension
),
corners_
);
}
#else
Geometry
geometry
()
const
{
return
Geometry
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
Geometry
::
mydimension
),
corners_
);
}
#endif
private:
bool
boundary_
;
...
...
dumux/discretization/staggered/freeflow/staggeredgeometryhelper.hh
View file @
d4a2ff2f
...
...
@@ -294,11 +294,7 @@ private:
void
setPairInfo_
(
const
int
isIdx
,
const
Element
&
element
,
const
bool
isParallel
)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
const
auto
referenceElement
=
ReferenceElements
::
general
(
element_
.
geometry
().
type
());
#else
const
auto
&
referenceElement
=
ReferenceElements
::
general
(
element_
.
geometry
().
type
());
#endif
// iterate over facets sub-entities
for
(
int
i
=
0
;
i
<
numFacetSubEntities
;
++
i
)
...
...
dumux/freeflow/navierstokes/staggered/fluxoversurface.hh
View file @
d4a2ff2f
...
...
@@ -211,14 +211,7 @@ public:
*/
static
SurfaceGeometryType
makeSurface
(
const
std
::
vector
<
Dune
::
FieldVector
<
Scalar
,
2
>>&
corners
)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
return
SurfaceGeometryType
(
Dune
::
GeometryTypes
::
line
,
corners
);
#else
{
static
Dune
::
GeometryType
gt2d
(
Dune
::
GeometryType
::
simplex
,
dim
-
1
);
return
SurfaceGeometryType
(
gt2d
,
corners
);
}
#endif
}
/*!
...
...
dumux/io/adaptivegridrestart.hh
View file @
d4a2ff2f
...
...
@@ -31,9 +31,6 @@
#endif
#include
<dune/grid/common/backuprestore.hh>
#if ! DUNE_VERSION_NEWER(DUNE_COMMON, 2, 5)
#include
<dune/grid/utility/grapedataioformattypes.hh>
#endif
#include
<dumux/common/exceptions.hh>
#include
<dumux/common/properties.hh>
...
...
@@ -109,11 +106,8 @@ public:
#if HAVE_DUNE_ALUGRID
Dune
::
BackupRestoreFacility
<
Grid
>::
backup
(
problem
.
grid
(),
gridName
);
#else
problem
.
grid
().
template
writeGrid
#if ! DUNE_VERSION_NEWER(DUNE_COMMON, 2, 5)
<
Dune
::
xdr
>
#endif // Dune < 3.0
(
gridName
,
problem
.
timeManager
().
time
()
+
problem
.
timeManager
().
timeStepSize
());
problem
.
grid
().
template
writeGrid
(
gridName
,
problem
.
timeManager
().
time
()
+
problem
.
timeManager
().
timeStepSize
());
#endif
}
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment