Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hyteg
hyteg
Commits
55ce7281
Commit
55ce7281
authored
Aug 16, 2021
by
Marcel Koch
Browse files
keep a matrix copy in the dirichlet handler
parent
2ecaba3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hyteg/ginkgo/GinkgoCGSolver.hpp
View file @
55ce7281
...
...
@@ -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 ) );
...
...
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