Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-xt
Commits
3700b36f
Unverified
Commit
3700b36f
authored
7 years ago
by
Dr. Felix Tobias Schindler
Committed by
René Fritze
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[walker] no need to wrap appended walkers specially
parent
988c02c9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/xt/grid/walker.hh
+0
-55
0 additions, 55 deletions
dune/xt/grid/walker.hh
dune/xt/grid/walker/wrapper.hh
+0
-61
0 additions, 61 deletions
dune/xt/grid/walker/wrapper.hh
with
0 additions
and
116 deletions
dune/xt/grid/walker.hh
+
0
−
55
View file @
3700b36f
...
...
@@ -302,59 +302,6 @@ public:
ApplyOn
::
LambdaFilteredIntersections
<
GL
>
(
intersection_filter
));
}
/**
* \}
* \name These methods can be used to append another Walker.
* \{
*/
/**
* \note The other_walker will be applied on the intersection of the given element_filter (intersection_filter) and
* the filters of its ElementFunctors (IntersectionFunctors).
* \sa WalkerWrapper
*/
ThisType
&
append
(
Walker
<
GL
>&
other_walker
,
const
ElementFilter
<
GL
>&
element_filter
=
ApplyOn
::
AllElements
<
GL
>
(),
const
IntersectionFilter
<
GL
>&
intersection_filter
=
ApplyOn
::
AllIntersections
<
GL
>
())
{
if
(
&
other_walker
==
this
)
DUNE_THROW
(
Common
::
Exceptions
::
you_are_using_this_wrong
,
"Do not append a Walker to itself!"
);
emplace_all
(
element_and_intersection_functor_wrappers_
,
other_walker
,
element_filter
,
intersection_filter
);
return
*
this
;
}
/**
* \note The other_walker will be applied on the intersection of the given element_filter (intersection_filter) and
* the filters of its ElementFunctors (IntersectionFunctors).
* \sa WalkerWrapper
*/
ThisType
&
append
(
Walker
<
GL
>&
other_walker
,
const
IntersectionFilter
<
GL
>&
intersection_filter
,
const
ElementFilter
<
GL
>&
element_filter
=
new
ApplyOn
::
AllElements
<
GL
>
())
{
if
(
&
other_walker
==
this
)
DUNE_THROW
(
Common
::
Exceptions
::
you_are_using_this_wrong
,
"Do not append a Walker to itself!"
);
emplace_all
(
element_and_intersection_functor_wrappers_
,
other_walker
,
element_filter
,
intersection_filter
);
return
*
this
;
}
/**
* \note The other_walker will be applied on the intersection of the given element_filter (intersection_filter) and
* the filters of its ElementFunctors (IntersectionFunctors).
* \sa WalkerWrapper
*/
ThisType
&
append
(
Walker
<
GL
>&
other_walker
,
ViewElementFunction
element_filter
,
ViewIntersectionFunction
intersection_filter
)
{
if
(
&
other_walker
==
this
)
DUNE_THROW
(
Common
::
Exceptions
::
you_are_using_this_wrong
,
"Do not append a Walker to itself!"
);
emplace_all
(
element_and_intersection_functor_wrappers_
,
other_walker
,
ApplyOn
::
LambdaFilteredElements
<
GL
>
(
element_filter
),
ApplyOn
::
LambdaFilteredIntersections
<
GL
>
(
intersection_filter
));
return
*
this
;
}
/**
* \}
* \name These methods are required by ElementAndIntersectionFunctor.
...
...
@@ -575,8 +522,6 @@ private:
}
// .. walk elements
}
// ... walk_range(...)
friend
class
internal
::
WalkerWrapper
<
GridViewType
>
;
GridViewType
grid_view_
;
bool
user_decided_agains_clearing_of_functors_
;
Common
::
PerThreadValue
<
std
::
list
<
std
::
shared_ptr
<
internal
::
ElementFunctorWrapper
<
GridViewType
>>>>
...
...
This diff is collapsed.
Click to expand it.
dune/xt/grid/walker/wrapper.hh
+
0
−
61
View file @
3700b36f
...
...
@@ -189,67 +189,6 @@ private:
};
// class ElementAndIntersectionFunctorWrapper
/**
* \brief To be used within the \sa Walker as internal storage type.
* \note Most likely you do not want to use this class directly, but instead append() a Walker to a Walker.
*/
template
<
class
GL
>
class
WalkerWrapper
:
public
ElementAndIntersectionFunctorWrapper
<
GL
>
{
using
BaseType
=
ElementAndIntersectionFunctorWrapper
<
GL
>
;
using
ThisType
=
WalkerWrapper
<
GL
>
;
public:
using
typename
BaseType
::
ElementFilterType
;
using
typename
BaseType
::
IntersectionFilterType
;
/**
* \attention Takes ownership of element_filtr_ptr, do not delete manually!
* \attention Takes ownership of intersection_filtr_ptr, do not delete manually!
*/
WalkerWrapper
(
Walker
<
GL
>&
walkr
,
const
ElementFilterType
*&&
element_filtr_ptr
,
const
IntersectionFilterType
*&&
intersection_filtr_ptr
)
:
BaseType
(
walkr
,
new
ApplyOn
::
LambdaFilteredElements
<
GL
>
([
&
](
const
auto
&
grid_layer
,
const
auto
&
element
)
{
if
(
restriction_element_filter_
.
access
().
contains
(
grid_layer
,
element
))
{
for
(
const
auto
&
wrapper
:
walkr
.
element_functor_wrappers_
)
{
if
(
wrapper
->
filter
().
contains
(
grid_layer
,
element
))
return
true
;
}
for
(
const
auto
&
wrapper
:
walkr
.
element_and_intersection_functor_wrappers_
)
{
if
(
wrapper
->
element_filter
().
contains
(
grid_layer
,
element
))
return
true
;
}
return
false
;
}
else
return
false
;
}),
new
ApplyOn
::
LambdaFilteredIntersections
<
GL
>
([
&
](
const
auto
&
grid_layer
,
const
auto
&
intersection
)
{
if
(
restriction_intersection_filter_
.
access
().
contains
(
grid_layer
,
intersection
))
{
for
(
const
auto
&
wrapper
:
walkr
.
intersection_functor_wrappers_
)
{
if
(
wrapper
->
filter
().
contains
(
grid_layer
,
intersection
))
return
true
;
}
for
(
const
auto
&
wrapper
:
walkr
.
element_and_intersection_functor_wrappers_
)
{
if
(
wrapper
->
intersection_filter
().
contains
(
grid_layer
,
intersection
))
return
true
;
}
return
false
;
}
else
return
false
;
}))
,
restriction_element_filter_
(
std
::
move
(
element_filtr_ptr
))
,
restriction_intersection_filter_
(
std
::
move
(
intersection_filtr_ptr
))
{
}
private
:
const
Common
::
ConstStorageProvider
<
ElementFilterType
>
restriction_element_filter_
;
const
Common
::
ConstStorageProvider
<
IntersectionFilterType
>
restriction_intersection_filter_
;
};
// class WalkerWrapper
}
// namespace internal
}
// namespace Grid
}
// namespace XT
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment