Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
ed8e83c8
Commit
ed8e83c8
authored
May 05, 2009
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some not so important changes.
parent
20c417fa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
71 deletions
+38
-71
AMDiS/src/ITL_OEMSolver.h
AMDiS/src/ITL_OEMSolver.h
+6
-5
AMDiS/src/ITL_Solver.h
AMDiS/src/ITL_Solver.h
+4
-4
AMDiS/src/OEMSolver.h
AMDiS/src/OEMSolver.h
+16
-56
AMDiS/src/ProblemVec.cc
AMDiS/src/ProblemVec.cc
+12
-6
No files found.
AMDiS/src/ITL_OEMSolver.h
View file @
ed8e83c8
...
...
@@ -98,15 +98,15 @@ namespace AMDiS {
public:
/// The constructor reads needed parameters and sets solvers \ref name.
ITL_OEMSolver_para
(
::
std
::
string
name
)
:
OEMSolver
(
name
),
para
(
1
)
:
OEMSolver
(
name
),
ell
(
1
)
{
GET_PARAMETER
(
0
,
name
+
"->
para
"
,
"%d"
,
&
para
);
GET_PARAMETER
(
0
,
name
+
"->
ell
"
,
"%d"
,
&
ell
);
}
~
ITL_OEMSolver_para
()
{}
/// Set parameter of iterative solver
void
set
Para
(
int
p
)
{
para
=
p
;
}
void
set
Ell
(
int
p
)
{
ell
=
p
;
}
/// Solves the system iteratively
int
solveSystem
(
const
DOFMatrix
::
base_matrix_type
&
A
,
...
...
@@ -115,7 +115,7 @@ 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
,
para
);
return
ITLSolver
()(
A
,
x
,
b
,
*
this
->
leftPrecon
,
*
this
->
rightPrecon
,
iter
,
ell
);
}
class
Creator
:
public
OEMSolverCreator
...
...
@@ -132,7 +132,8 @@ namespace AMDiS {
};
private:
int
para
;
/// parameter for bicgstab_ell iterative solver
int
ell
;
};
...
...
AMDiS/src/ITL_Solver.h
View file @
ed8e83c8
...
...
@@ -84,7 +84,7 @@ namespace AMDiS {
{
public:
/// The constructor reads required parameters and sets solvers \ref name.
BiCGSolver
(
::
std
::
string
name
)
:
ITL_OEMSolver
<
bicg_solver_type
>
(
name
)
{}
BiCGSolver
(
std
::
string
name
)
:
ITL_OEMSolver
<
bicg_solver_type
>
(
name
)
{}
};
...
...
@@ -113,7 +113,7 @@ namespace AMDiS {
{
public:
/// The constructor reads required parameters and sets solvers \ref name.
BiCGStab
(
::
std
::
string
name
)
:
ITL_OEMSolver
<
bicgstab_type
>
(
name
)
{}
BiCGStab
(
std
::
string
name
)
:
ITL_OEMSolver
<
bicgstab_type
>
(
name
)
{}
};
...
...
@@ -142,7 +142,7 @@ namespace AMDiS {
{
public:
/// The constructor reads required parameters and sets solvers \ref name.
BiCGStab2
(
::
std
::
string
name
)
:
ITL_OEMSolver
<
bicgstab2_type
>
(
name
)
{}
BiCGStab2
(
std
::
string
name
)
:
ITL_OEMSolver
<
bicgstab2_type
>
(
name
)
{}
};
...
...
@@ -170,7 +170,7 @@ namespace AMDiS {
{
public:
/// The constructor reads required parameters and sets solvers \ref name.
BiCGStabEll
(
::
std
::
string
name
)
:
ITL_OEMSolver_para
<
bicgstab_ell_type
>
(
name
)
{}
BiCGStabEll
(
std
::
string
name
)
:
ITL_OEMSolver_para
<
bicgstab_ell_type
>
(
name
)
{}
};
...
...
AMDiS/src/OEMSolver.h
View file @
ed8e83c8
...
...
@@ -55,9 +55,7 @@ namespace AMDiS {
typedef
DOFMatrix
::
base_matrix_type
matrix_type
;
typedef
DOFMatrix
::
value_type
value_type
;
/** \brief
* The constructor reads needed parameters and sets solvers \ref name.
*/
/// The constructor reads needed parameters and sets solvers \ref name.
OEMSolver
(
std
::
string
str
)
:
name
(
str
),
tolerance
(
0
),
...
...
@@ -155,72 +153,52 @@ namespace AMDiS {
return
r
;
}
// ===== getting-methods ======================================================
/** \name getting methods
* \{
*/
/** \brief
* Returns solvers \ref name.
*/
/// Returns solvers \ref name.
inline
const
std
::
string
&
getName
()
{
return
name
;
}
/** \brief
* Returns \ref tolerance
*/
/// Returns \ref tolerance
inline
double
getTolerance
()
{
return
tolerance
;
}
/** \brief
* Returns \ref max_iter
*/
/// Returns \ref max_iter
inline
int
getMaxIterations
()
{
return
max_iter
;
}
/** \brief
* Returns \ref residual
*/
/// Returns \ref residual
inline
double
getResidual
()
{
return
residual
;
}
/** \} */
// ===== setting-methods ======================================================
/** \name setting methods
* \{
*/
/** \brief
* Sets \ref tolerance
*/
/// Sets \ref tolerance
inline
void
setTolerance
(
double
tol
)
{
tolerance
=
tol
;
}
/** \brief
* Sets \ref relative
*/
/// Sets \ref relative
inline
void
setRelative
(
bool
rel
)
{
relative
=
rel
;
}
/** \brief
* Sets \ref max_iter
*/
/// Sets \ref max_iter
inline
void
setMaxIterations
(
int
i
)
{
max_iter
=
i
;
}
/** \brief
* Sets \ref info
*/
/// Sets \ref info
inline
void
setInfo
(
int
i
)
{
info
=
i
;
}
...
...
@@ -228,34 +206,22 @@ namespace AMDiS {
/** \} */
protected:
/** \brief
* solvers name.
*/
/// solvers name.
std
::
string
name
;
/** \brief
* Solver tolerance |r|. Set in OEMSolver's constructor.
*/
/// Solver tolerance |r|. Set in OEMSolver's constructor.
double
tolerance
;
/** \brief
* Relative solver tolerance |r|/|r0|. Set in OEMSolver's constructor.
*/
/// Relative solver tolerance |r|/|r0|. Set in OEMSolver's constructor.
double
relative
;
/** \brief
* maximal number of iterations. Set in OEMSolver's constructor.
*/
/// maximal number of iterations. Set in OEMSolver's constructor.
int
max_iter
;
/** \brief
* info level during solving the system. Set in OEMSolver's constructor.
*/
/// info level during solving the system. Set in OEMSolver's constructor.
int
info
;
/** \brief
* current residual.
*/
/// current residual.
double
residual
;
/// Print cycle, after how many iterations the residuum norm is logged.
...
...
@@ -266,10 +232,6 @@ namespace AMDiS {
ITL_BasePreconditioner
*
rightPrecon
;
};
// ============================================================================
// ===== class OEMSolverCreator ===============================================
// ============================================================================
/**
* \ingroup Solver
*
...
...
@@ -281,9 +243,7 @@ namespace AMDiS {
public:
virtual
~
OEMSolverCreator
()
{}
/** \brief
* Sets \ref problem
*/
/// Sets \ref problem
void
setName
(
std
::
string
str
)
{
name
=
str
;
}
...
...
AMDiS/src/ProblemVec.cc
View file @
ed8e83c8
...
...
@@ -792,20 +792,26 @@ namespace AMDiS {
assembleFlag
);
}
int
nnz
=
0
;
// Finish insertion
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
if
((
*
systemMatrix
)[
i
][
j
])
if
((
*
systemMatrix
)[
i
][
j
])
{
(
*
systemMatrix
)[
i
][
j
]
->
finishInsertion
();
nnz
+=
(
*
systemMatrix
)[
i
][
j
]
->
getBaseMatrix
().
nnz
();
}
//
clock_t first1 = clock();
// clock_t first1 = clock();
solverMatrix
.
setMatrix
(
*
systemMatrix
);
//
clock_t first2 = clock();
// clock_t first2 = clock();
createPrecon
();
// clock_t first3 = clock();
// clock_t first3 = clock();
// std::cout << "T1 = " << TIME_USED(first1, first2) << std::endl;
// std::cout << "T2 = " << TIME_USED(first2, first3) << std::endl;
// std::cout << "T1 = " << TIME_USED(first1, first2) << std::endl;
// std::cout << "T2 = " << TIME_USED(first2, first3) << std::endl;
INFO
(
info
,
8
)(
"fillin of assembled matrix: %d
\n
"
,
nnz
);
#ifdef _OPENMP
INFO
(
info
,
8
)(
"buildAfterCoarsen needed %.5f seconds system time / %.5f seconds wallclock time
\n
"
,
...
...
Write
Preview
Markdown
is supported
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