DMSwarmProjectGradientFields#
Project the gradient of continuum fields on a mesh onto particle fields in a DMSWARM, or the reverse
Synopsis#
#include "petscdm.h"
#include "petscdmda.h"
#include "petscdmplex.h"
#include "petscdmswarm.h"
#include "petscksp.h"
PetscErrorCode DMSwarmProjectGradientFields(DM sw, DM dm, PetscInt nfields, const char *fieldnames[], Vec fields[], ScatterMode mode)
Collective
Input Parameters#
sw - the
DMSWARMdm - the continuum
DM(aDMPLEX); ifNULLthe swarm’s cellDMis usednfields - the number of fields to project
fieldnames - the names of the swarm fields to receive (or supply) the gradient
fields - the corresponding mesh
Vecobjectsmode -
SCATTER_FORWARDto project mesh field gradients to particles,SCATTER_REVERSEto project particle values back to the mesh
Note#
Only DMPLEX cell DMs and single-field projection are currently supported. The swarm field block size must equal
the mesh field component count times the coordinate dimension.
See Also#
DMSWARM, DMPLEX, DMSwarmProjectFields(), DMSwarmVectorDefineFields(), DMSwarmCreateGlobalVectorFromField()
Level#
intermediate
Location#
src/ksp/ksp/utils/dm/dmproject.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages