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
d9c14acd
Commit
d9c14acd
authored
6 years ago
by
Tobias Leibner
Browse files
Options
Downloads
Patches
Plain Diff
[test.indicator] fixes for GCC5.4
parent
23c95db4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/xt/functions/test/indicator_function.tpl
+17
-15
17 additions, 15 deletions
dune/xt/functions/test/indicator_function.tpl
dune/xt/functions/test/indicator_grid_function.tpl
+18
-14
18 additions, 14 deletions
dune/xt/functions/test/indicator_grid_function.tpl
with
35 additions
and
29 deletions
dune/xt/functions/test/indicator_function.tpl
+
17
−
15
View file @
d9c14acd
...
...
@@ -45,9 +45,9 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, is_constructib
RangeType first_value(1.);
RangeType second_value(2.);
FunctionType function_first_ctor({
{
'{{
middle_1, upper_right, first_value
}}'
}
});
FunctionType function_first_ctor(
{
std
::
make_tuple
(
middle_1
,
upper_right
,
first_value
)
}
);
FunctionType function_first_ctor_overlap({
{
'{{
lower_left, middle_2, first_value
}
,
{
middle_1, upper_right, second_value
}}'
}
});
FunctionType function_first_ctor_overlap(
{
std
::
make_tuple
(
lower_left
,
middle_2
,
first_value
)
,
std
::
make_tuple
(
middle_1
,
upper_right
,
second_value
)
}
);
//second constructor (the following functions are equivalent to the ones before (test see below))
Common::FieldMatrix
<double
,
d
,
2
>
domains(0);
...
...
@@ -63,9 +63,9 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, is_constructib
overlap_domains_second[dd][1] =
upper_right[dd];
}
FunctionType
function_second_ctor
({
{
'{{
domains, first_value
}}'
}
});
FunctionType
function_second_ctor
(
{
std
::
make_pair
(
domains
,
first_value
)
}
);
FunctionType
function_second_ctor_overlap
({
{
'{{
overlap_domains_first, first_value
}
,
{
overlap_domains_second, second_value
}}'
}
});
FunctionType
function_second_ctor_overlap
(
{
std
::
make_pair
(
overlap_domains_first
,
first_value
)
,
std
::
make_pair
(
overlap_domains_second
,
second_value
)
}
);
}
...
...
@@ -101,10 +101,10 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, is_visualizabl
RangeType first_value(1.);
RangeType second_value(2.);
FunctionType function({
{
'{{
middle_1, upper_right, first_value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
middle_1
,
upper_right
,
first_value
)
}
);
function.visualize(leaf_view, "test__IndicatorFunction_from_{
{
GRIDNAME
}
}_to_{
{
r
}
}_times_{
{
rC
}
}__is_visualizable");
FunctionType function_overlap({
{
'{{
lower_left, middle_2, first_value
}
,
{
middle_1, upper_right, second_value
}}'
}
});
FunctionType function_overlap(
{
std
::
make_tuple
(
lower_left
,
middle_2
,
first_value
)
,
std
::
make_tuple
(
middle_1
,
upper_right
,
second_value
)
}
);
function_overlap.visualize(leaf_view, "test__IndicatorFunction_from_{
{
GRIDNAME
}
}_to_{
{
r
}
}_times_{
{
rC
}
}__with_overlap__is_visualizable");
}
...
...
@@ -114,7 +114,7 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, global_order)
DomainType upper_right(0.5);
RangeType first_value(1.);
FunctionType function({
{
'{{
lower_left, upper_right, first_value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
first_value
)
}
);
const int expected_order = 0;
const auto actual_order = function.order();
EXPECT_EQ(expected_order, actual_order);
...
...
@@ -129,7 +129,7 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, global_evaluat
for (auto ur :
{
1.
,
0.75
,
0.5
,
0.25
}
) {
DomainType upper_right(ur);
RangeType value(1.);
FunctionType function({
{
'{{
lower_left, upper_right, value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
value
)
}
);
for (auto
&&
element : elements(leaf_view)) {
for (const auto
&
quadrature_point : Dune::QuadratureRules
<double
,
d
>
::rule(element.type(), 3)) {
// expected
...
...
@@ -156,7 +156,7 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, global_jacobia
DomainType upper_right(ur);
for (auto vv :
{
1.
,
2.
,
3.
,
4.
}
) {
RangeType value(vv);
FunctionType function({
{
'{{
lower_left, upper_right, value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
value
)
}
);
for (auto
&&
element : elements(leaf_view)) {
for (const auto
&
quadrature_point : Dune::QuadratureRules
<double
,
d
>
::rule(element.type(), 3)) {
const auto actual_jacobian = function.jacobian(element.geometry().global(quadrature_point.position()));
...
...
@@ -174,7 +174,7 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, is_bindable)
DomainType upper_right(0.5);
RangeType first_value(1.);
FunctionType default_function({
{
'{{
lower_left, upper_right, first_value
}}'
}
});
FunctionType default_function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
first_value
)
}
);
const auto
&
localizable_function = default_function.template as_grid_function
<ElementType>
();
auto local_f = localizable_function.local_function();
const auto leaf_view = grid_.leaf_view();
...
...
@@ -193,7 +193,7 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_order)
DomainType upper_right(ur);
for (auto vv :
{
1.
,
2.
,
3.
,
4.
}
) {
RangeType value(vv);
FunctionType function({
{
'{{
lower_left, upper_right, value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
value
)
}
);
const auto
&
localizable_function = function.template as_grid_function
<ElementType>
();
auto local_f = localizable_function.local_function();
for (auto
&&
element : elements(leaf_view)) {
...
...
@@ -217,7 +217,7 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_evaluate
DomainType upper_right(ur);
for (auto vv :
{
1.
,
2.
,
3.
,
4.
}
) {
RangeType value(vv);
FunctionType function({
{
'{{
lower_left, upper_right, value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
value
)
}
);
const auto
&
localizable_function = function.template as_grid_function
<ElementType>
();
auto local_f = localizable_function.local_function();
for (auto
&&
element : elements(leaf_view)) {
...
...
@@ -242,7 +242,7 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_evaluate
DomainType upper_right(0.5);
RangeType first_value(1.);
RangeType second_value(2.);
FunctionType function_multiple({
{
'{{
lower_left, middle, first_value
}
,
{
middle, upper_right, second_value
}}'
}
});
FunctionType function_multiple(
{
std
::
make_tuple
(
lower_left
,
middle
,
first_value
)
,
std
::
make_tuple
(
middle
,
upper_right
,
second_value
)
}
);
const auto
&
localizable_function_mult = function_multiple.template as_grid_function
<ElementType>
();
auto local_f_mult = localizable_function_mult.local_function();
...
...
@@ -264,7 +264,9 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_evaluate
// overlapping indicators
DomainType lower_left_ol(-0.5);
DomainType upper_right_ol(0);
FunctionType function_overlap({
{
'{{lower_left, middle, first_value},{middle, upper_right, second_value},{lower_left_ol, upper_right_ol, first_value}}'
}
});
FunctionType function_overlap(
{
std
::
make_tuple
(
lower_left
,
middle
,
first_value
),
std
::
make_tuple
(
middle
,
upper_right
,
second_value
),
std
::
make_tuple
(
lower_left_ol
,
upper_right_ol
,
first_value
)
}
);
const auto
&
localizable_function_ol = function_overlap.template as_grid_function
<ElementType>
();
auto local_f_ol = localizable_function_ol.local_function();
for (auto
&&
element : elements(leaf_view)) {
...
...
@@ -299,7 +301,7 @@ TEST_F(IndicatorFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_jacobian
DomainType upper_right(ur);
for (auto vv :
{
1.
,
2.
,
3.
,
4.
}
) {
RangeType value(vv);
FunctionType function({
{
'{{
lower_left, upper_right, value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
value
)
}
);
const auto
&
localizable_function = function.template as_grid_function
<ElementType>
();
auto local_f = localizable_function.local_function();
for (auto
&&
element : elements(leaf_view)) {
...
...
This diff is collapsed.
Click to expand it.
dune/xt/functions/test/indicator_grid_function.tpl
+
18
−
14
View file @
d9c14acd
...
...
@@ -46,9 +46,9 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, is_constru
RangeType first_value(1.);
RangeType second_value(2.);
FunctionType function_first_ctor({
{
'{{
lower_left, upper_right, first_value
}}'
}
});
FunctionType function_first_ctor(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
first_value
)
}
);
FunctionType function_first_ctor_overlap({
{
'{{
lower_left, middle_2, first_value
}
,
{
middle_1, upper_right, second_value
}}'
}
});
FunctionType function_first_ctor_overlap(
{
std
::
make_tuple
(
lower_left
,
middle_2
,
first_value
)
,
std
::
make_tuple
(
middle_1
,
upper_right
,
second_value
)
}
);
//second constructor (the following functions are equivalent to the ones before (test see below))
Common::FieldMatrix
<double
,
d
,
2
>
domains(0);
...
...
@@ -64,9 +64,9 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, is_constru
overlap_domains_second[dd][1] =
upper_right[dd];
}
FunctionType
function_second_ctor
({
{
'{{
domains, first_value
}}'
}
});
FunctionType
function_second_ctor
(
{
std
::
make_pair
(
domains
,
first_value
)
}
);
FunctionType
function_second_ctor_overlap
({
{
'{{
overlap_domains_first, first_value
}
,
{
overlap_domains_second, second_value
}}'
}
});
FunctionType
function_second_ctor_overlap
(
{
std
::
make_pair
(
overlap_domains_first
,
first_value
)
,
std
::
make_pair
(
overlap_domains_second
,
second_value
)
}
);
}
...
...
@@ -101,10 +101,11 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, is_visuali
RangeType first_value(1.);
RangeType second_value(2.);
FunctionType function({
{
'{{
middle_1, upper_right, first_value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
middle_1
,
upper_right
,
first_value
)
}
);
function.visualize(leaf_view, "test__IndicatorGridFunction_from_{
{
GRIDNAME
}
}_to_{
{
r
}
}_times_{
{
rC
}
}__is_visualizable");
FunctionType function_overlap({
{
'{{lower_left, middle_2, first_value}, {middle_1, upper_right, second_value}}'
}
});
FunctionType function_overlap(
{
std
::
make_tuple
(
lower_left
,
middle_2
,
first_value
),
std
::
make_tuple
(
middle_1
,
upper_right
,
second_value
)
}
);
function_overlap.visualize(leaf_view, "test__IndicatorGridFunction_from_{
{
GRIDNAME
}
}_to_{
{
r
}
}_times_{
{
rC
}
}__with_overlap__is_visualizable");
}
...
...
@@ -114,7 +115,7 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, is_bindabl
DomainType upper_right(0.5);
RangeType first_value(1.);
FunctionType default_function({
{
'{{
lower_left, upper_right, first_value
}}'
}
});
FunctionType default_function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
first_value
)
}
);
auto local_f = default_function.local_function();
const auto leaf_view = grid_.leaf_view();
for (auto
&&
element : elements(leaf_view)) {
...
...
@@ -132,7 +133,7 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_orde
DomainType upper_right(ur);
for (auto vv :
{
1.
,
2.
,
3.
,
4.
}
) {
RangeType value(vv);
FunctionType function({
{
'{{
lower_left, upper_right, value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
value
)
}
);
auto local_f = function.local_function();
for (auto
&&
element : elements(leaf_view)) {
local_f->bind(element);
...
...
@@ -155,7 +156,7 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_eval
DomainType upper_right(ur);
for (auto vv :
{
1.
,
2.
,
3.
,
4.
}
) {
RangeType value(vv);
FunctionType function({
{
'{{
lower_left, upper_right, value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
value
)
}
);
auto local_f = function.local_function();
for (auto
&&
element : elements(leaf_view)) {
// expected
...
...
@@ -180,7 +181,8 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_eval
DomainType upper_right(0.5);
RangeType first_value(1.);
RangeType second_value(2.);
FunctionType function_multiple({
{
'{{lower_left, middle, first_value}, {middle, upper_right, second_value}}'
}
});
FunctionType function_multiple(
{
std
::
make_tuple
(
lower_left
,
middle
,
first_value
),
std
::
make_tuple
(
middle
,
upper_right
,
second_value
)
}
);
auto local_f_mult = function_multiple.local_function();
for (auto
&&
element : elements(leaf_view)) {
// expected
...
...
@@ -201,7 +203,9 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_eval
// overlapping indicators
DomainType lower_left_ol(-0.5);
DomainType upper_right_ol(0);
FunctionType function_overlap({
{
'{{lower_left, middle, first_value},{middle, upper_right, second_value},{lower_left_ol, upper_right_ol, first_value}}'
}
});
FunctionType function_overlap(
{
std
::
make_tuple
(
lower_left
,
middle
,
first_value
),
std
::
make_tuple
(
middle
,
upper_right
,
second_value
),
std
::
make_tuple
(
lower_left_ol
,
upper_right_ol
,
first_value
)
}
);
auto local_f_ol = function_overlap.local_function();
for (auto
&&
element : elements(leaf_view)) {
// expected
...
...
@@ -232,7 +236,7 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, ctors_are_
DomainType upper_right(0.5);
RangeType first_value(1.);
FunctionType function_first_ctor({
{
'{{
lower_left, upper_right, first_value
}}'
}
});
FunctionType function_first_ctor(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
first_value
)
}
);
//second constructor
Common::FieldMatrix
<double
,
d
,
2
>
domains(0);
...
...
@@ -242,7 +246,7 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, ctors_are_
domains[dd][1] =
upper_right[dd];
}
FunctionType
function_second_ctor
({
{
'{{
domains, first_value
}}'
}
});
FunctionType
function_second_ctor
(
{
std
::
make_pair
(
domains
,
first_value
)
}
);
auto
local_f_1 =
function_first_ctor.local_function();
auto
local_f_2 =
function_second_ctor.local_function();
...
...
@@ -269,7 +273,7 @@ TEST_F(IndicatorGridFunction_from_{{GRIDNAME}}_to_{{r}}_times_{{rC}}, local_jaco
DomainType upper_right(ur);
for (auto vv :
{
1.
,
2.
,
3.
,
4.
}
) {
RangeType value(vv);
FunctionType function({
{
'{{
lower_left, upper_right, value
}}'
}
});
FunctionType function(
{
std
::
make_tuple
(
lower_left
,
upper_right
,
value
)
}
);
auto local_f = function.local_function();
for (auto
&&
element : elements(leaf_view)) {
local_f->bind(element);
...
...
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