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
iwr
amdis
Commits
8b3e2168
Commit
8b3e2168
authored
Nov 11, 2014
by
Praetorius, Simon
Browse files
Pfc preconditioner updated for petsc>3.5
parent
a13af864
Changes
2
Hide whitespace changes
Inline
Side-by-side
extensions/preconditioner/PetscSolverPfc.cc
View file @
8b3e2168
...
...
@@ -77,7 +77,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
if
(
getInfo
()
>=
10
)
KSPMonitorSet
(
ksp
,
KSPMonitorDefault
,
PETSC_NULL
,
PETSC_NULL
);
else
if
(
getInfo
()
>=
20
)
...
...
extensions/preconditioner/PetscSolverPfc_diag.cc
View file @
8b3e2168
...
...
@@ -76,7 +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
if
(
getInfo
()
>=
10
)
KSPMonitorSet
(
ksp
,
KSPMonitorDefault
,
PETSC_NULL
,
PETSC_NULL
);
else
if
(
getInfo
()
>=
20
)
...
...
@@ -162,7 +166,12 @@ namespace AMDiS { namespace Parallel {
MatAXPY
(
matS
,
(
-
2.0
*
delta
),
data
.
matK
,
DIFFERENT_NONZERO_PATTERN
);
// S = S - 2*sqrt(delta)*K
VecDestroy
(
&
x
);
MatDestroy
(
&
DK
);
#if (PETSC_VERSION_MINOR >= 5)
KSPSetOperators
(
data
.
kspS
,
matS
,
matS
);
#else
KSPSetOperators
(
data
.
kspS
,
matS
,
matS
,
SAME_NONZERO_PATTERN
);
#endif
// === Setup preconditioner data ===
data
.
delta
=
delta
;
...
...
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