[petsc-users] PetscSections and DMPlex's

Ferrand, Jesus A. FERRANJ2 at my.erau.edu
Mon Feb 28 13:14:50 CST 2022

Dear PETSc team:

I am working on an FEA code that solves the elasticity equation using P1 elements. I want to write Vecs to ParaView in .vtk format. I can output the displacements by defining a PetscSection that assigned dof over the vertices of my mesh. I can export this Vec using PetscViewerVTKAddField() and DMPlexVTKWriteAll(). Now I want to export strains and stresses using the same VTK functions, but these Vecs need a different PetscSection (one that assigns dof over the cells). My concern is that to output displacements I attached the PetscSection to the DMPlex using DMSetLocalSection(). I'm not sure if I can define another local section for my cell-based strains and stresses and set it as a local section .

 My questions are:

  *   Could I perhaps do this with DMSetGlobalSection()?
  *   Can a DM hold multiple PetscSections (say multiple local sections and multiple global sections)?
     *   If so, how can select individual ones to properly output Vecs with DMPlexVTKWriteAll()?
  *   Does the local PetscSection depend on the Global one or vice versa?
  *   Can I avoid having to define a PetscSection altogether for my cell-based Vecs if I use DMCreateGlobalVector()?
     *   I got this idea from the source code of DMPlexCreateRankField(), which I successfully use to visualize my mesh partition.

Sorry for the mouthful.


J.A. Ferrand

Embry-Riddle Aeronautical University - Daytona Beach FL

M.Sc. Aerospace Engineering | May 2022

B.Sc. Aerospace Engineering

B.Sc. Computational Mathematics

Sigma Gamma Tau

Tau Beta Pi

Honors Program

Phone: (386)-843-1829

Email(s): ferranj2 at my.erau.edu

    jesus.ferrand at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220228/938b79e4/attachment.html>

More information about the petsc-users mailing list