DMSwarmCreateGlobalVectorFromFields#
Creates a Vec object sharing the array associated with a given field set
Synopsis#
#include "petscdmswarm.h"
PetscErrorCode DMSwarmCreateGlobalVectorFromFields(DM dm, PetscInt Nf, const char *fieldnames[], Vec *vec)
Collective
Input Parameters#
dm - a
DMSWARMNf - the number of fields
fieldnames - the textual names given to the registered fields
Output Parameter#
vec - the vector
Notes#
The vector must be returned using a matching call to DMSwarmDestroyGlobalVectorFromFields().
All fields must have data type PETSC_REAL or PETSC_SCALAR. When PETSc is configured with complex scalars,
only the real part of vector entries is copied back to PETSC_REAL fields.
This vector is copyin-copyout, rather than a direct pointer like DMSwarmCreateGlobalVectorFromField()
See Also#
DM, DMSWARM, DMSwarmRegisterPetscDatatypeField(), DMSwarmDestroyGlobalVectorFromFields()
Level#
beginner
Location#
Index of all DMSwarm routines
Table of Contents for all manual pages
Index of all manual pages