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