Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gregor.olenik
OGL
Commits
bee34ac8
Commit
bee34ac8
authored
Apr 10, 2021
by
Gregor Olenik
Browse files
Fix IR solver
- initialize IR with CG - remove BJ for now
parent
36ced784
Changes
1
Hide whitespace changes
Inline
Side-by-side
lduMatrix/GKOIR/GKOIR.H
View file @
bee34ac8
...
...
@@ -38,12 +38,12 @@ class GKOIRFactory {
private:
// executor where Ginkgo will perform the computation
const
word
preconditione
r_
;
const
scalar
inner_reduction_facto
r_
;
public:
GKOIRFactory
(
const
dictionary
&
controlDict_
)
:
preconditioner_
(
controlDict_
.
lookupOrDefault
(
"preconditioner"
,
word
(
"none"
))){};
:
inner_reduction_factor_
(
controlDict_
.
lookupOrDefault
(
"innerReductionFactor"
,
scalar
(
1e-2
))){};
std
::
unique_ptr
<
gko
::
solver
::
Ir
<
double
>::
Factory
,
std
::
default_delete
<
gko
::
solver
::
Ir
<
double
>::
Factory
>>
...
...
@@ -52,9 +52,7 @@ public:
std
::
vector
<
std
::
shared_ptr
<
const
gko
::
stop
::
CriterionFactory
>>
criterion_vec
)
const
{
if
(
preconditioner_
==
"none"
)
return
create_default
(
exec
,
criterion_vec
);
if
(
preconditioner_
==
"BJ"
)
return
create_BJ
(
exec
,
criterion_vec
);
return
create_default
(
exec
,
criterion_vec
);
};
std
::
unique_ptr
<
gko
::
solver
::
Ir
<
double
>::
Factory
,
...
...
@@ -65,17 +63,13 @@ public:
criterion_vec
)
const
{
return
gko
::
solver
::
Ir
<
scalar
>::
build
()
.
with_criteria
(
criterion_vec
)
.
on
(
exec
);
};
std
::
unique_ptr
<
gko
::
solver
::
Ir
<
double
>::
Factory
,
std
::
default_delete
<
gko
::
solver
::
Ir
<
double
>::
Factory
>>
create_BJ
(
std
::
shared_ptr
<
gko
::
Executor
>
exec
,
std
::
vector
<
std
::
shared_ptr
<
const
gko
::
stop
::
CriterionFactory
>>
criterion_vec
)
const
{
return
gko
::
solver
::
Ir
<
scalar
>::
build
()
.
with_solver
(
gko
::
solver
::
Cg
<
scalar
>::
build
()
.
with_criteria
(
gko
::
stop
::
ResidualNorm
<
scalar
>::
build
()
.
with_reduction_factor
(
inner_reduction_factor_
)
.
on
(
exec
))
.
on
(
exec
))
.
with_criteria
(
criterion_vec
)
.
on
(
exec
);
};
...
...
@@ -108,7 +102,7 @@ public:
const
lduInterfaceFieldPtrsList
&
interfaces
,
const
dictionary
&
solverControls
)
:
GKOlduBaseSolver
(
fieldName
,
matrix
,
interfaceBouCoeffs
,
interfaceIntCoeffs
,
interfaces
,
solverControls
){};
interfaceIntCoeffs
,
interfaces
,
solverControls
){};
//- Destructor
virtual
~
GKOIR
(){};
...
...
Write
Preview
Supports
Markdown
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