[petsc-dev] DM field interfaces
Matthew Knepley
knepley at gmail.com
Sat Feb 25 12:18:51 CST 2012
On Sat, Feb 25, 2012 at 12:13 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> [migrating from petsc-maint]
>
> On Sat, Feb 25, 2012 at 11:45, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>> > I agree, but it would be quite helpful to refactor DM_DA have a section
>> > that holds topology and geometry, plus the (very small) extra
>> information
>> > that depends on the number of dofs per point. Then the common part
>> could be
>> > shared, making all the DMDAs coming out of the split easier to work
>> with.
>> >
>>
>> this is true but completely irrelevent here
>>
>
> My understanding is that much of the reason Matt wants to use PetscSection
> in places is because he feels like the DM implementation is quite heavy, so
> if you want to address a subset, making a new DM would involve heavy
> copies. I don't want PetscSection because I think the algebraic components
> should have access to the richer information in a DM, but I also don't want
> full copies of heavy DMs. If we can implement topology/geometry sharing
> without much complexity, we shouldn't need to use PetscSection.
>
This is incorrect. I want to use PetscSection because DM just cannot do
arbitrary data layout. Can we please
stop making examples with vertex unknowns on structures meshes? They have
nothing left to tell us.
Matt
>
>
>>
>> > What interface are we going to use for splitting out a DM for a vector
>> > field in a larger system? How do we get the bs=2 velocity DM out of the
>> > lid-driven cavity's bs=4 velocity, vorticity, and temperature DM?
>> >
>>
>> again this is irrelevent here because the same issue is true for the
>> ISs.
>>
>> But
>>
>> I explained this in my previous email: DMPushSubDMType(DM,"name of a
>> type of splitting like u,v,p or velocity,p"); DMPopSubDMType(); it is not
>> perfect but a start. See that email for more details.
>
>
> // Conservative gas dynamics with fields ordered as [rho, rho*u, rho*v,
> rho*w, E]
> DMGetFieldSplitting(dm,"conservative-vector",&fscons); // creates if it
> doesn't exist
> DMFieldSplittingAddField(dm,fscons,"rho",{0});
> DMFieldSplittingAddField(dm,fscons,"momentum",{1,2,3});
> DMFieldSplittingAddField(dm,fscons,"Energy",{4});
>
> DMGetFieldSplitting(dm,"primitive-vector",&fsprim);
>
> DMFieldSplittingSetPF(dm,fsprim,UserEquationOfStatePF,UserEquationOfStateInversePF);
> DMFieldSplittingAddField(dm,fsprim,"velocity",{0,1,2});
> DMFieldSplittingAddField(dm,fsprim,"pressure",{3});
> DMFieldSplittingAddField(dm,fsprim,"Temperature",{4});
>
> If a transform is not specified, the indices would address the original
> state variables.
>
> 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);
>
> If pf is not NULL, apply PF to the state variables, then isfields[i]
> denotes what to extract in order to live in dmfields[i], pfinv is needed to
> put a contribution back into the coupled dm.
>
--
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/20120225/ea3051ed/attachment.html>
More information about the petsc-dev
mailing list