Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
amdis
amdis-core
Commits
f1ad9fe6
Commit
f1ad9fe6
authored
Jul 10, 2020
by
Praetorius, Simon
Browse files
reduce deprecation and other warnings introduced by recent changes in dune 2.8
parent
cc2acd3c
Changes
11
Hide whitespace changes
Inline
Side-by-side
amdis/AdaptiveGrid.hpp
View file @
f1ad9fe6
...
...
@@ -250,8 +250,8 @@ namespace AMDiS
if
constexpr
(
std
::
is_convertible_v
<
decltype
(
std
::
declval
<
HG
>
().
loadBalance
()),
bool
>
)
return
hostGrid_
->
loadBalance
();
else
{
hostGrid_
->
loadBalance
();
return
true
;
hostGrid_
->
loadBalance
();
return
true
;
}
}
...
...
@@ -269,7 +269,7 @@ namespace AMDiS
if
constexpr
(
std
::
is_convertible_v
<
decltype
(
std
::
declval
<
HG
>
().
loadBalance
(
handle
)),
bool
>
)
return
hostGrid_
->
loadBalance
(
handle
);
else
{
hostGrid_
->
loadBalance
(
handle
);
hostGrid_
->
loadBalance
(
handle
);
return
true
;
}
}
...
...
@@ -374,6 +374,7 @@ namespace Dune
:
public
GridFactoryInterface
<
AMDiS
::
AdaptiveGrid
<
HostGrid
>
>
{
using
Self
=
GridFactory
;
using
Super
=
GridFactoryInterface
<
AMDiS
::
AdaptiveGrid
<
HostGrid
>
>
;
using
GridType
=
AMDiS
::
AdaptiveGrid
<
HostGrid
>
;
using
HostGridFactory
=
GridFactory
<
HostGrid
>
;
...
...
@@ -406,12 +407,22 @@ namespace Dune
hostFactory_
.
insertElement
(
type
,
vertices
);
}
#if DUNE_VERSION_LT(DUNE_GRID,2,8)
using
ElementParametrizationType
=
std
::
shared_ptr
<
VirtualFunction
<
FieldVector
<
ctype
,
dim
>
,
FieldVector
<
ctype
,
dimworld
>
>
>
;
/// Insert a parametrized element into the coarse grid
void
insertElement
(
GeometryType
const
&
type
,
std
::
vector
<
unsigned
int
>
const
&
vertices
,
ElementParametrizationType
const
&
elementParametrization
)
override
#else
using
ElementParametrizationType
=
std
::
function
<
FieldVector
<
ctype
,
dimworld
>
(
FieldVector
<
ctype
,
dim
>
)
>
;
/// Insert a parametrized element into the coarse grid
void
insertElement
(
GeometryType
const
&
type
,
std
::
vector
<
unsigned
int
>
const
&
vertices
,
ElementParametrizationType
elementParametrization
)
override
#endif
{
using
A0
=
GeometryType
;
using
A1
=
std
::
vector
<
unsigned
int
>
;
...
...
@@ -421,6 +432,7 @@ namespace Dune
else
AMDiS
::
error_exit
(
"insertElement() not implemented for HostGrid type."
);
}
using
Super
::
insertElement
;
template
<
class
F
,
class
...
Args
>
using
HasInsertBoundarySegment
=
decltype
(
std
::
declval
<
F
>
().
insertBoundarySegment
(
std
::
declval
<
Args
>
()...));
...
...
amdis/MeshCreator.hpp
View file @
f1ad9fe6
...
...
@@ -186,7 +186,7 @@ namespace AMDiS
std
::
unique_ptr
<
GridType
>
read_gmsh_file
(
std
::
string
const
&
filename
,
Dune
::
PriorityTag
<
1
>
)
const
{
Dune
::
GmshReader
<
GridType
>
reader
;
return
std
::
unique_ptr
<
GridType
>
{
reader
.
read
(
filename
,
boundaryIds_
,
elementIds_
)};
return
std
::
unique_ptr
<
GridType
>
{
reader
.
read
(
filename
)};
//
, boundaryIds_, elementIds_)};
}
// fallback if GmshReader cannot be used
...
...
amdis/PeriodicBC.inc.hpp
View file @
f1ad9fe6
...
...
@@ -207,12 +207,11 @@ coords(Node const& tree, std::vector<std::size_t> const& localIndices) const
using
DomainType
=
typename
FiniteElement
::
Traits
::
LocalBasisType
::
Traits
::
DomainType
;
using
RangeType
=
typename
FiniteElement
::
Traits
::
LocalBasisType
::
Traits
::
RangeType
;
// TODO(FM): Cleanup once interpolation over a non-leaf node is fully supported
std
::
array
<
std
::
vector
<
typename
RangeType
::
field_type
>
,
Domain
::
dimension
>
coeffs
;
for
(
int
d
=
0
;
d
<
Domain
::
dimension
;
++
d
)
{
auto
evalCoord
=
functionFromCallable
<
RangeType
(
DomainType
)
>
([
&
](
DomainType
const
&
local
)
->
RangeType
{
return
geometry
.
global
(
local
)[
d
];
}
);
localInterpol
.
interpolate
(
evalCoord
,
coeffs
[
d
]);
auto
evalCoord
=
[
&
](
DomainType
const
&
local
)
->
RangeType
{
return
geometry
.
global
(
local
)[
d
];
};
auto
evalCoordFct
=
functionFromCallable
<
RangeType
(
DomainType
)
>
(
evalCoord
);
localInterpol
.
interpolate
(
evalCoord
Fct
,
coeffs
[
d
]);
}
for
(
std
::
size_t
j
=
0
;
j
<
localIndices
.
size
();
++
j
)
{
...
...
amdis/functions/FunctionFromCallable.hpp
View file @
f1ad9fe6
#pragma once
#include <dune/common/version.hh>
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
#include <dune/common/typeutilities.hh>
#include <dune/functions/common/functionfromcallable.hh>
#endif
namespace
AMDiS
{
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
namespace
Impl
{
template
<
class
Traits
,
class
F
,
...
...
@@ -27,5 +32,9 @@ namespace AMDiS
{
return
Impl
::
functionFromCallableImpl
<
SigTraits
>
(
f
,
Dune
::
PriorityTag
<
10
>
{});
}
#else
template
<
class
SigTraits
,
class
F
>
F
functionFromCallable
(
F
const
&
f
)
{
return
f
;
}
#endif
}
// end namespace AMDiS
amdis/functions/Interpolate.hpp
View file @
f1ad9fe6
...
...
@@ -71,14 +71,15 @@ namespace AMDiS
return
;
// extract component of local function result corresponding to node in tree
auto
localFj
=
functionFromCallable
<
Traits
>
(
[
&
](
auto
const
&
local
)
auto
localFj
=
[
&
](
auto
const
&
local
)
{
const
auto
&
tmp
=
lf
(
local
);
return
nodeToRangeEntry
(
node
,
tp
,
Dune
::
MatVec
::
as_vector
(
tmp
));
}
)
;
};
thread_local
std
::
vector
<
RangeField
>
interpolationCoeff
;
fe
.
localInterpolation
().
interpolate
(
localFj
,
interpolationCoeff
);
auto
localFjFct
=
functionFromCallable
<
Traits
>
(
localFj
);
fe
.
localInterpolation
().
interpolate
(
localFjFct
,
interpolationCoeff
);
counter
.
scatter
(
localView
,
node
,
visit
,
assign
);
vector
.
scatter
(
localView
,
node
,
interpolationCoeff
,
visit
,
assign
);
...
...
amdis/io/FileWriterBase.cpp
View file @
f1ad9fe6
#include "config.h"
#include "FileWriterBase.hpp"
#include <amdis/AdaptInfo.hpp>
...
...
amdis/typetree/TreePath.hpp
View file @
f1ad9fe6
...
...
@@ -4,6 +4,7 @@
#include <string>
#include <type_traits>
#include <dune/common/version.hh>
#include <dune/common/std/apply.hh>
#include <dune/typetree/treepath.hh>
#include <dune/typetree/typetraits.hh>
...
...
@@ -125,11 +126,19 @@ namespace AMDiS
return
tp
;
}
#if DUNE_VERSION_LT(DUNE_TYPETREE,2,8)
template
<
std
::
size_t
...
I
>
auto
makeTreePath
(
Dune
::
TypeTree
::
TreePath
<
I
...
>
)
{
return
Dune
::
TypeTree
::
hybridTreePath
(
std
::
integral_constant
<
std
::
size_t
,
I
>
{}...);
}
#else
template
<
std
::
size_t
...
I
>
auto
makeTreePath
(
Dune
::
TypeTree
::
StaticTreePath
<
I
...
>
)
{
return
Dune
::
TypeTree
::
hybridTreePath
(
std
::
integral_constant
<
std
::
size_t
,
I
>
{}...);
}
#endif
template
<
class
TP
>
auto
makeTreePath
(
TP
const
&
)
...
...
test/DOFMappingTest.cpp
View file @
f1ad9fe6
...
...
@@ -79,14 +79,16 @@ private:
int
main
(
int
argc
,
char
**
argv
)
{
AMDiS
::
Environment
env
(
argc
,
argv
);
#if AMDIS_HAS_PETSC
MPI_Comm
comm
=
MPI_COMM_WORLD
;
#endif
using
GI
=
GlobalIndex
;
using
LI
=
Dune
::
ParallelLocalIndex
<
Attribute
::
Type
>
;
using
PIS
=
Dune
::
ParallelIndexSet
<
GI
,
LI
>
;
int
r
=
env
.
mpiRank
();
int
s
=
env
.
mpiSize
();
[[
maybe_unused
]]
int
s
=
env
.
mpiSize
();
assert
(
s
==
2
);
int
N
=
3
;
...
...
test/DataTransferTest.hpp
View file @
f1ad9fe6
...
...
@@ -75,7 +75,7 @@ auto makeProblem(typename BasisCreator::GlobalBasis::GridView::Grid& grid, Fcts
k
++
;
});
return
std
::
move
(
prob
)
;
return
prob
;
}
template
<
class
Problem
,
class
Fcts
>
...
...
test/FakeContainerTest.cpp
View file @
f1ad9fe6
...
...
@@ -12,7 +12,7 @@ void test1()
FakeContainer
<
int
,
1
>
vec3
(
std
::
move
(
vec2
));
FakeContainer
<
int
,
1
>
vec4
=
vec1
;
FakeContainer
<
int
,
1
>
vec5
=
std
::
move
(
vec3
);
[[
maybe_unused
]]
FakeContainer
<
int
,
1
>
vec5
=
std
::
move
(
vec3
);
vec1
.
reserve
(
7
);
vec1
.
resize
(
1
);
...
...
@@ -54,7 +54,7 @@ void test2()
AMDIS_TEST
(
!
bitSet
.
empty
());
// use bitset element as template parameter
auto
iconst
=
std
::
integral_constant
<
bool
,
bitSet
[
0
]
>
{};
[[
maybe_unused
]]
auto
iconst
=
std
::
integral_constant
<
bool
,
bitSet
[
0
]
>
{};
}
...
...
test/TreeContainerTest.cpp
View file @
f1ad9fe6
#include "config.h"
#include <dune/grid/yaspgrid.hh>
#include <dune/functions/functionspacebases/compositebasis.hh>
#include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/powerbasis.hh>
#include <amdis/Environment.hpp>
#include <amdis/typetree/Traversal.hpp>
#include <amdis/typetree/TreeContainer.hpp>
...
...
@@ -11,8 +13,10 @@
using
namespace
AMDiS
;
int
main
()
int
main
(
int
argc
,
char
**
argv
)
{
Environment
env
(
argc
,
argv
);
Dune
::
YaspGrid
<
2
>
grid
({
1.0
,
1.0
},
{
1
,
1
});
auto
gridView
=
grid
.
leafGridView
();
...
...
Write
Preview
Markdown
is supported
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