[petsc-dev] urgent issues with DMDA_BOUNDARY_GHOSTED DMDA_BOUNDARY_MIRROR
Barry Smith
bsmith at mcs.anl.gov
Fri Jun 22 15:58:50 CDT 2012
On Jun 22, 2012, at 3:55 PM, Jed Brown wrote:
> Oh, in the case of mirror boundary conditions, the ideal "automatic" thing would be for MatSetValuesLocal() to flip the sign of those matrix entries and insert into the rows and columns corresponding to the interior cells that were mirrored. The problem is that this is just one more special case, inflow pressure boundaries, for example, use the equation of state to fill in the ghost cells, so remapping those entries into the domain is not so simple. It would be fantastic to work out an API for this, but getting the right granularity seems to be tricky since people like to fill in ghost cells in very different ways.
That's nuts. Way to special case. :-)
Barry
>
> On Thu, Jun 21, 2012 at 5:45 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> On Jun 21, 2012, at 6:09 PM, Jed Brown wrote:
>
> > I think that is fine, though having mirrored ghost points in the local-to-global map would be more convenient for matrix assembly.
>
> Hmm, what do you mean by this? What should we do?
>
> Barry
>
> >
> > On Jun 20, 2012 2:51 PM, "Barry Smith" <bsmith at mcs.anl.gov> wrote:
> >
> > My inclination is to remove the mirror enum and simply provide a utility function that updates the ghost points by mirroring in the local vector form that the user can call if they want mirroring?
> >
> > Barry
> >
> > On Jun 20, 2012, at 5:41 PM, Barry Smith wrote:
> >
> > >
> > > What is the intended difference between DMDA_BOUNDARY_GHOSTED and DMDA_BOUNDARY_MIRROR?
> > >
> > > My understanding is that both cause ghost points around the physical boundary that can be indexed in the usual way (for example on the left side just indexing with -1 to get the first of the ghost points? Looking at the code but not testing it I assume that the correctly sized local vectors are created and the appropriate scatters are created that put things in the correct place despite these extra locations with calls to DMGlobalToLocal()?
> > >
> > > My guess is that whoever decided to have both of these was thinking that with DMDA_BOUNDARY_GHOSTED the user would fill up the ghost points themselves however they liked with whatever values they want whenever they want? Meanwhile with mirror PETSc would fill up the ghost points by copying the mirrored values from inside the real physical domain? Thus ghosted is more general.
> > >
> > > But when was it intended that the mirrored values be copied over? During the DMGlobalToLocal call or in a new call? (Note that this copying requires no parallel communication)
> > >
> > > Is there an example of using DMDA_BOUNDARY_GHOSTED where the ghosted values are set via mirroring? Should there be a utility to do that?
> > >
> > > We have someone who needs this mirroring (due to Jed's advice) but appear not to have any code to make that trivial. How shall we fix this?
> > >
> > > Thanks
> > >
> > > Barry
> > >
> >
>
>
More information about the petsc-dev
mailing list