Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_numerics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_numerics
Commits
43a521cb
Commit
43a521cb
authored
7 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
PETSC working version
parent
ae9f1ceb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Solvers/petsc_solver.hpp
+11
-2
11 additions, 2 deletions
src/Solvers/petsc_solver.hpp
src/Vector/Vector_petsc.hpp
+5
-5
5 additions, 5 deletions
src/Vector/Vector_petsc.hpp
with
16 additions
and
7 deletions
src/Solvers/petsc_solver.hpp
+
11
−
2
View file @
43a521cb
...
...
@@ -21,7 +21,6 @@
#define UMFPACK_NONE 0
template
<
typename
T
>
class
petsc_solver
{
...
...
@@ -600,7 +599,7 @@ class petsc_solver<double>
// We set the pre-conditioner
PETSC_SAFE_CALL
(
KSPGetPC
(
ksp
,
&
pc
));
PETSC_SAFE_CALL
(
PCSetType
(
pc
,
PC
JACOBI
));
PETSC_SAFE_CALL
(
PCSetType
(
pc
,
PC
NONE
));
// if we are on on best solve set-up a monitor function
...
...
@@ -783,6 +782,16 @@ public:
try_solve
=
true
;
}
/*! \brief Set the Petsc solver
*
* \see KSPType in PETSC manual for a list of all PETSC solvers
*
*/
void
log_monitor
()
{
PetscOptionsSetValue
(
"-ksp_monitor"
,
0
);
}
/*! \brief Set the Petsc solver
*
* \see KSPType in PETSC manual for a list of all PETSC solvers
...
...
This diff is collapsed.
Click to expand it.
src/Vector/Vector_petsc.hpp
+
5
−
5
View file @
43a521cb
...
...
@@ -86,7 +86,7 @@ class Vector<T,PETSC_BASE>
mutable
Vec
v
;
// Mutable row value vector
mutable
openfpm
::
vector
<
rval
<
T
,
PETSC_RVAL
>
,
HeapMemory
,
typename
memory_traits_inte
<
rval
<
T
,
PETSC_RVAL
>>::
type
>
row_val
;
mutable
openfpm
::
vector
<
rval
<
PetscScalar
,
PETSC_RVAL
>
,
HeapMemory
,
typename
memory_traits_inte
<
rval
<
PetscScalar
,
PETSC_RVAL
>>::
type
>
row_val
;
// Global to local map
mutable
std
::
unordered_map
<
size_t
,
size_t
>
map
;
...
...
@@ -210,7 +210,7 @@ public:
* \return reference to the element vector
*
*/
inline
T
&
insert
(
size_t
i
)
inline
PetscScalar
&
insert
(
size_t
i
)
{
row_val
.
add
();
...
...
@@ -228,7 +228,7 @@ public:
* \return reference to the element vector
*
*/
inline
const
T
&
insert
(
size_t
i
)
const
inline
const
PetscScalar
&
insert
(
size_t
i
)
const
{
row_val
.
add
();
...
...
@@ -248,7 +248,7 @@ public:
* \return reference to the element vector
*
*/
const
T
&
operator
()(
size_t
i
)
const
const
PetscScalar
&
operator
()(
size_t
i
)
const
{
// Search if exist
...
...
@@ -269,7 +269,7 @@ public:
* \return reference to the element vector
*
*/
T
&
operator
()(
size_t
i
)
PetscScalar
&
operator
()(
size_t
i
)
{
// Search if exist
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment