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
d7ac0330
Commit
d7ac0330
authored
Apr 14, 2020
by
Praetorius, Simon
Browse files
use value template instead of ::value
parent
de0b3746
Changes
31
Hide whitespace changes
Inline
Side-by-side
amdis/BiLinearForm.hpp
View file @
d7ac0330
...
...
@@ -73,7 +73,7 @@ namespace AMDiS
/// Constructor for rowBasis == colBasis
template
<
class
RB_
=
RB
,
class
CB_
=
CB
,
REQUIRES
(
std
::
is_same
<
RB_
,
CB_
>
::
value
)
>
REQUIRES
(
std
::
is_same
_v
<
RB_
,
CB_
>)
>
explicit
BiLinearForm
(
std
::
shared_ptr
<
RB
>
const
&
rowBasis
)
:
BiLinearForm
(
rowBasis
,
rowBasis
)
{}
...
...
amdis/ProblemStat.inc.hpp
View file @
d7ac0330
...
...
@@ -215,7 +215,7 @@ template <class Traits>
void
ProblemStat
<
Traits
>::
createGlobalBasisImpl
(
std
::
true_type
)
{
assert
(
bool
(
grid_
)
);
static_assert
(
std
::
is_same
<
GridView
,
typename
Grid
::
LeafGridView
>
::
value
,
""
);
static_assert
(
std
::
is_same
_v
<
GridView
,
typename
Grid
::
LeafGridView
>
,
""
);
auto
basis
=
Traits
::
create
(
name_
,
grid_
->
leafGridView
());
globalBasis_
=
std
::
make_shared
<
GlobalBasis
>
(
std
::
move
(
basis
));
}
...
...
amdis/common/FlatMatrix.hpp
View file @
d7ac0330
...
...
@@ -25,7 +25,7 @@ namespace AMDiS
{
/// Access the column entry `col` of the row `row_` of this accessor.
/// @{
template
<
class
V
=
Vector
,
std
::
enable_if_t
<
not
std
::
is_const
<
V
>
::
value
,
int
>
=
0
>
template
<
class
V
=
Vector
,
std
::
enable_if_t
<
not
std
::
is_const
_v
<
V
>,
int
>
=
0
>
reference
operator
[](
size_type
col
)
{
return
(
*
vector_
)[
row_
*
cols_
+
col
];
...
...
amdis/common/Logical.hpp
View file @
d7ac0330
...
...
@@ -92,6 +92,6 @@ namespace AMDiS
using
IsEqual
=
Impl
::
IsEqualImpl
<
T
,
values
...
>
;
template
<
class
T
,
class
...
Ts
>
using
is_one_of
=
or_t
<
std
::
is_same
<
T
,
Ts
>
::
value
...
>
;
using
is_one_of
=
or_t
<
std
::
is_same
_v
<
T
,
Ts
>
...
>
;
}
// end namespace AMDiS
amdis/common/QuadMath.hpp
View file @
d7ac0330
...
...
@@ -59,7 +59,7 @@ namespace Dune
{
// specialization for float arguments due to ambiguity
template
<
class
T
,
std
::
enable_if_t
<
not
std
::
is_integral
<
T
>
::
value
&&
std
::
is_arithmetic
<
T
>
::
value
,
int
>
=
0
>
std
::
enable_if_t
<
not
std
::
is_integral
_v
<
T
>
&&
std
::
is_arithmetic
_v
<
T
>
,
int
>
=
0
>
inline
Float128
pow
(
const
Float128
&
x
,
const
T
&
p
)
{
return
powq
(
float128_t
(
x
),
float128_t
(
p
));
...
...
amdis/common/SharedPtr.hpp
View file @
d7ac0330
...
...
@@ -33,7 +33,7 @@ namespace AMDiS
template
<
class
T
>
std
::
shared_ptr
<
T
>
wrap_or_share
(
T
*
t
)
{
static_assert
(
not
std
::
is_pointer
<
T
*>
::
value
,
static_assert
(
not
std
::
is_pointer
_v
<
T
*>
,
"Raw pointers must be wrapped into smart pointers or references to clarify ownership"
);
}
...
...
amdis/common/StaticSize.hpp
View file @
d7ac0330
...
...
@@ -71,7 +71,7 @@ namespace AMDiS
// Arithmetic types have size 1 otherwise size is 0
template
<
class
T
>
static
constexpr
auto
eval
(
T
const
&
,
Dune
::
PriorityTag
<
0
>
)
->
decltype
(
std
::
integral_constant
<
std
::
size_t
,
(
std
::
is_arithmetic
<
T
>
::
value
?
1
:
0
)
>
{})
->
decltype
(
std
::
integral_constant
<
std
::
size_t
,
(
std
::
is_arithmetic
_v
<
T
>
?
1
:
0
)
>
{})
{
return
{};
}
...
...
@@ -154,7 +154,7 @@ namespace AMDiS
// Fallback-size is 1 for arithmetic types or 0
template
<
class
T
>
static
constexpr
auto
eval
(
T
const
&
,
Dune
::
PriorityTag
<
0
>
)
->
decltype
(
std
::
integral_constant
<
std
::
size_t
,
(
std
::
is_arithmetic
<
T
>
::
value
?
1
:
0
)
>
{})
->
decltype
(
std
::
integral_constant
<
std
::
size_t
,
(
std
::
is_arithmetic
_v
<
T
>
?
1
:
0
)
>
{})
{
return
{};
}
...
...
@@ -236,7 +236,7 @@ namespace AMDiS
// Fallback-size is 0
template
<
class
T
>
static
constexpr
auto
eval
(
T
const
&
,
Dune
::
PriorityTag
<
0
>
)
->
decltype
(
std
::
integral_constant
<
std
::
size_t
,
(
std
::
is_arithmetic
<
T
>
::
value
?
1
:
0
)
>
{})
->
decltype
(
std
::
integral_constant
<
std
::
size_t
,
(
std
::
is_arithmetic
_v
<
T
>
?
1
:
0
)
>
{})
{
return
{};
}
...
...
amdis/common/Transposed.hpp
View file @
d7ac0330
...
...
@@ -49,7 +49,7 @@ namespace AMDiS
}
template
<
class
M
=
Matrix
,
std
::
enable_if_t
<
not
std
::
is_const
<
M
>
::
value
,
int
>
=
0
>
std
::
enable_if_t
<
not
std
::
is_const
_v
<
M
>,
int
>
=
0
>
MutableRowProxy
operator
[](
size_type
row
)
{
return
MutableRowProxy
{
&
matrix_
,
row
};
...
...
amdis/common/TypeTraits.hpp
View file @
d7ac0330
...
...
@@ -128,7 +128,7 @@ namespace AMDiS
template
<
bool
...
b
>
using
enable_if_all_t
=
std
::
enable_if_t
<
std
::
is_same
<
std
::
integer_sequence
<
bool
,
true
,
b
...
>
,
std
::
integer_sequence
<
bool
,
b
...,
true
>>
::
value
>
;
=
std
::
enable_if_t
<
std
::
is_same
_v
<
std
::
integer_sequence
<
bool
,
true
,
b
...
>
,
std
::
integer_sequence
<
bool
,
b
...,
true
>>>
;
}
// end namespace AMDiS
amdis/common/ValueCategory.hpp
View file @
d7ac0330
...
...
@@ -21,7 +21,7 @@ namespace AMDiS
using
ValueCategory_t
=
typename
ValueCategory
<
remove_cvref_t
<
T
>>::
type
;
template
<
class
T
>
struct
ValueCategory
<
T
,
std
::
enable_if_t
<
std
::
is_arithmetic
<
T
>
::
value
>>
struct
ValueCategory
<
T
,
std
::
enable_if_t
<
std
::
is_arithmetic
_v
<
T
>
>>
{
using
type
=
tag
::
scalar
;
};
...
...
@@ -60,13 +60,13 @@ namespace AMDiS
namespace
Category
{
template
<
class
T
>
constexpr
bool
Scalar
=
std
::
is_same
<
ValueCategory_t
<
T
>
,
tag
::
scalar
>
::
value
;
constexpr
bool
Scalar
=
std
::
is_same
_v
<
ValueCategory_t
<
T
>
,
tag
::
scalar
>
;
template
<
class
T
>
constexpr
bool
Vector
=
std
::
is_same
<
ValueCategory_t
<
T
>
,
tag
::
vector
>
::
value
;
constexpr
bool
Vector
=
std
::
is_same
_v
<
ValueCategory_t
<
T
>
,
tag
::
vector
>
;
template
<
class
T
>
constexpr
bool
Matrix
=
std
::
is_same
<
ValueCategory_t
<
T
>
,
tag
::
matrix
>
::
value
;
constexpr
bool
Matrix
=
std
::
is_same
_v
<
ValueCategory_t
<
T
>
,
tag
::
matrix
>
;
}
// end namespace Category
...
...
amdis/common/parallel/Communicator.hpp
View file @
d7ac0330
...
...
@@ -22,7 +22,7 @@
namespace
AMDiS
{
namespace
Concepts
{
template
<
class
T
>
constexpr
bool
RawPointer
=
std
::
is_pointer
<
std
::
decay_t
<
T
>>
::
value
;
constexpr
bool
RawPointer
=
std
::
is_pointer
_v
<
std
::
decay_t
<
T
>>
;
}
namespace
Mpi
...
...
amdis/common/parallel/MpiTraits.hpp
View file @
d7ac0330
...
...
@@ -45,7 +45,7 @@ namespace Mpi
struct
is_mpi_type
<
std
::
pair
<
T1
,
T2
>>
:
std
::
integral_constant
<
bool
,
is_mpi_type
<
T1
>::
value
&&
is_mpi_type
<
T2
>::
value
&&
std
::
is_standard_layout
<
std
::
pair
<
T1
,
T2
>>
::
value
std
::
is_standard_layout
_v
<
std
::
pair
<
T1
,
T2
>>
>
{};
...
...
amdis/functions/Interpolate.hpp
View file @
d7ac0330
...
...
@@ -32,7 +32,7 @@ namespace AMDiS
auto
localView
=
basis
.
localView
();
// set vector to zero at subtree
if
(
!
std
::
is_same
<
Assign
,
Assigner
::
assign
>
::
value
)
{
if
(
!
std
::
is_same
_v
<
Assign
,
Assigner
::
assign
>
)
{
for
(
const
auto
&
e
:
elements
(
basis
.
gridView
(),
typename
BackendTraits
<
B
>::
PartitionSet
{}))
{
localView
.
bind
(
e
);
...
...
@@ -130,21 +130,21 @@ namespace AMDiS
template
<
class
B
,
class
Vec
,
class
GF
,
class
TP
,
class
C
,
class
BV
>
void
interpolate
(
B
const
&
basis
,
Vec
&
vec
,
GF
const
&
gf
,
TP
&&
tp
,
C
&&
c
,
BV
const
&
bitVec
)
{
static_assert
(
not
std
::
is_same
<
BV
,
tag
::
defaulted
>
::
value
,
""
);
static_assert
(
not
std
::
is_same
_v
<
BV
,
tag
::
defaulted
>
,
""
);
AMDiS
::
interpolate
(
basis
,
vec
,
gf
,
FWD
(
tp
),
FWD
(
c
),
bitVec
,
tag
::
defaulted
{});
}
template
<
class
B
,
class
Vec
,
class
GF
,
class
TP
,
class
C
>
void
interpolate
(
B
const
&
basis
,
Vec
&
vec
,
GF
const
&
gf
,
TP
&&
tp
,
C
&
counter
)
{
static_assert
(
not
std
::
is_same
<
C
,
tag
::
defaulted
>
::
value
,
""
);
static_assert
(
not
std
::
is_same
_v
<
C
,
tag
::
defaulted
>
,
""
);
AMDiS
::
interpolate
(
basis
,
vec
,
gf
,
FWD
(
tp
),
counter
,
tag
::
defaulted
{},
Assigner
::
plus_assign
{});
}
template
<
class
B
,
class
Vec
,
class
GF
,
class
TreePath
>
void
interpolate
(
B
const
&
basis
,
Vec
&
vec
,
GF
const
&
gf
,
TreePath
const
&
treePath
)
{
static_assert
(
not
std
::
is_same
<
TreePath
,
tag
::
defaulted
>
::
value
,
""
);
static_assert
(
not
std
::
is_same
_v
<
TreePath
,
tag
::
defaulted
>
,
""
);
AMDiS
::
interpolate
(
basis
,
vec
,
gf
,
treePath
,
tag
::
defaulted
{},
tag
::
defaulted
{},
Assigner
::
assign
{});
}
...
...
amdis/gridfunctions/Derivative.hpp
View file @
d7ac0330
...
...
@@ -10,7 +10,7 @@ namespace AMDiS
{
/// The derivative of a localfunction as localfunction itself
template
<
class
LocalFunction
,
class
Type
,
REQUIRES
(
std
::
is_convertible
<
tag
::
derivative_type
,
Type
>
::
value
),
REQUIRES
(
std
::
is_convertible
_v
<
tag
::
derivative_type
,
Type
>),
class
=
void_t
<
decltype
(
std
::
declval
<
LocalFunction
>
().
makeDerivative
(
std
::
declval
<
Type
>
()))
>
>
auto
derivative
(
LocalFunction
const
&
lf
,
Type
const
&
type
)
{
...
...
amdis/gridfunctions/DerivativeGridFunction.hpp
View file @
d7ac0330
...
...
@@ -22,7 +22,7 @@ namespace AMDiS
template
<
class
Traits
>
struct
CheckValidRange
{
static_assert
(
!
std
::
is_same
<
typename
Traits
::
Range
,
Dune
::
Functions
::
InvalidRange
>
::
value
,
"Invalid Range."
);
static_assert
(
!
std
::
is_same
_v
<
typename
Traits
::
Range
,
Dune
::
Functions
::
InvalidRange
>
,
"Invalid Range."
);
};
}
...
...
amdis/gridfunctions/DiscreteFunction.inc.hpp
View file @
d7ac0330
...
...
@@ -40,7 +40,7 @@ void DiscreteFunction<Coeff,GB,TP>::
auto
&&
gf
=
makeGridFunction
(
FWD
(
expr
),
basis
.
gridView
());
if
(
std
::
is_same
<
Tag
,
tag
::
average
>
::
value
)
{
if
(
std
::
is_same
_v
<
Tag
,
tag
::
average
>
)
{
VectorType_t
<
short
,
Coeff
>
counter
(
basis
);
AMDiS
::
interpolate
(
basis
,
coefficients
(),
gf
,
treePath
,
counter
);
...
...
amdis/io/FileWriterCreator.hpp
View file @
d7ac0330
...
...
@@ -52,8 +52,8 @@ namespace AMDiS
private:
template
<
class
Data
,
REQUIRES
(
not
std
::
is_same
<
ValueCategory_t
<
typename
Data
::
Range
>,
tag
::
unknown
>
::
value
),
REQUIRES
(
std
::
is_arithmetic
<
typename
Dune
::
FieldTraits
<
typename
Data
::
Range
>::
field_type
>
::
value
)
>
REQUIRES
(
not
std
::
is_same
_v
<
ValueCategory_t
<
typename
Data
::
Range
>,
tag
::
unknown
>
),
REQUIRES
(
std
::
is_arithmetic
_v
<
typename
Dune
::
FieldTraits
<
typename
Data
::
Range
>::
field_type
>
)
>
std
::
unique_ptr
<
FileWriterInterface
>
create_impl
(
std
::
string
type
,
std
::
string
prefix
,
Data
const
&
data
,
Dune
::
PriorityTag
<
2
>
)
const
{
...
...
@@ -95,8 +95,8 @@ namespace AMDiS
// The value-category is unknown, like a composite/hierarchic vector or any unknown type.
template
<
class
Data
,
REQUIRES
(
std
::
is_same
<
ValueCategory_t
<
typename
Data
::
Range
>,
tag
::
unknown
>
::
value
),
REQUIRES
(
std
::
is_arithmetic
<
typename
Dune
::
FieldTraits
<
typename
Data
::
Range
>::
field_type
>
::
value
)
>
REQUIRES
(
std
::
is_same
_v
<
ValueCategory_t
<
typename
Data
::
Range
>,
tag
::
unknown
>
),
REQUIRES
(
std
::
is_arithmetic
_v
<
typename
Dune
::
FieldTraits
<
typename
Data
::
Range
>::
field_type
>
)
>
std
::
unique_ptr
<
FileWriterInterface
>
create_impl
(
std
::
string
type
,
std
::
string
prefix
,
Data
const
&
/*data*/
,
Dune
::
PriorityTag
<
1
>
)
const
{
...
...
amdis/linearalgebra/MatrixFacade.hpp
View file @
d7ac0330
...
...
@@ -78,7 +78,7 @@ namespace AMDiS
assert
(
r
.
size
()
==
localMatrix
.
rows
());
assert
(
c
.
size
()
==
localMatrix
.
cols
());
const
bool
optimized
=
std
::
is_same
<
RowLocalView
,
ColLocalView
>
::
value
const
bool
optimized
=
std
::
is_same
_v
<
RowLocalView
,
ColLocalView
>
&&
r
.
tree
().
treeIndex
()
==
c
.
tree
().
treeIndex
();
if
(
optimized
)
...
...
amdis/linearalgebra/VectorFacade.hpp
View file @
d7ac0330
...
...
@@ -49,7 +49,7 @@ namespace AMDiS
};
template
<
class
A
>
using
VectorStateOf_t
=
std
::
conditional_t
<
std
::
is_same
<
A
,
Assigner
::
plus_assign
>
::
value
,
using
VectorStateOf_t
=
std
::
conditional_t
<
std
::
is_same
_v
<
A
,
Assigner
::
plus_assign
>
,
std
::
integral_constant
<
VectorState
,
VectorState
::
add_values
>
,
std
::
integral_constant
<
VectorState
,
VectorState
::
insert_values
>>
;
...
...
amdis/linearalgebra/istl/AMGPrecon.hpp
View file @
d7ac0330
...
...
@@ -70,7 +70,7 @@ namespace AMDiS
}
template
<
class
Smoother
,
class
LinOp
,
class
Criterion
,
class
SmootherArgs
,
class
Comm
,
REQUIRES
(
not
std
::
is_same
<
Comm
,
Dune
::
Amg
::
SequentialInformation
>
::
value
)
>
REQUIRES
(
not
std
::
is_same
_v
<
Comm
,
Dune
::
Amg
::
SequentialInformation
>)
>
static
std
::
unique_ptr
<
PrecBase
>
create
(
std
::
string
,
LinOp
const
&
,
Criterion
const
&
,
SmootherArgs
const
&
,
Comm
const
&
)
{
...
...
@@ -269,7 +269,7 @@ namespace AMDiS
using
SolverCategory
=
typename
Dune
::
SolverCategory
::
Category
;
static
const
bool
is_arithmetic
=
std
::
is_arithmetic
<
typename
Dune
::
FieldTraits
<
M
>::
field_type
>
::
value
;
static
const
bool
is_arithmetic
=
std
::
is_arithmetic
_v
<
typename
Dune
::
FieldTraits
<
M
>::
field_type
>
;
using
Norm
=
std
::
conditional_t
<
is_arithmetic
,
Dune
::
Amg
::
FirstDiagonal
,
Dune
::
Amg
::
RowSum
>
;
using
SymCriterion
=
Dune
::
Amg
::
CoarsenCriterion
<
Dune
::
Amg
::
SymmetricCriterion
<
M
,
Norm
>>
;
...
...
@@ -298,7 +298,7 @@ namespace AMDiS
private:
template
<
class
Comm
,
REQUIRES
(
not
std
::
is_same
<
Comm
,
Dune
::
Amg
::
SequentialInformation
>
::
value
)
>
REQUIRES
(
not
std
::
is_same
_v
<
Comm
,
Dune
::
Amg
::
SequentialInformation
>)
>
std
::
unique_ptr
<
Interface
>
createImpl1
(
SolverCategory
cat
,
M
const
&
mat
,
Comm
const
&
comm
)
const
{
...
...
Prev
1
2
Next
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