Commit 4ebba28d authored by Marcel Koch's avatar Marcel Koch
Browse files

fix preconditioner numbering

parent 97c07f31
......@@ -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( 9u )
.with_max_levels( 10u )
.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." );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment