#include "petscdmplex.h" PetscErrorCode DMPlexLocalVectorView(DM dm, PetscViewer viewer, DM sectiondm, Vec vec)Collective on DM
dm | - The DM that represents the topology | |
viewer | - The PetscViewer to save data with | |
sectiondm | - The DM that contains the local section on which vec is defined; may be the same as dm | |
vec | - The local vector to be saved |
Typical calling sequence
DMCreate(PETSC_COMM_WORLD, &dm);
DMSetType(dm, DMPLEX);
PetscObjectSetName((PetscObject)dm, "topologydm_name");
DMClone(dm, §iondm);
PetscObjectSetName((PetscObject)sectiondm, "sectiondm_name");
PetscSectionCreate(PETSC_COMM_WORLD, §ion);
DMPlexGetChart(sectiondm, &pStart, &pEnd);
PetscSectionSetChart(section, pStart, pEnd);
PetscSectionSetUp(section);
DMSetLocalSection(sectiondm, section);
DMGetLocalVector(sectiondm, &vec);
PetscObjectSetName((PetscObject)vec, "vec_name");
DMPlexTopologyView(dm, viewer);
DMPlexSectionView(dm, viewer, sectiondm);
DMPlexLocalVectorView(dm, viewer, sectiondm, vec);
DMRestoreLocalVector(sectiondm, &vec);
DMDestroy(§iondm);
DMDestroy(&dm);