[petsc-users] using DMDA with python

Matthew Knepley knepley at gmail.com
Wed Oct 5 09:39:21 CDT 2016


On Tue, Oct 4, 2016 at 9:47 PM, Somdeb Bandopadhyay <sb020287 at gmail.com>
wrote:

> Hi again,
>        Please allow me to explain in detail here:-
>
>    1. I am using Zang's (jcp 1994) method for incompressible flow on
>    generalized collocated grid.
>    2. The main difference lies on the calculation of the grid matrix, for
>    which I am using Gaitonde et al (2002)'s work
>    3. I want to use python to set up the domain , grid(structured) and
>    boundary/initial conditions.
>    4. I want petsc to a) decompose the domain with dmda b) use ksp for
>    linear solver.
>
>
> I * have not* used petsc4py rigorously , so before trying his venture I
> wnt to know whether it is feasible or not, and if there is any example for
> similar work (so that I can copy their approach, to be precise)
>

It sounds like you want to use DMDA in the same way we suggest in the
tutorials. In particular, Lisandro has
a Poisson tutorial that does everything you want I believe (except multiple
fields which is straightforward).

  Thanks,

    Matt


> Have a very good day.
>
> Somdeb
>
> On Wed, Oct 5, 2016 at 10:23 AM, Somdeb Bandopadhyay <sb020287 at gmail.com>
> wrote:
>
>> Hi again Sir,
>>              Thank you very much for the quick response. I am planning to
>> implement a mustiphase algorithm on collocated grid. I already qrote a C
>> code for 2d case, but it wasn't very generalized . So for the final
>> version, I intend to use python as a script to interact with PETSc kernels.
>>
>> Somdeb
>>
>>
>> On Wed, Oct 5, 2016 at 10:12 AM, Matthew Knepley <knepley at gmail.com>
>> wrote:
>>
>>> On Tue, Oct 4, 2016 at 9:02 PM, Somdeb Bandopadhyay <sb020287 at gmail.com>
>>> wrote:
>>>
>>>> Dear all,
>>>>             I want to write a solver for incompressible navier stokes
>>>> using python and I want to use PETsc (particularly dmda & ksp) for this.
>>>> May I know if this type of work is feasible/already done?
>>>>
>>>
>>> How do you plan to discretize your system? DMDA supports only
>>> collocation discretizations, so some sort of penalty for pressure would
>>> have to be employed.
>>>
>>>   Thanks,
>>>
>>>      Matt
>>>
>>>
>>>>             I intend to run my solver in a cluster and so am slightly
>>>> concerned about the performance if I use python with petsc.
>>>>             My deepest apologies if this mail of mine caused you any
>>>> inconvenience.
>>>>
>>>> Somdeb
>>>>
>>>
>>>
>>>
>>> --
>>> 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
>>>
>>
>>
>


-- 
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-users/attachments/20161005/13463902/attachment.html>


More information about the petsc-users mailing list