DMPlexGlobalVectorView#
Saves a global vector
Synopsis#
#include "petscdmplex.h"
PetscErrorCode DMPlexGlobalVectorView(DM dm, PetscViewer viewer, DM sectiondm, Vec vec)
Collective
Input Parameters#
dm - The
DM
that represents the topologyviewer - The
PetscViewer
to save data withsectiondm - The
DM
that contains the global section on which vec is definedvec - The global vector to be saved
Notes#
In general dm and sectiondm are two different objects, the former carrying the topology and the latter carrying the section, and have been given a topology name and a section name, respectively, with PetscObjectSetName()
. In practice, however, they can be the same object if it carries both topology and section; in that case the name of the object is used as both the topology name and the section name.
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);
PetscSectionDestroy(§ion);
DMGetGlobalVector(sectiondm, &vec);
PetscObjectSetName((PetscObject)vec, "vec_name");
DMPlexTopologyView(dm, viewer);
DMPlexSectionView(dm, viewer, sectiondm);
DMPlexGlobalVectorView(dm, viewer, sectiondm, vec);
DMRestoreGlobalVector(sectiondm, &vec);
DMDestroy(§iondm);
DMDestroy(&dm);
See Also#
DMPlex: Unstructured Grids, DM
, DMPLEX
, DMPlexTopologyView()
, DMPlexSectionView()
, DMPlexLocalVectorView()
, DMPlexGlobalVectorLoad()
, DMPlexLocalVectorLoad()
Level#
advanced
Location#
Index of all DMPlex routines
Table of Contents for all manual pages
Index of all manual pages