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
hyteg
hyteg
Commits
645004c0
Commit
645004c0
authored
Aug 30, 2021
by
Marcel Koch
Browse files
use jacobi preconditioner in both cases
parent
861ab17e
Pipeline
#33996
failed with stages
in 19 minutes and 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/hyteg/ginkgo/GinkgoCGSolver.hpp
View file @
645004c0
...
...
@@ -22,10 +22,12 @@
#include
"ginkgo/core/factorization/par_ilu.hpp"
#include
"ginkgo/core/factorization/par_ilut.hpp"
#include
"ginkgo/core/log/convergence.hpp"
#include
"ginkgo/core/log/record.hpp"
#include
"ginkgo/core/log/stream.hpp"
#include
"ginkgo/core/matrix/csr.hpp"
#include
"ginkgo/core/matrix/dense.hpp"
#include
"ginkgo/core/preconditioner/ilu.hpp"
#include
"ginkgo/core/preconditioner/jacobi.hpp"
#include
"ginkgo/core/solver/cg.hpp"
#include
"ginkgo/core/stop/iteration.hpp"
#include
"ginkgo/core/stop/residual_norm.hpp"
...
...
@@ -297,6 +299,7 @@ class GinkgoCGSolver : public Solver< OperatorType >
{
auto
rel_mode
=
constraints_type
==
constraints
::
penalty
?
gko
::
stop
::
mode
::
initial_resnorm
:
gko
::
stop
::
mode
::
rhs_norm
;
auto
log_cout
=
gko
::
share
(
gko
::
log
::
Stream
<
valueType
>::
create
(
host_exec_
,
gko
::
log
::
Logger
::
criterion_check_completed_mask
,
std
::
cout
,
true
)
);
auto
log
=
gko
::
share
(
gko
::
log
::
Convergence
<
valueType
>::
create
(
solver_exec_
)
);
auto
criteria
=
gko
::
stop
::
Combined
::
build
()
.
with_criteria
(
gko
::
stop
::
ResidualNorm
<
valueType
>::
build
()
...
...
@@ -309,7 +312,8 @@ class GinkgoCGSolver : public Solver< OperatorType >
.
on
(
solver_exec_
),
gko
::
stop
::
Iteration
::
build
().
with_max_iters
(
maxIterations
).
on
(
solver_exec_
)
)
.
on
(
solver_exec_
);
criteria
->
add_logger
(
gko
::
share
(
log
)
);
criteria
->
add_logger
(
log
);
//criteria->add_logger( log_cout );
solver_factory_
=
gko
::
solver
::
Cg
<
valueType
>::
build
().
with_criteria
(
gko
::
share
(
criteria
)
).
on
(
solver_exec_
);
}
...
...
@@ -402,7 +406,8 @@ class GinkgoCGSolver : public Solver< OperatorType >
{
//auto par_ilu = gko::factorization::Ilu< valueType, int32_t >::build().on( solver_exec_ )->generate( matrix_ );
auto
ilu
=
gko
::
preconditioner
::
Ilu
<>::
build
().
on
(
solver_exec_
)
->
generate
(
matrix_
);
solver_
->
set_preconditioner
(
gko
::
share
(
ilu
)
);
auto
jac
=
gko
::
preconditioner
::
Jacobi
<
valueType
,
int32_t
>::
build
().
on
(
solver_exec_
)
->
generate
(
matrix_
);
solver_
->
set_preconditioner
(
gko
::
share
(
jac
)
);
}
x
.
getStorage
()
->
getTimingTree
()
->
stop
(
"Ginkgo CG Solver Set-Up"
);
}
...
...
src/hyteg/petsc/PETScCGSolver.hpp
View file @
645004c0
...
...
@@ -116,7 +116,7 @@ class PETScCGSolver : public Solver< OperatorType >
}
KSPSetOperators
(
ksp
,
Amat
.
get
(),
Amat
.
get
()
);
KSPGetPC
(
ksp
,
&
pc
);
PCSetType
(
pc
,
PC
NONE
);
PCSetType
(
pc
,
PC
JACOBI
);
KSPSolve
(
ksp
,
bVec
.
get
(),
xVec
.
get
()
);
...
...
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