Commit 69e48ce9 authored by Marcel Koch's avatar Marcel Koch
Browse files

fixup! fix dirichlet handling of initial guess

parent d61a0109
#pragma once
#include <vector>
#include <optional>
#include <utility>
#include <vector>
#include "ginkgo/core/matrix/csr.hpp"
#include "ginkgo/core/matrix/dense.hpp"
#include "ginkgo/core/distributed/matrix.hpp"
#include "ginkgo/core/distributed/vector.hpp"
#include "ginkgo/core/distributed/partition.hpp"
#include "ginkgo/core/distributed/vector.hpp"
#include "ginkgo/core/matrix/csr.hpp"
#include "ginkgo/core/matrix/dense.hpp"
namespace hyteg {
......@@ -23,7 +23,7 @@ class DirichletHandlerBase
std::shared_ptr< mtx > matrix,
bool doUpdate = true )
: bcIndices_( std::move( bcIndices ) )
, dir_vals_( dir_vals )
, dir_vals_( gko::clone( dir_vals ) )
, matrix_( std::move( matrix ) )
, doUpdate_( doUpdate )
{}
......@@ -38,7 +38,7 @@ class DirichletHandlerBase
protected:
std::vector< int32_t > bcIndices_;
const vec* dir_vals_;
std::unique_ptr< vec > dir_vals_;
std::shared_ptr< mtx > matrix_;
bool doUpdate_;
......@@ -210,12 +210,9 @@ class ZeroRowsDirichletHandler : public DirichletHandlerBase
vec* get_initial_guess( const vec* cur_initial_guess ) override
{
auto rank = this->matrix_->get_communicator()->rank();
auto part = this->matrix_->get_partition();
orig_initial_guess_ = cur_initial_guess;
z_ = gko::clone( cur_initial_guess );
z_->fill(gko::zero<valueType >());
z_->fill( gko::zero< valueType >() );
return z_.get();
}
......@@ -232,4 +229,4 @@ enum class constraints
zero_row
};
}
\ No newline at end of file
} // namespace hyteg
\ No newline at end of file
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