PETSc version 3.16.1
Fix/Edit manual page

DMPlexLocalVectorLoad

Loads on-disk vector data into a local vector

Synopsis

#include "petscdmplex.h"   
PetscErrorCode DMPlexLocalVectorLoad(DM dm, PetscViewer viewer, DM sectiondm, PetscSF sf, Vec vec)
Collective on DM

Input Parameters

dm - The DM that represents the topology
viewer - The PetscViewer that represents the on-disk vector data
sectiondm - The DM that contains the local section on which vec is defined
sf - The SF that migrates the on-disk vector data into vec
vec - The local vector to set values of

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");
      DMPlexTopologyLoad(dm, viewer, &sfX);
      DMClone(dm, &sectiondm);
      PetscObjectSetName((PetscObject)sectiondm, "sectiondm_name");
      DMPlexSectionLoad(dm, viewer, sectiondm, sfX, NULL, &lsf);
      DMGetLocalVector(sectiondm, &vec);
      PetscObjectSetName((PetscObject)vec, "vec_name");
      DMPlexLocalVectorLoad(dm, viewer, sectiondm, lsf, vec);
      DMRestoreLocalVector(sectiondm, &vec);
      PetscSFDestroy(&lsf);
      PetscSFDestroy(&sfX);
      DMDestroy(&sectiondm);
      DMDestroy(&dm);

See Also

DMPlexTopologyLoad(), DMPlexSectionLoad(), DMPlexGlobalVectorLoad(), DMPlexGlobalVectorView(), DMPlexLocalVectorView()

Level

advanced

Location

src/dm/impls/plex/plex.c

Examples

src/dm/impls/plex/tutorials/ex12.c.html

Index of all DMPLEX routines
Table of Contents for all manual pages
Index of all manual pages