Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
iwr
amdis
Commits
e92707e7
Commit
e92707e7
authored
Oct 24, 2016
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrected some interface changes in petsc 3.7
parent
24b520f6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
14 deletions
+20
-14
AMDiS/src/parallel/PetscHelper.cc
AMDiS/src/parallel/PetscHelper.cc
+2
-3
AMDiS/src/parallel/PetscHelper.h
AMDiS/src/parallel/PetscHelper.h
+7
-0
AMDiS/src/parallel/PetscSolver.h
AMDiS/src/parallel/PetscSolver.h
+1
-0
AMDiS/src/parallel/PetscSolverCahnHilliard.cc
AMDiS/src/parallel/PetscSolverCahnHilliard.cc
+2
-2
AMDiS/src/parallel/PetscSolverCahnHilliard2.cc
AMDiS/src/parallel/PetscSolverCahnHilliard2.cc
+2
-2
AMDiS/src/parallel/PetscSolverFeti.cc
AMDiS/src/parallel/PetscSolverFeti.cc
+2
-2
AMDiS/src/parallel/PetscSolverNSCH.cc
AMDiS/src/parallel/PetscSolverNSCH.cc
+1
-1
AMDiS/src/parallel/PetscSolverNavierStokes.cc
AMDiS/src/parallel/PetscSolverNavierStokes.cc
+2
-2
AMDiS/src/solver/PetscTypes.h
AMDiS/src/solver/PetscTypes.h
+1
-2
No files found.
AMDiS/src/parallel/PetscHelper.cc
View file @
e92707e7
...
...
@@ -327,7 +327,6 @@ namespace AMDiS
rtol
,
atol
,
maxIt
);
}
void
createSolver
(
MPI
::
Intracomm
comm
,
KSP
&
ksp
,
Mat
m
,
std
::
string
kspPrefix
,
int
info
)
{
KSPCreate
(
comm
,
&
ksp
);
...
...
@@ -341,9 +340,9 @@ namespace AMDiS
KSPSetOptionsPrefix
(
ksp
,
kspPrefix
.
c_str
());
if
(
info
>=
10
)
KSPMonitorSet
(
ksp
,
KSPMonitorDefault
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorDefault
)
,
PETSC_NULL
,
PETSC_NULL
);
else
if
(
info
>=
20
)
KSPMonitorSet
(
ksp
,
KSPMonitorTrueResidualNorm
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorTrueResidualNorm
)
,
PETSC_NULL
,
PETSC_NULL
);
}
}
// end namespace petsc_helper
...
...
AMDiS/src/parallel/PetscHelper.h
View file @
e92707e7
...
...
@@ -31,6 +31,13 @@
#include <petsc.h>
#include "AMDiS_fwd.h"
#if (PETSC_VERSION_MINOR >= 7)
#define PETSC_MONITOR_CAST(...) \
(PetscErrorCode (*)(KSP,PetscInt,PetscReal,void*))(__VA_ARGS__)
#else
#define PETSC_MONITOR_CAST(...) __VA_ARGS__
#endif
namespace
AMDiS
{
namespace
Parallel
...
...
AMDiS/src/parallel/PetscSolver.h
View file @
e92707e7
...
...
@@ -33,6 +33,7 @@
#include "AMDiS_fwd.h"
#include "parallel/ParallelCoarseSpaceSolver.h"
#include "solver/PetscTypes.h"
namespace
AMDiS
{
...
...
AMDiS/src/parallel/PetscSolverCahnHilliard.cc
View file @
e92707e7
...
...
@@ -91,9 +91,9 @@ namespace AMDiS { namespace Parallel {
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
(),
SAME_NONZERO_PATTERN
);
#endif
if
(
getInfo
()
>=
10
)
KSPMonitorSet
(
ksp
,
KSPMonitorDefault
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorDefault
)
,
PETSC_NULL
,
PETSC_NULL
);
else
if
(
getInfo
()
>=
20
)
KSPMonitorSet
(
ksp
,
KSPMonitorTrueResidualNorm
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorTrueResidualNorm
)
,
PETSC_NULL
,
PETSC_NULL
);
petsc_helper
::
setSolver
(
ksp
,
"ch_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
KSPSetFromOptions
(
ksp
);
...
...
AMDiS/src/parallel/PetscSolverCahnHilliard2.cc
View file @
e92707e7
...
...
@@ -123,9 +123,9 @@ namespace AMDiS { namespace Parallel {
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
(),
SAME_NONZERO_PATTERN
);
#endif
if
(
getInfo
()
>=
10
)
KSPMonitorSet
(
ksp
,
KSPMonitorDefault
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorDefault
)
,
PETSC_NULL
,
PETSC_NULL
);
else
if
(
getInfo
()
>=
20
)
KSPMonitorSet
(
ksp
,
KSPMonitorTrueResidualNorm
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorTrueResidualNorm
)
,
PETSC_NULL
,
PETSC_NULL
);
petsc_helper
::
setSolver
(
ksp
,
"ch_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
if
(
useOldInitialGuess
)
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
e92707e7
...
...
@@ -1382,9 +1382,9 @@ namespace AMDiS { namespace Parallel {
Parameters
::
get
(
name
+
"->feti->monitor"
,
monitor
);
if
(
monitor
)
{
if
(
stokesMode
)
KSPMonitorSet
(
ksp_feti
,
KSPMonitorFetiStokes
,
&
fetiKspData
,
PETSC_NULL
);
KSPMonitorSet
(
ksp_feti
,
PETSC_MONITOR_CAST
(
KSPMonitorFetiStokes
)
,
&
fetiKspData
,
PETSC_NULL
);
else
KSPMonitorSet
(
ksp_feti
,
KSPMonitorTrueResidualNorm
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp_feti
,
PETSC_MONITOR_CAST
(
KSPMonitorTrueResidualNorm
)
,
PETSC_NULL
,
PETSC_NULL
);
}
...
...
AMDiS/src/parallel/PetscSolverNSCH.cc
View file @
e92707e7
...
...
@@ -189,7 +189,7 @@ namespace AMDiS { namespace Parallel {
#else
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
(),
SAME_NONZERO_PATTERN
);
#endif
KSPMonitorSet
(
ksp
,
KSPMonitorTrueResidualNorm
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorTrueResidualNorm
)
,
PETSC_NULL
,
PETSC_NULL
);
petsc_helper
::
setSolver
(
ksp
,
"ch_"
,
KSPFGMRES
,
PCSHELL
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
setConstantNullSpace
(
ksp
,
componentSpaces
[
0
]
->
getMesh
()
->
getDim
()
,
true
);
}
...
...
AMDiS/src/parallel/PetscSolverNavierStokes.cc
View file @
e92707e7
...
...
@@ -123,9 +123,9 @@ namespace AMDiS { namespace Parallel {
KSPSetOperators
(
ksp
,
getMatInterior
(),
getMatInterior
(),
SAME_NONZERO_PATTERN
);
#endif
if
(
getInfo
()
>=
10
)
KSPMonitorSet
(
ksp
,
KSPMonitorDefault
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorDefault
)
,
PETSC_NULL
,
PETSC_NULL
);
else
if
(
getInfo
()
>=
20
)
KSPMonitorSet
(
ksp
,
KSPMonitorTrueResidualNorm
,
PETSC_NULL
,
PETSC_NULL
);
KSPMonitorSet
(
ksp
,
PETSC_MONITOR_CAST
(
KSPMonitorTrueResidualNorm
)
,
PETSC_NULL
,
PETSC_NULL
);
petsc_helper
::
setSolver
(
ksp
,
"ns_"
,
KSPFGMRES
,
PCNONE
,
getRelative
(),
getTolerance
(),
getMaxIterations
());
// Create null space information.
...
...
AMDiS/src/solver/PetscTypes.h
View file @
e92707e7
...
...
@@ -31,7 +31,6 @@
#include <petsc.h>
#include <petscmat.h>
#include <petscvec.h>
#include <options.h>
namespace
AMDiS
{
...
...
@@ -145,7 +144,7 @@ namespace AMDiS {
void
operator
>>
(
const
PetscVectorNested
&
dest
,
VecMap
<
SystemVector
,
Mapper
>&
rhs
);
PetscErrorCode
petsc_options_insert_string
(
const
char
in_str
[])
inline
PetscErrorCode
petsc_options_insert_string
(
const
char
in_str
[])
{
#if (PETSC_VERSION_MINOR >= 7)
return
PetscOptionsInsertString
(
NULL
,
in_str
);
...
...
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