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.


Sincerely:

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): [email protected]

    [email protected]

Reply via email to