Skip to content
GitLab
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
6af65894
Commit
6af65894
authored
Apr 08, 2020
by
Praetorius, Simon
Browse files
introduce aliases for dune-function concepts
parent
c3f84350
Changes
7
Hide whitespace changes
Inline
Side-by-side
amdis/DOFVector.hpp
View file @
6af65894
...
...
@@ -77,7 +77,7 @@ namespace AMDiS
/// (3) Constructor. Forwards to (1) by creating a new basis from a dune-functions basis.
template
<
class
GB_
,
REQUIRES
(
not
Concepts
::
Similar
<
GB_
,
GB
>),
REQUIRES
(
Dune
::
models
<
Dune
::
Functions
::
Concept
::
GlobalBasis
<
typename
GB_
::
GridView
>
,
GB_
>
()
)
>
REQUIRES
(
Concept
s
::
GlobalBasis
<
GB_
>
)
>
DOFVector
(
GB_
&&
basis
,
DataTransferOperation
op
=
DataTransferOperation
::
INTERPOLATE
)
:
DOFVector
(
std
::
make_shared
<
GB
>
(
std
::
move
(
basis
)),
op
)
{}
...
...
amdis/common/Concepts.hpp
View file @
6af65894
...
...
@@ -144,13 +144,44 @@ namespace AMDiS
using
MultiIndex_t
=
models_t
<
Definition
::
MultiIndex
(
MI
)
>
;
/// A Dune::Functions::HasIndexAccess type
template
<
class
Range
,
class
Index
>
constexpr
bool
HasIndexAccess
=
models
<
Dune
::
Functions
::
Concept
::
HasIndexAccess
(
Range
,
Index
)
>
;
template
<
class
Range
,
class
Index
>
constexpr
bool
HasIndexAccess_t
=
models_t
<
Dune
::
Functions
::
Concept
::
HasIndexAccess
(
Range
,
Index
)
>
;
/// A Dune::Functions::BasisNode type
template
<
class
N
>
constexpr
bool
BasisNode
=
models
<
Dune
::
Functions
::
Concept
::
BasisNode
(
N
)
>
;
template
<
class
N
>
constexpr
bool
BasisNode_t
=
models_t
<
Dune
::
Functions
::
Concept
::
BasisNode
(
N
)
>
;
/// A Dune::Functions::BasisTree type
template
<
class
Tree
,
class
GV
>
constexpr
bool
BasisTree
=
models
<
Dune
::
Functions
::
Concept
::
BasisTree
<
GV
>
(
Tree
)
>
;
template
<
class
Tree
,
class
GV
>
constexpr
bool
BasisTree_t
=
models_t
<
Dune
::
Functions
::
Concept
::
BasisTree
<
GV
>
(
Tree
)
>
;
/// A Dune::Functions::LocalView type
template
<
class
LV
>
constexpr
bool
LocalView
=
models
<
Dune
::
Functions
::
Concept
::
LocalView
<
typename
LV
::
GlobalBasis
>
(
LV
)
>
;
template
<
class
LV
,
class
GB
=
typename
LV
::
GlobalBasis
>
constexpr
bool
LocalView
=
models
<
Dune
::
Functions
::
Concept
::
LocalView
<
GB
>
(
LV
)
>
;
template
<
class
LV
,
class
GB
=
typename
LV
::
GlobalBasis
>
using
LocalView_t
=
models_t
<
Dune
::
Functions
::
Concept
::
LocalView
<
GB
>
(
LV
)
>
;
/// A Dune::Functions::GlobalBasis type
template
<
class
GB
,
class
GV
=
typename
GB
::
GridView
>
constexpr
bool
GlobalBasis
=
models
<
Dune
::
Functions
::
Concept
::
GlobalBasis
<
GV
>
(
GB
)
>
;
template
<
class
LV
>
using
LocalView
_t
=
models_t
<
Dune
::
Functions
::
Concept
::
LocalView
<
typename
LV
::
GlobalBasis
>
(
LV
)
>
;
template
<
class
GB
,
class
GV
=
typename
GB
::
GridView
>
using
GlobalBasis
_t
=
models_t
<
Dune
::
Functions
::
Concept
::
GlobalBasis
<
GV
>
(
GB
)
>
;
/** @} **/
...
...
amdis/functions/HierarchicNodeToRangeMap.hpp
View file @
6af65894
...
...
@@ -5,10 +5,9 @@
#include
<dune/common/concept.hh>
#include
<dune/functions/functionspacebases/concepts.hh>
#include
<dune/functions/common/indexaccess.hh>
#include
<amdis/common/Concepts
Base
.hpp>
#include
<amdis/common/Concepts.hpp>
namespace
AMDiS
{
...
...
@@ -25,7 +24,7 @@ namespace AMDiS
{
// Specialization for ranges with operator[] access
template
<
class
Node
,
class
TreePath
,
class
Range
,
REQUIRES
(
Dune
::
models
<
Dune
::
Functions
::
Concept
::
HasIndexAccess
,
Range
,
Dune
::
index_constant
<
0
>
>
()
)
>
REQUIRES
(
Concept
s
::
HasIndexAccess
<
Range
,
Dune
::
index_constant
<
0
>
>
)
>
decltype
(
auto
)
operator
()(
const
Node
&
node
,
const
TreePath
&
treePath
,
Range
&&
y
)
const
{
return
Dune
::
Functions
::
resolveStaticMultiIndex
(
y
,
transformTreePath
(
treePath
));
...
...
@@ -33,7 +32,7 @@ namespace AMDiS
// Specialization for non-container ranges
template
<
class
Node
,
class
TreePath
,
class
Range
,
REQUIRES
(
not
Dune
::
models
<
Dune
::
Functions
::
Concept
::
HasIndexAccess
,
Range
,
Dune
::
index_constant
<
0
>
>
()
)
>
REQUIRES
(
not
Concept
s
::
HasIndexAccess
<
Range
,
Dune
::
index_constant
<
0
>
>
)
>
decltype
(
auto
)
operator
()(
const
Node
&
node
,
const
TreePath
&
treePath
,
Range
&&
y
)
const
{
return
std
::
forward
<
Range
>
(
y
);
...
...
amdis/functions/NodeIndices.hpp
View file @
6af65894
#pragma once
#include
<dune/common/rangeutilities.hh>
#include
<dune/functions/functionspacebases/concepts.hh>
#include
<amdis/common/Concepts.hpp>
#include
<amdis/typetree/MultiIndex.hpp>
#include
<amdis/utility/MappedRangeView.hpp>
...
...
@@ -12,9 +12,8 @@ namespace AMDiS
template
<
class
LocalView
,
class
Node
>
auto
nodeIndices
(
LocalView
const
&
localView
,
Node
const
&
node
)
{
using
namespace
Dune
::
Functions
;
static_assert
(
Dune
::
models
<
Concept
::
LocalView
<
typename
LocalView
::
GlobalBasis
>
,
LocalView
>
(),
""
);
static_assert
(
Dune
::
models
<
Concept
::
BasisTree
<
typename
LocalView
::
GridView
>
,
Node
>
(),
""
);
static_assert
(
Concepts
::
LocalView
<
LocalView
>
,
""
);
static_assert
(
Concepts
::
BasisTree
<
Node
,
typename
LocalView
::
GridView
>>
,
""
);
return
mappedRangeView
(
Dune
::
range
(
node
.
size
()),
[
&
](
std
::
size_t
j
)
->
typename
LocalView
::
MultiIndex
{
return
localView
.
index
(
node
.
localIndex
(
j
));
...
...
@@ -25,8 +24,7 @@ namespace AMDiS
template
<
class
LocalView
>
auto
nodeIndices
(
LocalView
const
&
localView
)
{
using
namespace
Dune
::
Functions
;
static_assert
(
Dune
::
models
<
Concept
::
LocalView
<
typename
LocalView
::
GlobalBasis
>
,
LocalView
>
(),
""
);
static_assert
(
Concepts
::
LocalView
<
LocalView
>
,
""
);
return
mappedRangeView
(
Dune
::
range
(
localView
.
size
()),
[
&
](
std
::
size_t
i
)
->
typename
LocalView
::
MultiIndex
{
return
localView
.
index
(
i
);
...
...
amdis/functions/ParallelGlobalBasis.hpp
View file @
6af65894
...
...
@@ -106,7 +106,7 @@ namespace AMDiS
*/
template
<
class
GB_
,
Dune
::
disableCopyMove
<
Self
,
GB_
>
=
0
,
REQUIRES
(
Dune
::
models
<
Dune
::
Functions
::
Concept
::
GlobalBasis
<
GridView
>
,
GB_
>
()
)
>
REQUIRES
(
Concept
s
::
GlobalBasis
<
GB_
,
GridView
>
)
>
ParallelGlobalBasis
(
GB_
&&
from
)
:
ParallelGlobalBasis
(
std
::
string
(
""
),
from
.
gridView
().
grid
(),
from
.
preBasis
())
{}
...
...
amdis/gridfunctions/DiscreteFunction.hpp
View file @
6af65894
...
...
@@ -26,7 +26,7 @@ namespace AMDiS
* \tparam TreePath A realization of \ref Dune::TypeTree::HybridTreePath
*
* **Requirements:**
* - GB models \ref
Dune::Functions::
Concept::GlobalBasis
* - GB models \ref Concept
s
::GlobalBasis
**/
template
<
class
Coeff
,
class
GB
,
class
TreePath
=
Dune
::
TypeTree
::
HybridTreePath
<
>
>
class
DiscreteFunction
;
...
...
amdis/linearalgebra/VectorFacade.hpp
View file @
6af65894
...
...
@@ -192,7 +192,7 @@ namespace AMDiS
*/
template
<
class
LocalView
,
class
Node
,
class
Buffer
,
REQUIRES
(
Concepts
::
LocalView
<
LocalView
>),
REQUIRES
(
Dune
::
models
<
Dune
::
Functions
::
Concept
::
BasisNode
,
Node
>
()
)
>
REQUIRES
(
Concept
s
::
BasisNode
<
Node
>
)
>
void
gather
(
LocalView
const
&
localView
,
Node
const
&
node
,
Buffer
&
buffer
)
const
{
test_exit
(
state_
==
VectorState
::
unknown
||
...
...
@@ -235,7 +235,7 @@ namespace AMDiS
*/
template
<
class
LocalView
,
class
Node
,
class
NodeVector
,
class
MaskRange
,
class
Assign
,
REQUIRES
(
Concepts
::
LocalView
<
LocalView
>),
REQUIRES
(
Dune
::
models
<
Dune
::
Functions
::
Concept
::
BasisNode
,
Node
>
()
)
>
REQUIRES
(
Concept
s
::
BasisNode
<
Node
>
)
>
void
scatter
(
LocalView
const
&
localView
,
Node
const
&
node
,
NodeVector
const
&
localVector
,
MaskRange
const
&
mask
,
Assign
assign
)
{
...
...
@@ -258,7 +258,7 @@ namespace AMDiS
// [[expects: node is in localView.tree()]]
template
<
class
LocalView
,
class
Node
,
class
NodeVector
,
class
Assign
,
REQUIRES
(
Concepts
::
LocalView
<
LocalView
>),
REQUIRES
(
Dune
::
models
<
Dune
::
Functions
::
Concept
::
BasisNode
,
Node
>
()
)
>
REQUIRES
(
Concept
s
::
BasisNode
<
Node
>
)
>
void
scatter
(
LocalView
const
&
localView
,
Node
const
&
node
,
NodeVector
const
&
localVector
,
Assign
assign
)
{
scatter
(
localView
,
node
,
localVector
,
FakeContainer
<
bool
,
true
>
{},
assign
);
...
...
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