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
d2dcaa71
Commit
d2dcaa71
authored
Sep 09, 2019
by
Praetorius, Simon
Browse files
Add range over node indices
parent
7e46647e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/amdis/functions/NodeIndices.hpp
0 → 100644
View file @
d2dcaa71
#pragma once
#include <dune/common/rangeutilities.hh>
#include <amdis/typetree/MultiIndex.hpp>
#include <amdis/utility/MappedRangeView.hpp>
namespace
AMDiS
{
/// Returns a range over the DOF indices on a node, given by the localView
template
<
class
LocalView
,
class
Node
>
auto
nodeIndices
(
LocalView
const
&
localView
,
Node
const
&
node
)
{
return
mappedRangeView
(
Dune
::
range
(
node
.
size
()),
[
&
](
std
::
size_t
j
)
{
return
flatMultiIndex
(
localView
.
index
(
node
.
localIndex
(
j
)));
});
}
/// Returns a range over the DOF indices on the basis tree, given by the localView
template
<
class
LocalView
>
auto
nodeIndices
(
LocalView
const
&
localView
)
{
return
mappedRangeView
(
Dune
::
range
(
localView
.
size
()),
[
&
](
std
::
size_t
i
)
{
return
flatMultiIndex
(
localView
.
index
(
i
));
});
}
}
// end namespace AMDiS
src/amdis/functions/Nodes.hpp
View file @
d2dcaa71
...
...
@@ -34,4 +34,16 @@ namespace AMDiS
#endif
}
// dune version independent creation of node from preBasis
template
<
class
PB
,
class
TP
>
auto
makeNodeIndexSet
(
PB
const
&
preBasis
,
TP
const
&
treePath
)
{
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
return
preBasis
.
indexSet
(
treePath
);
#else
DUNE_UNUSED_PARAMETER
(
treePath
);
return
preBasis
.
makeIndexSet
();
#endif
}
}
// end namespace AMDiS
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