[petsc-users] Using DMPlex

Matthew Knepley knepley at gmail.com
Tue Dec 26 09:03:31 CST 2017


On Tue, Dec 26, 2017 at 1:54 AM, Mohammad Hassan Baghaei <
mhbaghaei at mail.sjtu.edu.cn> wrote:

> Hello
>
> I want to know whether is it possible that a specific field in the section
> have been defined at some time on edges and other times on the vertices.
>

What do you mean "at some time"? If you mean that some vertices have dofs,
but not all, and some edges have dofs, but not all, then this is fine.
Otherwise, I do not understand what you mean.

If you mean your simulation is running, and then you decide that they
discretization should change, you will have to recreate everything,
including the PetscSection,
the Vec and Mat, and solver.

  Thanks,

     Mattt


> This change in the dof , I think, may cause problem, especially in the
> global vector size of the dm. At times when the field changes to be defined
> on the edges, I think, I need to reset the dof with routine. I know how to
> do this, thanks to Matt.  But, how I can deal with the global vector. At
> first, the global vector was defined on the vertices, but by this change.
> How would the global vector would response? Do I need to change the global
> vector?
>
> Thanks
>
> Amir
>
>
>
>
>
>
>
> 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/>
>



-- 
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/20171226/c92cc8ed/attachment-0001.html>


More information about the petsc-users mailing list