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
1b0f8e5c
Commit
1b0f8e5c
authored
10 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
python : add petsc4py optional dependency to allow direct access to
petsc matrices
parent
e5185a00
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+13
-0
13 additions, 0 deletions
CMakeLists.txt
Common/GmshConfig.h.in
+1
-0
1 addition, 0 deletions
Common/GmshConfig.h.in
Solver/linearSystemPETSc.h
+1
-1
1 addition, 1 deletion
Solver/linearSystemPETSc.h
wrappers/gmshpy/gmshSolver.i
+3
-0
3 additions, 0 deletions
wrappers/gmshpy/gmshSolver.i
with
18 additions
and
1 deletion
CMakeLists.txt
+
13
−
0
View file @
1b0f8e5c
...
@@ -63,6 +63,7 @@ opt(MUMPS "Enable MUMPS sparse direct linear solver" OFF)
...
@@ -63,6 +63,7 @@ opt(MUMPS "Enable MUMPS sparse direct linear solver" OFF)
opt
(
NATIVE_FILE_CHOOSER
"Enable native file chooser in GUI"
${
DEFAULT
}
)
opt
(
NATIVE_FILE_CHOOSER
"Enable native file chooser in GUI"
${
DEFAULT
}
)
opt
(
NETGEN
"Enable Netgen 3D frontal mesh generator"
${
DEFAULT
}
)
opt
(
NETGEN
"Enable Netgen 3D frontal mesh generator"
${
DEFAULT
}
)
opt
(
NUMPY
"Enable conversion between fullMatrix and numpy array (requires SWIG)"
OFF
)
opt
(
NUMPY
"Enable conversion between fullMatrix and numpy array (requires SWIG)"
OFF
)
opt
(
PETSC4PY
"Enable petsc4py wrappers for petsc matrices"
ON
)
opt
(
OCC
"Enable Open CASCADE geometrical models"
${
DEFAULT
}
)
opt
(
OCC
"Enable Open CASCADE geometrical models"
${
DEFAULT
}
)
opt
(
ONELAB
"Enable ONELAB solver interface"
${
DEFAULT
}
)
opt
(
ONELAB
"Enable ONELAB solver interface"
${
DEFAULT
}
)
opt
(
ONELAB2
"Enable experimental ONELAB-Cloud solver interface"
OFF
)
opt
(
ONELAB2
"Enable experimental ONELAB-Cloud solver interface"
OFF
)
...
@@ -1120,6 +1121,18 @@ if(HAVE_PYTHON)
...
@@ -1120,6 +1121,18 @@ if(HAVE_PYTHON)
set_config_option
(
HAVE_NUMPY
"Numpy"
)
set_config_option
(
HAVE_NUMPY
"Numpy"
)
endif
(
NUMPY_INC
)
endif
(
NUMPY_INC
)
endif
(
ENABLE_NUMPY
)
endif
(
ENABLE_NUMPY
)
if
(
HAVE_PETSC
)
if
(
ENABLE_PETSC4PY
)
EXEC_PROGRAM
(
${
PYTHON_EXECUTABLE
}
ARGS
"-c
\"
import petsc4py; print(petsc4py.get_include())
\"
"
OUTPUT_VARIABLE PETSC4PY_INC
RETURN_VALUE PETSC4PY_NOT_FOUND
)
if
(
PETSC4PY_INC
)
list
(
APPEND EXTERNAL_INCLUDES
${
PETSC4PY_INC
}
)
set_config_option
(
HAVE_PETSC4PY
"PETSc4py"
)
endif
(
PETSC4PY_INC
)
endif
(
ENABLE_PETSC4PY
)
endif
(
HAVE_PETSC
)
endif
(
HAVE_PYTHON
)
endif
(
HAVE_PYTHON
)
check_function_exists
(
vsnprintf HAVE_VSNPRINTF
)
check_function_exists
(
vsnprintf HAVE_VSNPRINTF
)
...
...
This diff is collapsed.
Click to expand it.
Common/GmshConfig.h.in
+
1
−
0
View file @
1b0f8e5c
...
@@ -54,6 +54,7 @@
...
@@ -54,6 +54,7 @@
#cmakedefine HAVE_OSMESA
#cmakedefine HAVE_OSMESA
#cmakedefine HAVE_PARSER
#cmakedefine HAVE_PARSER
#cmakedefine HAVE_PETSC
#cmakedefine HAVE_PETSC
#cmakedefine HAVE_PETSC4PY
#cmakedefine HAVE_PLUGINS
#cmakedefine HAVE_PLUGINS
#cmakedefine HAVE_POST
#cmakedefine HAVE_POST
#cmakedefine HAVE_POPPLER
#cmakedefine HAVE_POPPLER
...
...
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.h
+
1
−
1
View file @
1b0f8e5c
...
@@ -114,7 +114,7 @@ class linearSystemPETSc : public linearSystem<scalar> {
...
@@ -114,7 +114,7 @@ class linearSystemPETSc : public linearSystem<scalar> {
void
zeroSolution
();
void
zeroSolution
();
void
printMatlab
(
const
char
*
filename
)
const
;
void
printMatlab
(
const
char
*
filename
)
const
;
virtual
int
systemSolve
();
virtual
int
systemSolve
();
Mat
&
getMatrix
(){
return
_a
;
}
Mat
getMatrix
(){
return
_a
;
}
//std::vector<scalar> getData();
//std::vector<scalar> getData();
//std::vector<int> getRowPointers();
//std::vector<int> getRowPointers();
//std::vector<int> getColumnsIndices();
//std::vector<int> getColumnsIndices();
...
...
This diff is collapsed.
Click to expand it.
wrappers/gmshpy/gmshSolver.i
+
3
−
0
View file @
1b0f8e5c
...
@@ -36,6 +36,9 @@
...
@@ -36,6 +36,9 @@
%
include
"
linearSystemFull.h
"
%
include
"
linearSystemFull.h
"
%
template
(
linearSystemFullDouble
)
linearSystemFull
<
double
>
;
%
template
(
linearSystemFullDouble
)
linearSystemFull
<
double
>
;
#
if
defined
(
HAVE_PETSC
)
#
if
defined
(
HAVE_PETSC
)
#
if
defined
(
HAVE_PETSC4PY
)
%
include
petsc4py
/
petsc4py
.
i
#
endif
%
include
"
linearSystemPETSc.h
"
%
include
"
linearSystemPETSc.h
"
%
template
(
linearSystemPETScDouble
)
linearSystemPETSc
<
double
>
;
%
template
(
linearSystemPETScDouble
)
linearSystemPETSc
<
double
>
;
%
template
(
linearSystemPETScBlockDouble
)
linearSystemPETSc
<
fullMatrix
<
double
>
>
;
%
template
(
linearSystemPETScBlockDouble
)
linearSystemPETSc
<
fullMatrix
<
double
>
>
;
...
...
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