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
69e48ce9
Commit
69e48ce9
authored
Jan 14, 2022
by
Marcel Koch
Browse files
fixup! fix dirichlet handling of initial guess
parent
d61a0109
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hyteg/ginkgo/GinkgoDirichletHandling.hpp
View file @
69e48ce9
#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
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