Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
b0d3cf31
Commit
b0d3cf31
authored
Sep 16, 2009
by
Peter Gottschling
Browse files
Matrixausschriften als Kommentare; Iterationszahlen und Fehlercode können abgefragt werden.
parent
e4f84157
Changes
3
Show whitespace changes
Inline
Side-by-side
AMDiS/src/ITL_OEMSolver.h
View file @
b0d3cf31
...
...
@@ -74,7 +74,9 @@ namespace AMDiS {
if (one_norm(x) > 1e100)
x= 0.0;
#endif
return
ITLSolver
()(
A
,
x
,
b
,
*
this
->
leftPrecon
,
*
this
->
rightPrecon
,
iter
);
error
=
ITLSolver
()(
A
,
x
,
b
,
*
this
->
leftPrecon
,
*
this
->
rightPrecon
,
iter
);
iterations
=
iter
.
iterations
();
return
error
;
}
...
...
@@ -124,7 +126,9 @@ namespace AMDiS {
{
itl
::
cyclic_iteration
<
value_type
>
iter
(
b
,
this
->
max_iter
,
this
->
relative
,
this
->
tolerance
,
this
->
print_cycle
);
return
ITLSolver
()(
A
,
x
,
b
,
*
this
->
leftPrecon
,
*
this
->
rightPrecon
,
iter
,
ell
);
error
=
ITLSolver
()(
A
,
x
,
b
,
*
this
->
leftPrecon
,
*
this
->
rightPrecon
,
iter
,
ell
);
iterations
=
iter
.
iterations
();
return
error
;
}
class
Creator
:
public
OEMSolverCreator
...
...
AMDiS/src/OEMSolver.h
View file @
b0d3cf31
...
...
@@ -64,6 +64,8 @@ namespace AMDiS {
info
(
0
),
residual
(
0
),
print_cycle
(
100
),
iterations
(
-
1
),
error
(
-
1
),
leftPrecon
(
NULL
),
rightPrecon
(
NULL
)
{}
...
...
@@ -132,6 +134,7 @@ namespace AMDiS {
counter
++
;
}
// std::cout << "Iterative Solver: A = \n" << A.getMatrix();
int
r
=
solveSystem
(
A
.
getMatrix
(),
xx
,
bb
);
// Copy solution vector to DOFVector
...
...
@@ -164,6 +167,7 @@ namespace AMDiS {
}
// Solver on DOFVector for single system
std
::
cout
<<
"Iterative Solver (System): A =
\n
"
<<
A
.
getMatrix
();
int
r
=
solveSystem
(
A
.
getMatrix
(),
xx
,
bb
);
for
(
int
i
=
0
,
counter
=
0
;
i
<
ns
;
i
++
)
{
...
...
@@ -227,6 +231,18 @@ namespace AMDiS {
max_iter
=
i
;
}
/// Returns number of iterations in last run of an iterative solver
inline
int
getIterations
()
{
return
iterations
;
}
/// Returns error code in last run of an iterative solver
inline
int
getErrorCode
()
{
return
error
;
}
/// Sets \ref info
inline
void
setInfo
(
int
i
)
{
...
...
@@ -257,8 +273,16 @@ namespace AMDiS {
/// Print cycle, after how many iterations the residuum norm is logged.
int
print_cycle
;
/// How many iterations were performed in last solver (not set by UmfPack)
int
iterations
;
/// Error code in last solver (not set by UmfPack)
int
error
;
/// Left preconditioner (ignored by some iterative solvers and by UmfPack)
ITL_BasePreconditioner
*
leftPrecon
;
/// Right preconditioner (ignored by some iterative solvers and by UmfPack)
ITL_BasePreconditioner
*
rightPrecon
;
};
...
...
AMDiS/src/UmfPackSolver.h
View file @
b0d3cf31
...
...
@@ -87,6 +87,8 @@ namespace AMDiS {
solver
->
update_numeric
();
else
solver
->
update
();
// std::cout << "UmfPackSolver: A = \n" << A << "\n";
int
code
=
(
*
solver
)(
x
,
b
);
mtl
::
dense_vector
<
value_type
>
r
=
b
-
A
*
x
;
std
::
cout
<<
"UmfPackSolver: ||b-Ax|| = "
<<
two_norm
(
r
)
<<
"
\n
"
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment