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
697bb39b
Commit
697bb39b
authored
Jan 22, 2019
by
Praetorius, Simon
Browse files
resolve problem after petsc version update
parent
8aa43b17
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/cmake3/target_enable_petsc.cmake
View file @
697bb39b
...
...
@@ -39,7 +39,8 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
$ENV{PETSC_ROOT}/lib/pkgconfig
/usr/lib/petsc/lib/pkgconfig
/usr/lib/petsc/linux-gnu-cxx-opt/lib/pkgconfig
/usr/lib/petsc/linux-gnu-c-opt/lib/pkgconfig
)
/usr/lib/petsc/linux-gnu-c-opt/lib/pkgconfig
PATHS $ENV{PKG_CONFIG_PATH}
)
if
(
PETSC_PKG_CONFIG
)
get_filename_component
(
PETSC_PKG_CONFIG_PATH
"
${
PETSC_PKG_CONFIG
}
"
PATH CACHE
)
set
(
ENV{PKG_CONFIG_PATH}
${
PETSC_PKG_CONFIG_PATH
}
)
...
...
AMDiS/src/parallel/PetscHelper.cc
View file @
697bb39b
...
...
@@ -284,7 +284,7 @@ namespace AMDiS
const
char
*
kspPrefix
,
KSPType
kspType
,
PCType
pcType
,
const
MatSolverPackage
matSolverPackage
,
const
petsc
::
MatSolverPackage
_t
matSolverPackage
,
PetscReal
rtol
,
PetscReal
atol
,
PetscInt
maxIt
)
...
...
@@ -300,7 +300,7 @@ namespace AMDiS
KSPGetPC
(
ksp
,
&
pc
);
PCSetType
(
pc
,
pcType
);
if
(
matSolverPackage
!=
PETSC_NULL
)
PCFactorSetMatS
olver
P
ackage
(
pc
,
matSolverPackage
);
petsc
::
pc_factor_set_mat_s
olver
_p
ackage
(
pc
,
matSolverPackage
);
PCSetFromOptions
(
pc
);
#ifndef NDEBUG
...
...
AMDiS/src/parallel/PetscHelper.h
View file @
697bb39b
...
...
@@ -104,7 +104,7 @@ namespace AMDiS
const
char
*
kspPrefix
,
KSPType
kspType
,
PCType
pcType
,
const
MatSolverPackage
matSolverPackage
,
const
petsc
::
MatSolverPackage
_t
matSolverPackage
,
PetscReal
rtol
=
PETSC_DEFAULT
,
PetscReal
atol
=
PETSC_DEFAULT
,
PetscInt
maxIt
=
PETSC_DEFAULT
);
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
697bb39b
...
...
@@ -31,6 +31,7 @@
#include
"parallel/MpiHelper.h"
#include
"parallel/PetscSolverGlobalMatrix.h"
#include
"io/VtkWriter.h"
#include
"utility/PetscWrapper.h"
namespace
AMDiS
{
namespace
Parallel
{
...
...
@@ -1077,7 +1078,7 @@ namespace AMDiS { namespace Parallel {
PC
pc_schur_primal
;
KSPGetPC
(
ksp_schur_primal
,
&
pc_schur_primal
);
PCSetType
(
pc_schur_primal
,
PCLU
);
PCFactorSetMatS
olver
P
ackage
(
pc_schur_primal
,
MATSOLVERMUMPS
);
petsc
::
pc_factor_set_mat_s
olver
_p
ackage
(
pc_schur_primal
,
MATSOLVERMUMPS
);
KSPSetFromOptions
(
ksp_schur_primal
);
...
...
@@ -1588,10 +1589,10 @@ namespace AMDiS { namespace Parallel {
KSPGetPC
(
ksp_interior
,
&
pc_interior
);
if
(
isSymmetric
)
{
PCSetType
(
pc_interior
,
PCCHOLESKY
);
PCFactorSetMatS
olver
P
ackage
(
pc_interior
,
MATSOLVERMUMPS
);
petsc
::
pc_factor_set_mat_s
olver
_p
ackage
(
pc_interior
,
MATSOLVERMUMPS
);
}
else
{
PCSetType
(
pc_interior
,
PCLU
);
PCFactorSetMatS
olver
P
ackage
(
pc_interior
,
MATSOLVERUMFPACK
);
petsc
::
pc_factor_set_mat_s
olver
_p
ackage
(
pc_interior
,
MATSOLVERUMFPACK
);
}
KSPSetFromOptions
(
ksp_interior
);
...
...
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
View file @
697bb39b
...
...
@@ -26,6 +26,7 @@
#include
"parallel/StdMpi.h"
#include
"parallel/MpiHelper.h"
#include
"solver/PetscTypes.h"
#include
"utility/PetscWrapper.h"
using
namespace
std
;
...
...
@@ -336,13 +337,13 @@ namespace AMDiS { namespace Parallel {
KSPGetPC
(
kspInterior
,
&
pcInterior
);
if
(
isSymmetric
)
{
PCSetType
(
pcInterior
,
PCCHOLESKY
);
PCFactorSetMatS
olver
P
ackage
(
pcInterior
,
MATSOLVERMUMPS
);
petsc
::
pc_factor_set_mat_s
olver
_p
ackage
(
pcInterior
,
MATSOLVERMUMPS
);
}
else
{
PCSetType
(
pcInterior
,
PCLU
);
if
(
localMatrix
)
PCFactorSetMatS
olver
P
ackage
(
pcInterior
,
MATSOLVERUMFPACK
);
petsc
::
pc_factor_set_mat_s
olver
_p
ackage
(
pcInterior
,
MATSOLVERUMFPACK
);
else
PCFactorSetMatS
olver
P
ackage
(
pcInterior
,
MATSOLVERMUMPS
);
petsc
::
pc_factor_set_mat_s
olver
_p
ackage
(
pcInterior
,
MATSOLVERMUMPS
);
}
KSPSetFromOptions
(
kspInterior
);
}
...
...
@@ -469,7 +470,7 @@ namespace AMDiS { namespace Parallel {
MatNullSpaceDestroy
(
&
matNullspace
);
VecDestroy
(
&
nullspaceBasis
);
}
// delete allocated memory
delete
basisVec
;
...
...
@@ -600,7 +601,7 @@ namespace AMDiS { namespace Parallel {
IS
isrow
,
iscol
;
interiorMap
->
createIndexSet
(
isrow
,
startRow
,
numberOfRows
);
interiorMap
->
createIndexSet
(
iscol
,
startCol
,
numberOfCols
);
MatGetSubM
atrix
(
input
,
isrow
,
iscol
,
MAT_INITIAL_MATRIX
,
output
);
petsc
::
mat_get_sub_m
atrix
(
input
,
isrow
,
iscol
,
MAT_INITIAL_MATRIX
,
output
);
ISDestroy
(
&
iscol
);
ISDestroy
(
&
isrow
);
}
...
...
AMDiS/src/utility/PetscWrapper.h
View file @
697bb39b
...
...
@@ -102,6 +102,32 @@ namespace AMDiS
#endif
}
#if (PETSC_VERSION_MINOR >= 9)
using
MatSolverPackage_t
=
MatSolverType
;
inline
PetscErrorCode
pc_factor_set_mat_solver_package
(
PC
pc
,
MatSolverType
stype
)
{
return
PCFactorSetMatSolverType
(
pc
,
stype
);
}
#else
using
MatSolverPackage_t
=
MatSolverPackage
;
inline
PetscErrorCode
pc_factor_set_mat_solver_package
(
PC
pc
,
MatSolverPackage
stype
)
{
return
PCFactorSetMatSolverPackage
(
pc
,
stype
);
}
#endif
#if (PETSC_VERSION_MINOR >= 8)
inline
PetscErrorCode
mat_get_sub_matrix
(
Mat
mat
,
IS
isrow
,
IS
iscol
,
MatReuse
cll
,
Mat
*
newmat
)
{
return
MatCreateSubMatrix
(
mat
,
isrow
,
iscol
,
cll
,
newmat
);
}
#else
inline
PetscErrorCode
mat_get_sub_matrix
(
Mat
mat
,
IS
isrow
,
IS
iscol
,
MatReuse
cll
,
Mat
*
newmat
)
{
return
MatGetSubMatrix
(
mat
,
isrow
,
iscol
,
cll
,
newmat
);
}
#endif
}
// end namespace petsc
}
// end namespace AMDiS
...
...
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