Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
agnumpde
dune-solvers
Commits
89723e23
Commit
89723e23
authored
8 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
Tests: Clean up; use energy norm
parent
54dd6440
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/solvers/test/gssteptest.cc
+10
-17
10 additions, 17 deletions
dune/solvers/test/gssteptest.cc
with
10 additions
and
17 deletions
dune/solvers/test/gssteptest.cc
+
10
−
17
View file @
89723e23
...
...
@@ -51,9 +51,8 @@ struct GSTestSuite {
using
LoopSolver
=
::
LoopSolver
<
Vector
>
;
using
Step
=
LinearIterationStep
<
Matrix
,
Vector
>
;
auto
solve
=
[
&
](
Step
*
step
,
double
stepTol
,
size_t
maxIterations
)
{
Vector
u_copy
=
p
.
u
;
step
->
setProblem
(
p
.
A
,
u_copy
,
p
.
rhs
);
auto
solve
=
[
&
](
Step
*
step
,
Vector
u_init
,
double
stepTol
,
size_t
maxIterations
)
{
step
->
setProblem
(
p
.
A
,
u_init
,
p
.
rhs
);
step
->
setIgnore
(
p
.
ignore
);
LoopSolver
solver
(
step
,
maxIterations
,
stepTol
,
&
p
.
energyNorm
,
verbosity
,
...
...
@@ -62,7 +61,7 @@ struct GSTestSuite {
solver
.
preprocess
();
solver
.
solve
();
return
u_
copy
;
return
u_
init
;
};
auto
analyse
=
...
...
@@ -80,20 +79,20 @@ struct GSTestSuite {
};
auto
test
=
[
&
](
Step
*
step
,
std
::
string
name
)
{
auto
result
=
solve
(
step
,
1e-12
,
2000
);
auto
result
=
solve
(
step
,
p
.
u_ex
,
1e-12
,
2000
);
passed
&=
analyse
(
result
,
name
,
1e-7
);
};
auto
diffTest
=
[
&
](
Step
*
step1
,
std
::
string
name1
,
Step
*
step2
,
std
::
string
name2
,
double
maxDiff
=
0.0
)
{
auto
result1
=
solve
(
step1
,
0.0
,
5
);
auto
result2
=
solve
(
step2
,
0.0
,
5
);
auto
result1
=
solve
(
step1
,
p
.
u_ex
,
0.0
,
5
);
auto
result2
=
solve
(
step2
,
p
.
u_ex
,
0.0
,
5
);
result1
-=
result2
;
if
(
result1
.
two_norm
()
>
maxDiff
)
{
auto
normDiff
=
p
.
energyNorm
.
diff
(
result1
,
result2
)
;
if
(
normDiff
>
maxDiff
)
{
passed
=
false
;
std
::
cerr
<<
name1
<<
" and "
<<
name2
<<
" differ with norm "
<<
result1
.
two_norm
()
<<
"."
<<
std
::
endl
;
<<
normDiff
<<
"."
<<
std
::
endl
;
return
;
}
std
::
cout
<<
Dune
::
formatString
(
"%*s"
,
-
60
,
name1
.
c_str
())
<<
" and "
...
...
@@ -167,13 +166,7 @@ struct GSTestSuite {
if
(
p
.
ignore
[
i
][
j
])
u_copy
[
i
][
j
]
+=
1.0
;
gsStep
.
setProblem
(
p
.
A
,
u_copy
,
p
.
rhs
);
gsStep
.
setIgnore
(
p
.
ignore
);
LoopSolver
solver
(
&
gsStep
,
2000
,
1e-8
,
&
p
.
energyNorm
,
Solver
::
QUIET
,
relativeErrors
);
solver
.
check
();
solver
.
preprocess
();
solver
.
solve
();
solve
(
&
gsStep
,
u_copy
,
1e-12
,
2000
);
for
(
size_t
i
=
0
;
i
<
p
.
u
.
size
();
++
i
)
for
(
size_t
j
=
0
;
j
<
blocksize
;
++
j
)
...
...
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