[petsc-dev] DM field interfaces
Jed Brown
jedbrown at mcs.anl.gov
Sat Feb 25 13:15:30 CST 2012
On Sat, Feb 25, 2012 at 12:36, Barry Smith <bsmith at mcs.anl.gov> wrote:
> Jed, It also makes it impossible to handle bizare things where for one
> spitting you want a subset of one thing actually in another thing. So why
> not use IS to define the names, this gives complete flexibility. Also this
> above is not adding fields: you are just giving names to subsets of fields
> indicated by the original numbering of fields. Which is fine, but has
> confusing names (you are not AddField just naming it).
>
I'm defining collections of fields, then adding/naming field in those
collections. You want these collections defined for visualization anyway.
> My suggestion is just a more or less a concise way of doing what you are
> doing without the need for YET ANOTHER CLASS (fcons).
>
That is just a token, it could be an int. There is a very real concept of
multiple (possibly nonlinear) bases for model state. How do you want to
refer to these collections? Just strings?
Instead of making these collections, we could just define an arbitrarily
large (thus redundant) list of "observables" (quantities that can be
computed from model state). Primitive variables are one such collection of
observables. Then when asking for splits, the caller could provide the
subset that they wanted. This isn't good for automatically ensuring that
the bases span and are non-redundant, but it would be the best interface
for visualization. I'm not sure how you would want to define the equation
of state (which would normally provide all the primitive variables from the
state) or its inverse.
> >
> > Then PCFieldSplit and eventual nonlinear and time-stepping splitting
> methods would call
> >
> > DMGetFieldSplitting(dm,&nsplits,&splits);
> > // choose split number to use
> > split = splits[splitidx];
> > DMFieldSplittingGetName(dm,split,&splitname);
> >
> DMFieldSplittingGetFields(dm,split,&pf,&pfinv,&nfields,&isfields,&dmfields);
>
> I do not like this approach based on requesting by name, just push your
> name and then pop it. This way something "above" in the call stack can push
> to the right one then something further down can use it without having to
> know its name (sort of like your "default" split) but the push allows
> changing the default. You kind of assume that the guts is suppose to know
> what name to use? // choose split number to use how is some PC deep inside
> suppose to know this?
>
> I realize my proposal was not complete on detail. I'm suggesting changes
> to your detail.
>
Push/pop is fine with me. But note that the GUI should be able to get a
list of options at any level in which a decision makes sense. It's possible
that we would want to split in terms of different variables in that
PCComposite+2*PCFieldSplit example.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120225/2ea1413b/attachment.html>
More information about the petsc-dev
mailing list