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
e15b290b
Unverified
Commit
e15b290b
authored
7 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
[test.walker] re-enable/fix compile of partitionset filter test
parent
555e2e9c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/xt/grid/test/walker.cc
+29
-10
29 additions, 10 deletions
dune/xt/grid/test/walker.cc
with
29 additions
and
10 deletions
dune/xt/grid/test/walker.cc
+
29
−
10
View file @
e15b290b
...
...
@@ -106,13 +106,11 @@ struct GridWalkerTest : public ::testing::Test
Walker
<
GridLayerType
>
walker
(
gv
);
size_t
filter_count
=
0
,
all_count
=
0
,
inner_count
=
0
,
inner_set_count
=
0
;
auto
filter_counter
=
[
&
](
const
IntersectionType
&
,
const
EntityType
&
,
const
EntityType
&
)
{
filter_count
++
;
};
auto
inner_filter_counter
=
[
&
](
const
IntersectionType
&
,
const
EntityType
&
,
const
EntityType
&
)
{
inner_set_count
++
;
};
auto
all_counter
=
[
&
](
const
IntersectionType
&
,
const
EntityType
&
,
const
EntityType
&
)
{
all_count
++
;
};
auto
inner_counter
=
[
&
](
const
IntersectionType
&
,
const
EntityType
&
e
,
const
EntityType
&
)
{
inner_count
+=
e
.
partitionType
==
Dune
::
PartitionType
::
InteriorEntity
;
auto
filter_counter
=
[
&
](...)
{
filter_count
++
;
};
auto
inner_filter_counter
=
[
&
](...)
{
inner_set_count
++
;
};
auto
all_counter
=
[
&
](...)
{
all_count
++
;
};
auto
inner_counter
=
[
&
](
const
auto
&
e
)
{
inner_count
+=
e
.
partitionType
()
==
Dune
::
PartitionType
::
InteriorEntity
;
};
ApplyOn
::
PartitionSetEntities
<
GridLayerType
,
Dune
::
Partitions
::
Interior
>
on_interior_partitionset
{};
...
...
@@ -121,9 +119,10 @@ struct GridWalkerTest : public ::testing::Test
walker
.
append
(
filter_counter
,
on_all_partitionset
);
walker
.
append
(
inner_filter_counter
,
on_interior_partitionset
);
walker
.
append
(
all_counter
,
on_all
);
walker
.
append
(
inner_count
,
on_all
);
walker
.
append
(
inner_count
er
,
on_all
);
walker
.
walk
();
EXPECT_EQ
(
filter_count
,
all_count
);
EXPECT_EQ
(
inner_set_count
,
inner_count
);
}
void
check_partitioning
()
...
...
@@ -134,14 +133,33 @@ struct GridWalkerTest : public ::testing::Test
size_t
all_count
=
0
,
inner_count
=
0
;
auto
all_set_counter
=
[
&
](...)
{
all_count
++
;
};
auto
inner_set_counter
=
[
&
](...)
{
inner_count
++
;
};
auto
on_interior_partitionset
=
new
ApplyOn
::
PartitionSetEntities
<
GridLayerType
,
Dune
::
Partitions
::
Interior
>
()
;
auto
on_all_partitionset
=
new
ApplyOn
::
PartitionSetEntities
<
GridLayerType
,
Dune
::
Partitions
::
All
>
()
;
ApplyOn
::
PartitionSetEntities
<
GridLayerType
,
Dune
::
Partitions
::
Interior
>
on_interior_partitionset
{}
;
ApplyOn
::
PartitionSetEntities
<
GridLayerType
,
Dune
::
Partitions
::
All
>
on_all_partitionset
{}
;
walker
.
append
(
inner_set_counter
,
on_interior_partitionset
);
walker
.
append
(
all_set_counter
,
on_all_partitionset
);
walker
.
walk
();
Dune
::
XT
::
Grid
::
RangedPartitioning
<
GridLayerType
,
0
,
Dune
::
Interior_Partition
>
interior_part
(
gv
,
1
);
Dune
::
XT
::
Grid
::
RangedPartitioning
<
GridLayerType
,
0
,
Dune
::
All_Partition
>
all_part
(
gv
,
1
);
auto
filter_inner
=
inner_count
;
auto
filter_all
=
all_count
;
ApplyOn
::
AllElements
<
GridLayerType
>
on_all_elements
{};
walker
.
append
(
all_set_counter
,
on_all_elements
);
walker
.
append
(
inner_set_counter
,
on_all_elements
).
walk
(
interior_part
);
EXPECT_EQ
(
inner_count
,
2
*
filter_inner
);
if
(
gv
.
grid
().
comm
().
size
()
>
1
)
EXPECT_LT
(
inner_count
,
all_count
);
else
EXPECT_EQ
(
inner_count
,
all_count
);
walker
.
append
(
all_set_counter
,
on_all_elements
);
walker
.
append
(
inner_set_counter
,
on_all_elements
).
walk
(
all_part
);
EXPECT_EQ
(
inner_count
,
3
*
filter_inner
);
if
(
gv
.
grid
().
comm
().
size
()
>
1
)
EXPECT_LT
(
inner_count
,
all_count
);
else
EXPECT_EQ
(
inner_count
,
all_count
);
}
void
check_boundaries
()
...
...
@@ -200,6 +218,7 @@ TYPED_TEST(GridWalkerTest, count)
TYPED_TEST
(
GridWalkerTest
,
apply_on
)
{
this
->
check_apply_on
();
this
->
check_partitionsets
();
}
TYPED_TEST
(
GridWalkerTest
,
boundaries
)
{
...
...
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