Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hyteg
hyteg
Commits
4ebba28d
Commit
4ebba28d
authored
Jan 14, 2022
by
Marcel Koch
Browse files
fix preconditioner numbering
parent
97c07f31
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hyteg/ginkgo/GinkgoBlockSolver.hpp
View file @
4ebba28d
...
...
@@ -3,6 +3,7 @@
#include <ginkgo/core/base/mpi.hpp>
#include <ginkgo/core/log/convergence.hpp>
#include <ginkgo/core/log/convergence_stream.hpp>
#include <ginkgo/core/factorization/ilu.hpp>
#include <ginkgo/core/matrix/block_matrix.hpp>
#include <ginkgo/core/matrix/identity.hpp>
#include <ginkgo/core/matrix/zero.hpp>
...
...
@@ -338,23 +339,13 @@ class GinkgoBlockSolver : public Solver< OperatorType >
auto
jac_gen
=
gko
::
share
(
gko
::
preconditioner
::
Jacobi
<
valueType
>::
build
().
with_max_block_size
(
1u
).
on
(
solver_exec_
)
);
if
(
velocityPreconditionerType_
==
0
)
{
b_pre_v
=
gko
::
share
(
gko
::
matrix
::
Identity
<
valueType
>::
create
(
solver_exec_
,
gko
::
dim
<
2
>
(
block_v_span
.
length
(),
block_v_span
.
length
()
)
)
);
}
else
if
(
velocityPreconditionerType_
==
1
)
{
b_pre_v
=
gko
::
share
(
jac_gen
->
generate
(
gko
::
share
(
device_monolithic_pre
->
create_submatrix
(
block_v_span
,
block_v_span
)
)
)
);
}
else
if
(
velocityPreconditionerType_
==
2
)
{
using
lower_isai
=
gko
::
preconditioner
::
Isai
<
gko
::
preconditioner
::
isai_type
::
general
,
valueType
,
indexType
>
;
using
upper_isai
=
gko
::
preconditioner
::
Isai
<
gko
::
preconditioner
::
isai_type
::
general
,
valueType
,
indexType
>
;
auto
ilu_gen
=
gko
::
share
(
gko
::
preconditioner
::
Ilu
<
lower_isai
,
upper_isai
>::
build
()
//
.with_factorization_factory( gko::factorization::Ilu< valueType >::build().on( solver_exec_ ) ) // doesn't make a lot of difference
.
with_factorization_factory
(
gko
::
factorization
::
Ilu
<
valueType
>::
build
().
on
(
solver_exec_
)
)
// doesn't make a lot of difference
.
on
(
solver_exec_
)
);
auto
smoother_gen
=
...
...
@@ -372,7 +363,7 @@ class GinkgoBlockSolver : public Solver< OperatorType >
.
on
(
solver_exec_
)
);
b_pre_v
=
gko
::
share
(
gko
::
solver
::
Multigrid
::
build
()
.
with_max_levels
(
9
u
)
.
with_max_levels
(
10
u
)
.
with_min_coarse_rows
(
500u
)
.
with_pre_smoother
(
smoother_gen
)
.
with_post_uses_pre
(
true
)
...
...
@@ -396,6 +387,16 @@ class GinkgoBlockSolver : public Solver< OperatorType >
WALBERLA_LOG_INFO_ON_ROOT
(
"[Ginkgo AMGX] Level 0 of size "
<<
amg
->
get_coarsest_solver
()
->
get_size
()
);
}
}
else
if
(
velocityPreconditionerType_
==
1
)
{
b_pre_v
=
gko
::
share
(
jac_gen
->
generate
(
gko
::
share
(
device_monolithic_pre
->
create_submatrix
(
block_v_span
,
block_v_span
)
)
)
);
}
else
if
(
velocityPreconditionerType_
==
3
)
{
b_pre_v
=
gko
::
share
(
gko
::
matrix
::
Identity
<
valueType
>::
create
(
solver_exec_
,
gko
::
dim
<
2
>
(
block_v_span
.
length
(),
block_v_span
.
length
()
)
)
);
}
else
{
WALBERLA_ABORT
(
"Invalid velocity preconditioner for Ginkgo block preconditioner solver."
);
...
...
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