[petsc-dev] petsc4py and DMDA
Matthew Knepley
knepley at gmail.com
Tue Jul 19 21:59:04 CDT 2016
On Tue, Jul 19, 2016 at 11:12 PM, gouarin <loic.gouarin at math.u-psud.fr>
wrote:
> Hi,
>
> I would like to use DMGetLocalVector and DMGetGlobalVector with petsc4py
> but I didn't find the appropriate methods. If they are not implemented, I
> can do a PR with these functions and their Restore part.
>
You are right, these are missing.
> I have an other problem: I have to optimize a Python function that take a
> numpy array given by the function getVecArray of a DMDA and I would like to
> use Pythran to do that. The problem is that Pythran doesn't recognize the
> array as a numpy array because the flags C_CONTIGUOUS and F_CONTIGUOUS are
> both set to False. Is there a reason that the C_CONTIGUOUS flag is set to
> False and not to True ?
>
For this, can't you just use vec.getArray()?
Thanks,
Matt
> Best,
> Loic
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160720/1ecee3f8/attachment.html>
More information about the petsc-dev
mailing list