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
Backofen, Rainer
amdis
Commits
329c0fb9
Commit
329c0fb9
authored
Oct 27, 2016
by
Praetorius, Simon
Browse files
small error in petsc helpers corrected
parent
5f059f08
Changes
8
Show whitespace changes
Inline
Side-by-side
AMDiS/src/parallel/PetscSolver.cc
View file @
329c0fb9
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include
"parallel/MeshDistributor.h"
#include
"parallel/MeshDistributor.h"
#include
"parallel/MpiHelper.h"
#include
"parallel/MpiHelper.h"
#include
"parallel/ParallelDofMapping.h"
#include
"parallel/ParallelDofMapping.h"
#include
"parallel/PetscHelper.h"
#include
"parallel/PetscSolver.h"
#include
"parallel/PetscSolver.h"
#include
"parallel/StdMpi.h"
#include
"parallel/StdMpi.h"
...
...
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc
View file @
329c0fb9
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include
"parallel/PetscSolverGlobalBlockMatrix.h"
#include
"parallel/PetscSolverGlobalBlockMatrix.h"
#include
"parallel/PetscHelper.h"
#include
"parallel/StdMpi.h"
#include
"parallel/StdMpi.h"
#include
"parallel/MpiHelper.h"
#include
"parallel/MpiHelper.h"
...
...
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
View file @
329c0fb9
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
// #include "DirichletBC.h"
// #include "DirichletBC.h"
#include
"DOFVector.h"
#include
"DOFVector.h"
#include
"parallel/PetscSolverGlobalMatrix.h"
#include
"parallel/PetscSolverGlobalMatrix.h"
#include
"parallel/PetscHelper.h"
#include
"parallel/StdMpi.h"
#include
"parallel/StdMpi.h"
#include
"parallel/MpiHelper.h"
#include
"parallel/MpiHelper.h"
#include
"solver/PetscTypes.h"
#include
"solver/PetscTypes.h"
...
...
AMDiS/src/parallel/PetscSolverSchur.cc
View file @
329c0fb9
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include
"parallel/PetscSolverSchur.h"
#include
"parallel/PetscSolverSchur.h"
#include
"parallel/PetscHelper.h"
#include
"parallel/StdMpi.h"
#include
"parallel/StdMpi.h"
#include
"parallel/MpiHelper.h"
#include
"parallel/MpiHelper.h"
...
...
extensions/demo/cahn_hilliard/src/PetscSolverCahnHilliard_DD.cc
View file @
329c0fb9
...
@@ -68,11 +68,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -68,11 +68,7 @@ namespace AMDiS { namespace Parallel {
/// create new solver for S
/// create new solver for S
KSP
kspS
;
KSP
kspS
;
KSPCreate
(
*
data
->
mpiCommGlobal
,
&
kspS
);
KSPCreate
(
*
data
->
mpiCommGlobal
,
&
kspS
);
#if (PETSC_VERSION_MINOR >= 5)
petsc
::
ksp_set_operators
(
kspS
,
S
,
S
);
KSPSetOperators
(
kspS
,
S
,
S
);
#else
KSPSetOperators
(
kspS
,
S
,
S
,
SAME_NONZERO_PATTERN
);
#endif
petsc_helper
::
setSolver
(
kspS
,
"S_"
,
KSPFGMRES
,
PCSHELL
,
1e-6
,
1e-8
,
5
);
petsc_helper
::
setSolver
(
kspS
,
"S_"
,
KSPFGMRES
,
PCSHELL
,
1e-6
,
1e-8
,
5
);
{
{
PC
pc
;
PC
pc
;
...
@@ -118,15 +114,11 @@ namespace AMDiS { namespace Parallel {
...
@@ -118,15 +114,11 @@ namespace AMDiS { namespace Parallel {
MSG
(
"CREATE POS 1: %p
\n
"
,
&
ksp
);
MSG
(
"CREATE POS 1: %p
\n
"
,
&
ksp
);
KSPCreate
(
domainComm
,
&
ksp
);
KSPCreate
(
domainComm
,
&
ksp
);
#if (PETSC_VERSION_MINOR >= 5)
petsc
::
ksp_set_operators
(
ksp
,
getMatInterior
(),
getMatInterior
());
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
());
#else
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
(),
SAME_NONZERO_PATTERN
);
#endif
if
(
getInfo
()
>=
10
)
if
(
getInfo
()
>=
10
)
KSPM
onitor
S
et
(
ksp
,
KSPMonitorDefault
,
PETSC_NULL
,
PETSC_NULL
);
petsc
::
ksp_m
onitor
_s
et
(
ksp
,
KSPMonitorDefault
);
else
if
(
getInfo
()
>=
20
)
else
if
(
getInfo
()
>=
20
)
KSPM
onitor
S
et
(
ksp
,
KSPMonitorTrueResidualNorm
,
PETSC_NULL
,
PETSC_NULL
);
petsc
::
ksp_m
onitor
_s
et
(
ksp
,
KSPMonitorTrueResidualNorm
);
petsc_helper
::
setSolver
(
ksp
,
"ch_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
petsc_helper
::
setSolver
(
ksp
,
"ch_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
if
(
useOldInitialGuess
)
if
(
useOldInitialGuess
)
...
...
extensions/preconditioner/PetscSolverNavierStokes2.cc
View file @
329c0fb9
...
@@ -133,15 +133,11 @@ namespace AMDiS { namespace Parallel {
...
@@ -133,15 +133,11 @@ namespace AMDiS { namespace Parallel {
{
{
// Create FGMRES based outer solver
// Create FGMRES based outer solver
KSPCreate
(
domainComm
,
&
ksp
);
KSPCreate
(
domainComm
,
&
ksp
);
#if (PETSC_VERSION_MINOR >= 5)
petsc
::
ksp_set_operators
(
ksp
,
getMatInterior
(),
getMatInterior
());
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
());
#else
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
(),
SAME_NONZERO_PATTERN
);
#endif
if
(
getInfo
()
>=
10
)
if
(
getInfo
()
>=
10
)
KSPM
onitor
S
et
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorDefault
),
PETSC_NULL
,
PETSC_NULL
);
petsc
::
ksp_m
onitor
_s
et
(
ksp
,
KSPMonitorDefault
);
else
if
(
getInfo
()
>=
20
)
else
if
(
getInfo
()
>=
20
)
KSPM
onitor
S
et
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorTrueResidualNorm
)
,
PETSC_NULL
,
PETSC_NULL
)
;
petsc
::
ksp_m
onitor
_s
et
(
ksp
,
KSPMonitorTrueResidualNorm
);
petsc_helper
::
setSolver
(
ksp
,
"ns_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
petsc_helper
::
setSolver
(
ksp
,
"ns_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
// Create null space information.
// Create null space information.
...
...
extensions/preconditioner/PetscSolverPfc.cc
View file @
329c0fb9
...
@@ -78,15 +78,11 @@ namespace AMDiS { namespace Parallel {
...
@@ -78,15 +78,11 @@ namespace AMDiS { namespace Parallel {
{
{
// Create FGMRES based outer solver
// Create FGMRES based outer solver
KSPCreate
(
meshDistributor
->
getMpiComm
(
0
),
&
ksp
);
KSPCreate
(
meshDistributor
->
getMpiComm
(
0
),
&
ksp
);
#if (PETSC_VERSION_MINOR >= 5)
petsc
::
ksp_set_operators
(
ksp
,
getMatInterior
(),
getMatInterior
());
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
());
#else
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
(),
SAME_NONZERO_PATTERN
);
#endif
if
(
getInfo
()
>=
10
)
if
(
getInfo
()
>=
10
)
KSPM
onitor
S
et
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorDefault
),
PETSC_NULL
,
PETSC_NULL
);
petsc
::
ksp_m
onitor
_s
et
(
ksp
,
KSPMonitorDefault
);
else
if
(
getInfo
()
>=
20
)
else
if
(
getInfo
()
>=
20
)
KSPM
onitor
S
et
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorTrueResidualNorm
)
,
PETSC_NULL
,
PETSC_NULL
)
;
petsc
::
ksp_m
onitor
_s
et
(
ksp
,
KSPMonitorTrueResidualNorm
);
petsc_helper
::
setSolver
(
ksp
,
"pfc_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
petsc_helper
::
setSolver
(
ksp
,
"pfc_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
KSPSetFromOptions
(
ksp
);
KSPSetFromOptions
(
ksp
);
...
...
extensions/preconditioner/PetscSolverPfc_diag.cc
View file @
329c0fb9
...
@@ -76,15 +76,11 @@ namespace AMDiS { namespace Parallel {
...
@@ -76,15 +76,11 @@ namespace AMDiS { namespace Parallel {
{
{
// Create FGMRES based outer solver
// Create FGMRES based outer solver
KSPCreate
(
meshDistributor
->
getMpiComm
(
0
),
&
ksp
);
KSPCreate
(
meshDistributor
->
getMpiComm
(
0
),
&
ksp
);
#if (PETSC_VERSION_MINOR >= 5)
petsc
::
ksp_set_operators
(
ksp
,
getMatInterior
(),
getMatInterior
());
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
());
#else
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
(),
SAME_NONZERO_PATTERN
);
#endif
if
(
getInfo
()
>=
10
)
if
(
getInfo
()
>=
10
)
KSPM
onitor
S
et
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorDefault
),
PETSC_NULL
,
PETSC_NULL
);
petsc
::
ksp_m
onitor
_s
et
(
ksp
,
KSPMonitorDefault
);
else
if
(
getInfo
()
>=
20
)
else
if
(
getInfo
()
>=
20
)
KSPM
onitor
S
et
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorTrueResidualNorm
)
,
PETSC_NULL
,
PETSC_NULL
)
;
petsc
::
ksp_m
onitor
_s
et
(
ksp
,
KSPMonitorTrueResidualNorm
);
petsc_helper
::
setSolver
(
ksp
,
"pfc_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
petsc_helper
::
setSolver
(
ksp
,
"pfc_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
KSPSetFromOptions
(
ksp
);
KSPSetFromOptions
(
ksp
);
...
@@ -167,11 +163,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -167,11 +163,7 @@ namespace AMDiS { namespace Parallel {
VecDestroy
(
&
x
);
VecDestroy
(
&
x
);
MatDestroy
(
&
DK
);
MatDestroy
(
&
DK
);
#if (PETSC_VERSION_MINOR >= 5)
petsc
::
ksp_set_operators
(
data
.
kspS
,
matS
,
matS
);
KSPSetOperators
(
data
.
kspS
,
matS
,
matS
);
#else
KSPSetOperators
(
data
.
kspS
,
matS
,
matS
,
SAME_NONZERO_PATTERN
);
#endif
// === Setup preconditioner data ===
// === Setup preconditioner data ===
data
.
delta
=
delta
;
data
.
delta
=
delta
;
...
...
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