Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
bfea95a6
Commit
bfea95a6
authored
11 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
linearSystemPETSc.h remove #include "petsc.h" when building python
bindings (a better solution would be welcome)
parent
23ae4fe3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Solver/linearSystemPETSc.h
+14
-3
14 additions, 3 deletions
Solver/linearSystemPETSc.h
Solver/linearSystemPETSc.hpp
+10
-0
10 additions, 0 deletions
Solver/linearSystemPETSc.hpp
with
24 additions
and
3 deletions
Solver/linearSystemPETSc.h
+
14
−
3
View file @
bfea95a6
...
...
@@ -41,12 +41,17 @@
#include
"fullMatrix.h"
#include
<vector>
#if defined(HAVE_PETSC)
#ifndef SWIG
#include
"petsc.h"
#include
<petscksp.h>
#else
typedef
struct
_p_Mat
*
Mat
;
typedef
struct
_p_Vec
*
Vec
;
typedef
struct
_p_KSP
*
KSP
;
#endif
template
<
class
scalar
>
class
linearSystemPETSc
:
public
linearSystem
<
scalar
>
{
protected:
MPI_Comm
_comm
;
int
_blockSize
;
// for block Matrix
bool
_isAllocated
,
_kspAllocated
,
_entriesPreAllocated
,
_matrixModified
;
Mat
_a
;
...
...
@@ -55,8 +60,10 @@ class linearSystemPETSc : public linearSystem<scalar> {
int
_localRowStart
,
_localRowEnd
,
_localSize
,
_globalSize
;
sparsityPattern
_sparsity
;
void
_kspCreate
();
#ifndef SWIG
MPI_Comm
_comm
;
#endif
public:
linearSystemPETSc
(
MPI_Comm
com
=
PETSC_COMM_WORLD
);
virtual
~
linearSystemPETSc
();
void
insertInSparsityPattern
(
int
i
,
int
j
);
virtual
bool
isAllocated
()
const
{
return
_isAllocated
;
}
...
...
@@ -79,7 +86,11 @@ class linearSystemPETSc : public linearSystem<scalar> {
std
::
vector
<
scalar
>
getData
();
std
::
vector
<
int
>
getRowPointers
();
std
::
vector
<
int
>
getColumnsIndices
();
#ifndef SWIG
linearSystemPETSc
(
MPI_Comm
com
);
MPI_Comm
&
getComm
()
{
return
_comm
;}
#endif
linearSystemPETSc
();
};
class
linearSystemPETScBlockDouble
:
public
linearSystem
<
fullMatrix
<
double
>
>
{
...
...
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.hpp
+
10
−
0
View file @
bfea95a6
...
...
@@ -43,6 +43,16 @@ linearSystemPETSc<scalar>::linearSystemPETSc(MPI_Comm com)
_matrixModified
=
true
;
}
template
<
class
scalar
>
linearSystemPETSc
<
scalar
>::
linearSystemPETSc
()
{
_comm
=
PETSC_COMM_WORLD
;
_isAllocated
=
false
;
_blockSize
=
0
;
_kspAllocated
=
false
;
_matrixModified
=
true
;
}
template
<
class
scalar
>
linearSystemPETSc
<
scalar
>::~
linearSystemPETSc
()
{
...
...
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