Commit 55ce7281 authored by Marcel Koch's avatar Marcel Koch
Browse files

keep a matrix copy in the dirichlet handler

parent 2ecaba3e
......@@ -38,10 +38,10 @@ class DirichletHandlerBase
using vec = gko::distributed::Vector< real_t >;
using mtx = gko::distributed::Matrix< real_t, int32_t >;
DirichletHandlerBase( std::vector< int32_t > bcIndices, const vec* dir_vals, mtx* matrix, bool doUpdate = true )
DirichletHandlerBase( std::vector< int32_t > bcIndices, const vec* dir_vals, std::shared_ptr<mtx> matrix, bool doUpdate = true )
: bcIndices_( std::move( bcIndices ) )
, dir_vals_( dir_vals )
, matrix_( matrix )
, matrix_( std::move(matrix) )
, doUpdate_( doUpdate )
{}
......@@ -57,7 +57,7 @@ class DirichletHandlerBase
std::vector< int32_t > bcIndices_;
const vec* dir_vals_;
mtx* matrix_;
std::shared_ptr<mtx> matrix_;
bool doUpdate_;
};
......@@ -384,11 +384,11 @@ class GinkgoCGSolver : public Solver< OperatorType >
std::unique_ptr< DirichletHandlerBase > dir_handler;
if ( constraints_type_ == constraints::penalty )
{
dir_handler = std::make_unique< PeneltyDirichletHandler >( bcIndices, b_vec.get(), matrix_.get(), doAssemble );
dir_handler = std::make_unique< PeneltyDirichletHandler >( bcIndices, b_vec.get(), matrix_, doAssemble );
}
else if ( constraints_type_ == constraints::zero_row )
{
dir_handler = std::make_unique< ZeroRowsDirichletHandler >( bcIndices, b_vec.get(), matrix_.get(), doAssemble );
dir_handler = std::make_unique< ZeroRowsDirichletHandler >( bcIndices, b_vec.get(), matrix_, doAssemble );
}
else
{
......@@ -408,7 +408,7 @@ class GinkgoCGSolver : public Solver< OperatorType >
x.getStorage()->getTimingTree()->start( "Ginkgo CG Solver Set-Up" );
auto host_matrix = matrix_;
matrix_ = mtx::create( solver_exec_ );
host_matrix->move_to( gko::lend( matrix_ ) );
host_matrix->convert_to( gko::lend( matrix_ ) );
//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( gko::share( par_ilu ) );
......
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