Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Core Modules
dune-istl
Commits
d857f15b
Commit
d857f15b
authored
17 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Renaming a variable shadowed another an broke istl. Fixed this.
[[Imported from SVN: r774]]
parent
a4a06b80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
istl/solvers.hh
+56
-56
56 additions, 56 deletions
istl/solvers.hh
with
56 additions
and
56 deletions
istl/solvers.hh
+
56
−
56
View file @
d857f15b
...
...
@@ -108,9 +108,9 @@ namespace Dune {
\param x The left hand side to store the result in.
\param b The right hand side
\param r Object to store the statistics about applying the operator.
\param r
es
Object to store the statistics about applying the operator.
*/
virtual
void
apply
(
X
&
x
,
Y
&
b
,
InverseOperatorResult
&
r
)
=
0
;
virtual
void
apply
(
X
&
x
,
Y
&
b
,
InverseOperatorResult
&
r
es
)
=
0
;
/*!
\brief apply inverse operator, with given convergence criteria.
...
...
@@ -120,9 +120,9 @@ namespace Dune {
\param x The left hand side to store the result in.
\param b The right hand side
\param reduction The minimum defect reduction to achieve.
\param r Object to store the statistics about applying the operator.
\param r
es
Object to store the statistics about applying the operator.
*/
virtual
void
apply
(
X
&
x
,
Y
&
b
,
double
reduction
,
InverseOperatorResult
&
r
)
=
0
;
virtual
void
apply
(
X
&
x
,
Y
&
b
,
double
reduction
,
InverseOperatorResult
&
r
es
)
=
0
;
//! \brief Destructor
virtual
~
InverseOperator
()
{}
...
...
@@ -210,10 +210,10 @@ namespace Dune {
//! \copydoc InverseOperator::apply(X&,Y&,InverseOperatorResult&)
virtual
void
apply
(
X
&
x
,
X
&
b
,
InverseOperatorResult
&
r
)
virtual
void
apply
(
X
&
x
,
X
&
b
,
InverseOperatorResult
&
r
es
)
{
// clear solver statistics
r
.
clear
();
r
es
.
clear
();
// start a timer
Timer
watch
;
...
...
@@ -252,7 +252,7 @@ namespace Dune {
def
=
defnew
;
// update norm
if
(
def
<
def0
*
_reduction
||
def
<
1E-30
)
// convergence check
{
r
.
converged
=
true
;
r
es
.
converged
=
true
;
break
;
}
}
...
...
@@ -265,21 +265,21 @@ namespace Dune {
_prec
.
post
(
x
);
// fill statistics
r
.
iterations
=
i
;
r
.
reduction
=
def
/
def0
;
r
.
conv_rate
=
pow
(
r
.
reduction
,
1.0
/
i
);
r
.
elapsed
=
watch
.
elapsed
();
r
es
.
iterations
=
i
;
r
es
.
reduction
=
def
/
def0
;
r
es
.
conv_rate
=
pow
(
r
es
.
reduction
,
1.0
/
i
);
r
es
.
elapsed
=
watch
.
elapsed
();
// final print
if
(
_verbose
>
0
)
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
.
conv_rate
,
r
.
elapsed
,
r
.
elapsed
/
i
,
i
);
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
es
.
conv_rate
,
r
es
.
elapsed
,
r
es
.
elapsed
/
i
,
i
);
}
//! \copydoc InverseOperator::apply(X&,Y&,double,InverseOperatorResult&)
virtual
void
apply
(
X
&
x
,
X
&
b
,
double
reduction
,
InverseOperatorResult
&
r
)
virtual
void
apply
(
X
&
x
,
X
&
b
,
double
reduction
,
InverseOperatorResult
&
r
es
)
{
_reduction
=
reduction
;
(
*
this
).
apply
(
x
,
b
,
r
);
(
*
this
).
apply
(
x
,
b
,
r
es
);
}
private
:
...
...
@@ -337,9 +337,9 @@ namespace Dune {
\copydoc InverseOperator::apply(X&,Y&,InverseOperatorResult&)
*/
virtual
void
apply
(
X
&
x
,
X
&
b
,
InverseOperatorResult
&
r
)
virtual
void
apply
(
X
&
x
,
X
&
b
,
InverseOperatorResult
&
r
es
)
{
r
.
clear
();
// clear solver statistics
r
es
.
clear
();
// clear solver statistics
Timer
watch
;
// start a timer
_prec
.
pre
(
x
,
b
);
// prepare preconditioner
_op
.
applyscaleadd
(
-
1
,
x
,
b
);
// overwrite b with defect
...
...
@@ -373,7 +373,7 @@ namespace Dune {
def
=
defnew
;
// update norm
if
(
def
<
def0
*
_reduction
||
def
<
1E-30
)
// convergence check
{
r
.
converged
=
true
;
r
es
.
converged
=
true
;
break
;
}
}
...
...
@@ -381,12 +381,12 @@ namespace Dune {
if
(
_verbose
==
1
)
// printing for non verbose
printf
(
"%5d %12.4E
\n
"
,
i
,
def
);
_prec
.
post
(
x
);
// postprocess preconditioner
r
.
iterations
=
i
;
// fill statistics
r
.
reduction
=
def
/
def0
;
r
.
conv_rate
=
pow
(
r
.
reduction
,
1.0
/
i
);
r
.
elapsed
=
watch
.
elapsed
();
r
es
.
iterations
=
i
;
// fill statistics
r
es
.
reduction
=
def
/
def0
;
r
es
.
conv_rate
=
pow
(
r
es
.
reduction
,
1.0
/
i
);
r
es
.
elapsed
=
watch
.
elapsed
();
if
(
_verbose
>
0
)
// final print
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
.
conv_rate
,
r
.
elapsed
,
r
.
elapsed
/
i
,
i
);
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
es
.
conv_rate
,
r
es
.
elapsed
,
r
es
.
elapsed
/
i
,
i
);
}
/*!
...
...
@@ -394,10 +394,10 @@ namespace Dune {
\copydoc InverseOperator::apply(X&,Y&,double,InverseOperatorResult&)
*/
virtual
void
apply
(
X
&
x
,
X
&
b
,
double
reduction
,
InverseOperatorResult
&
r
)
virtual
void
apply
(
X
&
x
,
X
&
b
,
double
reduction
,
InverseOperatorResult
&
r
es
)
{
_reduction
=
reduction
;
(
*
this
).
apply
(
x
,
b
,
r
);
(
*
this
).
apply
(
x
,
b
,
r
es
);
}
private
:
...
...
@@ -453,9 +453,9 @@ namespace Dune {
\copydoc InverseOperator::apply(X&,Y&,InverseOperatorResult&)
*/
virtual
void
apply
(
X
&
x
,
X
&
b
,
InverseOperatorResult
&
r
)
virtual
void
apply
(
X
&
x
,
X
&
b
,
InverseOperatorResult
&
r
es
)
{
r
.
clear
();
// clear solver statistics
r
es
.
clear
();
// clear solver statistics
Timer
watch
;
// start a timer
_prec
.
pre
(
x
,
b
);
// prepare preconditioner
_op
.
applyscaleadd
(
-
1
,
x
,
b
);
// overwrite b with defect
...
...
@@ -466,13 +466,13 @@ namespace Dune {
double
def0
=
_sp
.
norm
(
b
);
// compute norm
if
(
def0
<
1E-30
)
// convergence check
{
r
.
converged
=
true
;
r
.
iterations
=
0
;
// fill statistics
r
.
reduction
=
0
;
r
.
conv_rate
=
0
;
r
.
elapsed
=
0
;
r
es
.
converged
=
true
;
r
es
.
iterations
=
0
;
// fill statistics
r
es
.
reduction
=
0
;
r
es
.
conv_rate
=
0
;
r
es
.
elapsed
=
0
;
if
(
_verbose
>
0
)
// final print
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
.
conv_rate
,
r
.
elapsed
,
r
.
elapsed
,
0
);
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
es
.
conv_rate
,
r
es
.
elapsed
,
r
es
.
elapsed
,
0
);
return
;
}
...
...
@@ -510,7 +510,7 @@ namespace Dune {
def
=
defnew
;
// update norm
if
(
def
<
def0
*
_reduction
||
def
<
1E-30
||
i
==
_maxit
)
// convergence check
{
r
.
converged
=
true
;
r
es
.
converged
=
true
;
break
;
}
...
...
@@ -527,12 +527,12 @@ namespace Dune {
if
(
_verbose
==
1
)
// printing for non verbose
printf
(
"%5d %12.4E
\n
"
,
i
,
def
);
_prec
.
post
(
x
);
// postprocess preconditioner
r
.
iterations
=
i
;
// fill statistics
r
.
reduction
=
def
/
def0
;
r
.
conv_rate
=
pow
(
r
.
reduction
,
1.0
/
i
);
r
.
elapsed
=
watch
.
elapsed
();
r
es
.
iterations
=
i
;
// fill statistics
r
es
.
reduction
=
def
/
def0
;
r
es
.
conv_rate
=
pow
(
r
es
.
reduction
,
1.0
/
i
);
r
es
.
elapsed
=
watch
.
elapsed
();
if
(
_verbose
>
0
)
// final print
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
.
conv_rate
,
r
.
elapsed
,
r
.
elapsed
/
i
,
i
);
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
es
.
conv_rate
,
r
es
.
elapsed
,
r
es
.
elapsed
/
i
,
i
);
}
/*!
...
...
@@ -540,10 +540,10 @@ namespace Dune {
\copydoc InverseOperator::apply(X&,Y&,double,InverseOperatorResult&)
*/
virtual
void
apply
(
X
&
x
,
X
&
b
,
double
reduction
,
InverseOperatorResult
&
r
)
virtual
void
apply
(
X
&
x
,
X
&
b
,
double
reduction
,
InverseOperatorResult
&
r
es
)
{
_reduction
=
reduction
;
(
*
this
).
apply
(
x
,
b
,
r
);
(
*
this
).
apply
(
x
,
b
,
r
es
);
}
private
:
...
...
@@ -601,7 +601,7 @@ namespace Dune {
\copydoc InverseOperator::apply(X&,Y&,InverseOperatorResult&)
*/
virtual
void
apply
(
X
&
x
,
X
&
b
,
InverseOperatorResult
&
r
)
virtual
void
apply
(
X
&
x
,
X
&
b
,
InverseOperatorResult
&
r
es
)
{
const
double
EPSILON
=
1e-80
;
...
...
@@ -624,7 +624,7 @@ namespace Dune {
//
// r = r - Ax; rt = r
r
.
clear
();
// clear solver statistics
r
es
.
clear
();
// clear solver statistics
Timer
watch
;
// start a timer
_op
.
applyscaleadd
(
-
1
,
x
,
r
);
// overwrite b with defect
_prec
.
pre
(
x
,
r
);
// prepare preconditioner
...
...
@@ -649,12 +649,12 @@ namespace Dune {
if
(
norm
<
(
_reduction
*
norm_0
)
||
norm
<
1E-30
)
{
r
.
converged
=
1
;
r
es
.
converged
=
1
;
_prec
.
post
(
x
);
// postprocess preconditioner
r
.
iterations
=
0
;
// fill statistics
r
.
reduction
=
0
;
r
.
conv_rate
=
0
;
r
.
elapsed
=
watch
.
elapsed
();
r
es
.
iterations
=
0
;
// fill statistics
r
es
.
reduction
=
0
;
r
es
.
conv_rate
=
0
;
r
es
.
elapsed
=
watch
.
elapsed
();
return
;
}
...
...
@@ -728,7 +728,7 @@ namespace Dune {
if
(
norm
<
(
_reduction
*
norm_0
)
)
{
r
.
converged
=
1
;
r
es
.
converged
=
1
;
break
;
}
...
...
@@ -769,7 +769,7 @@ namespace Dune {
if
(
norm
<
(
_reduction
*
norm_0
)
||
norm
<
1E-30
)
{
r
.
converged
=
1
;
r
es
.
converged
=
1
;
break
;
}
...
...
@@ -782,12 +782,12 @@ namespace Dune {
if
(
_verbose
==
1
)
// printing for non verbose
printf
(
"%5d %12.4E
\n
"
,
it
,
norm
);
_prec
.
post
(
x
);
// postprocess preconditioner
r
.
iterations
=
it
;
// fill statistics
r
.
reduction
=
norm
/
norm_0
;
r
.
conv_rate
=
pow
(
r
.
reduction
,
1.0
/
it
);
r
.
elapsed
=
watch
.
elapsed
();
r
es
.
iterations
=
it
;
// fill statistics
r
es
.
reduction
=
norm
/
norm_0
;
r
es
.
conv_rate
=
pow
(
r
es
.
reduction
,
1.0
/
it
);
r
es
.
elapsed
=
watch
.
elapsed
();
if
(
_verbose
>
0
)
// final print
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
.
conv_rate
,
r
.
elapsed
,
r
.
elapsed
/
it
,
it
);
printf
(
"=== rate=%g, T=%g, TIT=%g, IT=%d
\n
"
,
r
es
.
conv_rate
,
r
es
.
elapsed
,
r
es
.
elapsed
/
it
,
it
);
}
/*!
...
...
@@ -795,10 +795,10 @@ namespace Dune {
\copydoc InverseOperator::apply(X&,Y&,double,InverseOperatorResult&)
*/
virtual
void
apply
(
X
&
x
,
X
&
b
,
double
reduction
,
InverseOperatorResult
&
r
)
virtual
void
apply
(
X
&
x
,
X
&
b
,
double
reduction
,
InverseOperatorResult
&
r
es
)
{
_reduction
=
reduction
;
(
*
this
).
apply
(
x
,
b
,
r
);
(
*
this
).
apply
(
x
,
b
,
r
es
);
}
private
:
...
...
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