Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
amdis
Commits
20e1adb5
Commit
20e1adb5
authored
Oct 23, 2009
by
Thomas Witkowski
Browse files
Small changes in solver interface the get the residual.
parent
74c16356
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/DOFMatrix.cc
View file @
20e1adb5
...
...
@@ -197,9 +197,9 @@ namespace AMDiS {
if
(
condition
->
applyBoundaryCondition
())
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
if
(
rankDofs
[
rowIndices
[
i
]])
applyDBCs
.
insert
(
static_cast
<
int
>
(
row
Indices
[
i
]
));
applyDBCs
.
insert
(
static_cast
<
int
>
(
row
));
#else
applyDBCs
.
insert
(
static_cast
<
int
>
(
row
Indices
[
i
]
));
applyDBCs
.
insert
(
static_cast
<
int
>
(
row
));
#endif
}
}
else
{
...
...
AMDiS/src/ITL_OEMSolver.h
View file @
20e1adb5
...
...
@@ -64,18 +64,10 @@ namespace AMDiS {
{
itl
::
cyclic_iteration
<
value_type
>
iter
(
b
,
this
->
max_iter
,
this
->
relative
,
this
->
tolerance
,
this
->
print_cycle
);
#if 0
std::cout << "A is " << num_rows(A) << " x " << num_cols(A)
<< ", one_norm(A) = " << one_norm(A)
<< ", b is " << num_rows(b)
<< ", one_norm(b) = " << one_norm(b)
<< ", x is " << num_rows(x)
<< ", one_norm(x) = " << one_norm(x) << "\n";
if (one_norm(x) > 1e100)
x= 0.0;
#endif
error
=
ITLSolver
()(
A
,
x
,
b
,
*
this
->
leftPrecon
,
*
this
->
rightPrecon
,
iter
);
iterations
=
iter
.
iterations
();
error
=
ITLSolver
()(
A
,
x
,
b
,
*
this
->
leftPrecon
,
*
this
->
rightPrecon
,
iter
);
iterations
=
iter
.
iterations
();
residual
=
iter
.
resid
();
return
error
;
}
...
...
@@ -127,8 +119,9 @@ namespace AMDiS {
{
itl
::
cyclic_iteration
<
value_type
>
iter
(
b
,
this
->
max_iter
,
this
->
relative
,
this
->
tolerance
,
this
->
print_cycle
);
error
=
ITLSolver
()(
A
,
x
,
b
,
*
this
->
leftPrecon
,
*
this
->
rightPrecon
,
iter
,
ell
);
iterations
=
iter
.
iterations
();
error
=
ITLSolver
()(
A
,
x
,
b
,
*
this
->
leftPrecon
,
*
this
->
rightPrecon
,
iter
,
ell
);
iterations
=
iter
.
iterations
();
residual
=
iter
.
resid
();
return
error
;
}
...
...
AMDiS/src/ITL_Preconditioner.h
View file @
20e1adb5
...
...
@@ -142,7 +142,7 @@ namespace AMDiS {
:
public
ITL_Preconditioner
<
itl
::
pc
::
identity
<
DOFMatrix
::
base_matrix_type
>
>
{
typedef
ITL_Preconditioner
<
itl
::
pc
::
identity
<
DOFMatrix
::
base_matrix_type
>
>
base
;
public:
IdentityPreconditioner
(
const
DOFMatrix
::
base_matrix_type
&
A
)
:
base
(
A
)
{}
};
...
...
AMDiS/src/Mesh.cc
View file @
20e1adb5
...
...
@@ -474,7 +474,7 @@ namespace AMDiS {
traverse
(
-
1
,
fill_flag
,
newDOFFct2
);
newDOF
.
resize
(
0
);
}
}
}
...
...
AMDiS/src/OEMSolver.h
View file @
20e1adb5
...
...
@@ -182,25 +182,25 @@ namespace AMDiS {
*/
/// Returns solvers \ref name.
inline
std
::
string
getName
()
inline
std
::
string
getName
()
const
{
return
name
;
}
/// Returns \ref tolerance
inline
double
getTolerance
()
inline
double
getTolerance
()
const
{
return
tolerance
;
}
/// Returns \ref max_iter
inline
int
getMaxIterations
()
inline
int
getMaxIterations
()
const
{
return
max_iter
;
}
/// Returns \ref residual
inline
double
getResidual
()
inline
double
getResidual
()
const
{
return
residual
;
}
...
...
AMDiS/src/ProblemScal.cc
View file @
20e1adb5
...
...
@@ -587,9 +587,8 @@ namespace AMDiS {
}
systemMatrix
->
removeRowsWithDBC
(
systemMatrix
->
getApplyDBCs
());
systemMatrix
->
finishInsertion
();
// TODO: ExitMatrix should be called after finishInsertion!
if
(
systemMatrix
->
getBoundaryManager
())
systemMatrix
->
getBoundaryManager
()
->
exitMatrix
(
systemMatrix
);
...
...
@@ -599,14 +598,7 @@ namespace AMDiS {
solution
->
getBoundaryManager
()
->
exitVector
(
solution
);
INFO
(
info
,
8
)(
"buildAfterCoarsen needed %.5f seconds
\n
"
,
TIME_USED
(
first
,
clock
()));
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
// PetscErrorCode ierr;
// Mat A;
// ierr = MatCreate(PETSC_COMM_WORLD, &A); CHKERRQ(ierr);
#endif
createPrecon
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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