[petsc-users] petsc4py, cython
Jaroslaw Piwonski (CAU)
jpi at informatik.uni-kiel.de
Tue Jan 30 08:07:34 CST 2018
Dear Lisandro,
> Am 18.01.2018 um 17:13 schrieb Lisandro Dalcin <dalcinl at gmail.com>:
>
> In Cython code using C types from petsc4py, you should do:
>
> from petsc4py.PETSc cimport Vec, PetscVec
> from petsc4py.PETSc cimport Mat, PetscMat
> # etcetera
>
> now you can "cdef" either "PetscVec" (the low-level PETSc C type) and
> "Vec" (the higher-level petsc4py Python type)
>
> Or you can just
>
> from petsc4py.PETSc cimport *
>
> to get all definitions, or even
>
> from petsc4py cimport PETSc
>
> then use properly-namespaced definitions "PETSc.PetscVec" (C type) and
> "PETSc.Vec" (Python type).
thank you! That was the missing link. Great!
Best regards,
Jaroslaw
>
>
> --
> Lisandro Dalcin
> ============
> Research Scientist
> Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
> Extreme Computing Research Center (ECRC)
> King Abdullah University of Science and Technology (KAUST)
> http://ecrc.kaust.edu.sa/
>
> 4700 King Abdullah University of Science and Technology
> al-Khawarizmi Bldg (Bldg 1), Office # 0109
> Thuwal 23955-6900, Kingdom of Saudi Arabia
> http://www.kaust.edu.sa
>
> Office Phone: +966 12 808-0459
—
Dr. Jaroslaw Piwonski
Christian-Albrechts-Universität zu Kiel
Institut für Informatik
Algorithmische Optimale Steuerung — CO2-Aufnahme des Meeres
Christian-Albrechts-Platz 4
24118 Kiel
Telefon: +49 431 880-7452
Telefax: +49 431 880-7618
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180130/62e2d43c/attachment-0001.html>
More information about the petsc-users
mailing list