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 DMSWARM

  • dm - the continuum DM (a DMPLEX); if NULL the swarm’s cell DM is used

  • nfields - the number of fields to project

  • fieldnames - the names of the swarm fields to receive (or supply) the gradient

  • fields - the corresponding mesh Vec objects

  • mode - SCATTER_FORWARD to project mesh field gradients to particles, SCATTER_REVERSE to 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