[petsc-users] Using DMPlex

Matthew Knepley knepley at gmail.com
Sun Dec 24 07:57:57 CST 2017


On Sun, Dec 24, 2017 at 3:43 AM, Mohammad Hassan Baghaei <
mhbaghaei at mail.sjtu.edu.cn> wrote:

> Hello
>
> I am using the DMPlex interface for the solving PDEs.
>

Great. What discretization are you using?


> A  part of mesh, considering, is staggered grid, at the location of middle
> of each edge.
>

So you would like to put variables at each edge midpoint?


> After generation of main grid points, I find it hard to have the staggered
> grid at the prescribed location.
>

In Plex, the topology is specified by the DMPlex, but the dof layout is
specified by a PetscSection. To put
variables on edges, you could use:

DMGetDefaultSection(dm, &s);
DMPlexGetDepthStratum(dm, 1, &eStart, &eEnd);
for (e = eStart; e < eEnd; ++e) {
  PetscSectionAddDof(s, e, 1);
}

and of course any other dofs you are using.


> I want to know how to deal with the staggered besides of main grid. Is it
> better to have another DM for the staggered?
>

Another option is to use several DMDA. This has its own drawbacks.


> Is it possible to extend the DMChart and inserting the points.
>

If the chart does not have edges, it is because it has not been
interpolated. Either pass the PETSC_TRUE, or call


http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexInterpolate.html

  Thanks,

      Matt


> I would really appreciate for your time.
>
> Amir
>



-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171224/7a57c91f/attachment.html>


More information about the petsc-users mailing list