Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
iwr
amdis
Commits
b0d3cf31
Commit
b0d3cf31
authored
15 years ago
by
Peter Gottschling
Browse files
Options
Downloads
Patches
Plain Diff
Matrixausschriften als Kommentare; Iterationszahlen und Fehlercode können abgefragt werden.
parent
e4f84157
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
AMDiS/src/ITL_OEMSolver.h
+6
-2
6 additions, 2 deletions
AMDiS/src/ITL_OEMSolver.h
AMDiS/src/OEMSolver.h
+24
-0
24 additions, 0 deletions
AMDiS/src/OEMSolver.h
AMDiS/src/UmfPackSolver.h
+2
-0
2 additions, 0 deletions
AMDiS/src/UmfPackSolver.h
with
32 additions
and
2 deletions
AMDiS/src/ITL_OEMSolver.h
+
6
−
2
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
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/OEMSolver.h
+
24
−
0
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
;
};
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/UmfPackSolver.h
+
2
−
0
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
"
;
...
...
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