Skip to content
GitLab
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
59d323bb
Commit
59d323bb
authored
Oct 07, 2021
by
Marcel Koch
Browse files
[wip] allow to use only petsc/ginkgo cg solver
parent
50d8406e
Pipeline
#34657
failed with stages
in 11 minutes and 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/2021-tokamak/Tokamak.cpp
View file @
59d323bb
...
...
@@ -322,11 +322,13 @@ void tokamak( TokamakDomain tokamakDomain,
tokamakDomain
.
r1
,
tokamakDomain
.
r2
);
WALBERLA_LOG_INFO_ON_ROOT
(
"[progress] Finished setting up tokamak blending map"
)
const
auto
storage
=
std
::
make_shared
<
PrimitiveStorage
>
(
setupStorage
);
WALBERLA_CHECK
(
storage
->
hasGlobalCells
()
)
const
auto
domainInfo
=
storage
->
getGlobalInfo
();
const
auto
domainInfo
=
storage
->
getGlobalInfo
(
true
);
WALBERLA_LOG_INFO_ON_ROOT
(
domainInfo
)
WALBERLA_LOG_INFO_ON_ROOT
(
"DoFs"
)
...
...
@@ -545,12 +547,48 @@ void tokamak( TokamakDomain tokamakDomain,
if
(
solverSettings
.
solverType
==
CG
)
{
auto
cgSolver
=
std
::
make_shared
<
CGSolver
<
LaplaceOperator_T
>
>
(
storage
,
minLevel
,
maxLevel
);
if
(
solverSettings
.
cgHytegVerbose
)
if
(
solverSettings
.
coarseGridSolverType
==
COARSE_GRID_CG_PETSC
)
{
cgSolver
->
setPrintInfo
(
true
);
const
auto
relativeResidualToleranceCoarseGrid
=
1e-30
;
const
auto
absoluteResidualToleranceCoarseGrid
=
1e-12
;
const
auto
maxIterationsCoarseGrid
=
static_cast
<
PetscInt
>
(
solverSettings
.
maxCoarseGridSolverIterations
);
auto
cgSolver
=
std
::
make_shared
<
PETScCGSolver
<
LaplaceOperator_T
>
>
(
storage
,
minLevel
,
relativeResidualToleranceCoarseGrid
,
absoluteResidualToleranceCoarseGrid
,
maxIterationsCoarseGrid
);
if
(
solverSettings
.
cgHytegVerbose
)
{
cgSolver
->
setPrintInfo
(
true
);
}
solver
=
cgSolver
;
}
else
if
(
solverSettings
.
coarseGridSolverType
==
COARSE_GRID_CG_GINKGO
)
{
auto
exec
=
get_executor
(
solverSettings
.
gkoExecutor
);
if
(
!
exec
)
{
WALBERLA_ABORT
(
"Invalid Ginkgo executor type."
);
}
std
::
ifstream
gko_cfg_file
(
solverSettings
.
gkoConfig
);
rapidjson
::
IStreamWrapper
gko_cfg
(
gko_cfg_file
);
auto
cgSolver
=
std
::
make_shared
<
GinkgoCGSolver
<
LaplaceOperator_T
>
>
(
storage
,
minLevel
,
constraints
::
zero_row
,
exec
,
gko_cfg
);
if
(
solverSettings
.
cgHytegVerbose
)
{
cgSolver
->
setPrintInfo
(
true
);
}
solver
=
cgSolver
;
}
else
{
auto
cgSolver
=
std
::
make_shared
<
CGSolver
<
LaplaceOperator_T
>
>
(
storage
,
minLevel
,
maxLevel
);
if
(
solverSettings
.
cgHytegVerbose
)
{
cgSolver
->
setPrintInfo
(
true
);
}
solver
=
cgSolver
;
}
solver
=
cgSolver
;
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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