Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dumux-repositories
dumux
Commits
644b3c92
Commit
644b3c92
authored
4 years ago
by
Timo Koch
Committed by
Kilian Weishaupt
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[test][2p][material] Output largest error of spline approximation
parent
6ae12b10
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1607
Feature/new materiallaw 2p
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/material/fluidmatrixinteractions/2p/test_material_2p_spline.cc
+9
-4
9 additions, 4 deletions
...ial/fluidmatrixinteractions/2p/test_material_2p_spline.cc
with
9 additions
and
4 deletions
test/material/fluidmatrixinteractions/2p/test_material_2p_spline.cc
+
9
−
4
View file @
644b3c92
...
@@ -82,9 +82,9 @@ void runTest(const std::string& name, const Function& f,
...
@@ -82,9 +82,9 @@ void runTest(const std::string& name, const Function& f,
auto
pcTest
=
swTest
;
auto
pcTest
=
swTest
;
Dune
::
Timer
timer
;
Dune
::
Timer
timer
;
double
res
=
0.0
;
auto
resOrig
=
swTest
;
for
(
int
i
=
0
;
i
<
testSamples
;
++
i
)
for
(
int
i
=
0
;
i
<
testSamples
;
++
i
)
res
+
=
f
(
swTest
[
i
],
orig
);
res
Orig
[
i
]
=
f
(
swTest
[
i
],
orig
);
timer
.
stop
();
timer
.
stop
();
const
auto
vgTime
=
timer
.
elapsed
();
const
auto
vgTime
=
timer
.
elapsed
();
...
@@ -92,15 +92,20 @@ void runTest(const std::string& name, const Function& f,
...
@@ -92,15 +92,20 @@ void runTest(const std::string& name, const Function& f,
timer
.
reset
();
timer
.
reset
();
timer
.
start
();
timer
.
start
();
res
=
0.0
;
auto
resSpline
=
swTest
;
for
(
int
i
=
0
;
i
<
testSamples
;
++
i
)
for
(
int
i
=
0
;
i
<
testSamples
;
++
i
)
res
+
=
f
(
swTest
[
i
],
spline
);
res
Spline
[
i
]
=
f
(
swTest
[
i
],
spline
);
timer
.
stop
();
timer
.
stop
();
const
auto
vgSplineTime
=
timer
.
elapsed
();
const
auto
vgSplineTime
=
timer
.
elapsed
();
std
::
cout
<<
"Spline law computed "
<<
testSamples
<<
" samples in "
<<
vgSplineTime
<<
" seconds."
<<
std
::
endl
;
std
::
cout
<<
"Spline law computed "
<<
testSamples
<<
" samples in "
<<
vgSplineTime
<<
" seconds."
<<
std
::
endl
;
std
::
cout
<<
"Speed-up factor ca. "
<<
(
vgTime
/
vgSplineTime
)
<<
"x (only in spline region)"
<<
std
::
endl
;
std
::
cout
<<
"Speed-up factor ca. "
<<
(
vgTime
/
vgSplineTime
)
<<
"x (only in spline region)"
<<
std
::
endl
;
auto
error
=
resOrig
;
for
(
int
i
=
0
;
i
<
error
.
size
();
++
i
)
error
[
i
]
=
std
::
abs
(
error
[
i
]
-
resSpline
[
i
]);
std
::
cout
<<
"Maximum error: "
<<
*
std
::
max_element
(
error
.
begin
(),
error
.
end
())
<<
std
::
endl
;
}
}
}
}
...
...
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