[petsc-users] Getting DMDA local coordinates

Jed Brown jedbrown at mcs.anl.gov
Mon Oct 21 08:13:40 CDT 2013


Åsmund Ervik <asmund.ervik at ntnu.no> writes:

> On 21. okt. 2013 14:42, Jed Brown wrote:
>> 
>> The coordinates live in a different space than the DM.  Why is it
>> illogical to use the coordinate DM to access coordinate vectors?  It is
>> used in several examples, though none of them in Fortran.
>> 
>
> I guess it is logical for e.g. unstructured meshes or finite elements,
> but for someone like me who just wants 2/4/9 real numbers, it seems a
> bit overkill to have another DM.

It would be reasonable to offer DMDAGetUniformCoordinates() and
DMDAGetUniformCoordinatesLocal() that would return your few numbers.

> I am actually talking about that 2-variable ODE. We use it as a test
> problem in several of our codes, since it is stiff and has some
> "structure", but is much simpler than Euler or Navier-Stokes. In my
> example I "distribute" it so that we solve the same equation at all grid
> points on all processors, using the same code as a PDE solver but with a
> different RHS.

Okay, but this has no spatial derivatives?

> I don't know whether the pattern we use is common or not, so I'll submit
> a pull request and then you can see if you think this is useful for
> others. Another option would be an example solving full-blown
> Navier-Stokes (single phase), but that would take some more work, and I
> don't know when I'll have time for that.

Whatever you like.  Note that there are already some related examples in
src/ts/examples/tutorials/advection-diffusion-reaction/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131021/a1b9e116/attachment.pgp>


More information about the petsc-users mailing list