[petsc-dev] Add natural-to-global and global-to-natural operations for DM?

Jed Brown jedbrown at mcs.anl.gov
Tue Mar 19 22:38:35 CDT 2013


On Tue, Mar 19, 2013 at 9:54 PM, Richard Tran Mills <rtm at eecs.utk.edu>wrote:

> Hi Barry,
>
> What we call the "natural" ordering in PFLOTRAN is what is referred to as
> the "application" ordering in PETSc parlance.  In the structured grid case
> this "application" ordering is the natural ordering used by the DMDA
> routines like DMDANaturalToGlobalBegin()/**End(), and in the unstructured
> case it is whatever ordering was used to assign cell IDs when the
> unstructured grid was created.  Rather than having code for two cases, I
> would prefer to be able to just call DMNaturalToGlobalBegin()/End() for
> either case.  I do realize, of course, that for the DMDA case there is
> always a default meaning for the "natural" ordering, whereas for the case
> of a general DM the notion of "natural" will be application dependent and
> will have to be specified by user code (which I'd like to do in this case
> by having a DMShellSetNaturalToGlobalVecSc**atter()).
>
> Obviously, there may be subtypes of DM for which no "natural to global"
> operation makes sense.


At the type level, adding something to base DM is an assertion that it
makes sense with all DMs. Even a local space does not strictly make sense
in DM (some problems are dense, in which case the "local" space would be
everything, which is likely a poor representation for the operator).

So I would be reluctant to add the Natural concept since it does not make
sense with all DMs. What do you do with the natural vector coming out of
here? Why is it easier to implement dispatch in DM rather than in your code?


>  What I'm saying is that I nonetheless would like to have a general
> DMNaturalToGlobalBegin()/End() that will do the appropriate thing if it
> makes sense for that DM and complain otherwise.  I guess this is a question
> of what the PETSc philosophy is regarding such things.  I note that there
> is at least one example of a current DMDA method that ought to just be a DM
> one: I don't see why we should have DMDALocalToLocalBegin()/End() and not
> just DMLocalToLocalBegin()/End(), and I'd like to go ahead and change this.
>  But LocalToLocal makes sense for lots of DMs, and NaturalToGlobal may not.
>
> --Richard
>
>
> On 3/7/13 10:51 PM, Barry Smith wrote:
>
>> On Mar 7, 2013, at 9:46 PM, Richard Tran Mills <rtm at eecs.utk.edu> wrote:
>>
>>  Continuing on my quest to be able to wrap all of the unstructured grid
>>> operations in PFLOTRAN inside a DM: Would it be OK to add
>>> DMGlobalToNaturalBegin()/End() and DMNatualToGlobalBegin()/End()? These are
>>> currently DMDA routines, not DM ones.  We do something that we call
>>> natural-to-global and global-to-natural operations with our unstructured
>>> grid cases in PFLOTRAN (though I'm not sure if "natural" is quite the thing
>>> to call it... I always think of that in terms of a structured grid layout).
>>>  I would like to just call DMGlobalToNaturalBegin()/End()**, etc., on
>>> our DM, whether it is a DMDA or a DMShell.
>>>
>>> I had already mentioned that I plan to add DM interface routines for
>>> local-to-local operations.  I am thinking that global-to-natural, etc.,
>>> also ought to be added, though I'm not sure if the concept of "natural"
>>> ordering necessarily makes sense in some cases.
>>>
>>     What does natural mean for you on anything but a DA in what you do
>> with pflotran? Once we all understand than we can come up with ideas on how
>> that fits with DM.
>>
>>     Barry
>>
>>  --Richard
>>>
>>> --
>>> Richard Tran Mills, Ph.D.
>>> Computational Earth Scientist      | Joint Assistant Professor
>>> Hydrogeochemical Dynamics Team     | EECS and Earth & Planetary Sciences
>>> Oak Ridge National Laboratory      | University of Tennessee, Knoxville
>>> E-mail: rmills at ornl.gov  V: 865-241-3198 http://climate.ornl.gov/~**
>>> rmills <http://climate.ornl.gov/~rmills>
>>>
>>>
>
> --
> Richard Tran Mills, Ph.D.
> Computational Earth Scientist      | Joint Assistant Professor
> Hydrogeochemical Dynamics Team     | EECS and Earth & Planetary Sciences
> Oak Ridge National Laboratory      | University of Tennessee, Knoxville
> E-mail: rmills at ornl.gov  V: 865-241-3198 http://climate.ornl.gov/~**rmills<http://climate.ornl.gov/~rmills>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130319/91e6b906/attachment.html>


More information about the petsc-dev mailing list