petsc-3.13.6 2020-09-29
Report Typos and Errors

DMSwarmSetPointsUniformCoordinates

Set point coordinates in a DMSwarm on a regular (ijk) grid

Synopsis

#include "petscdmswarm.h"   
PETSC_EXTERN PetscErrorCode DMSwarmSetPointsUniformCoordinates(DM dm,PetscReal min[],PetscReal max[],PetscInt npoints[],InsertMode mode)
Collective on dm

Input parameters

dm - the DMSwarm
min - minimum coordinate values in the x, y, z directions (array of length dim)
max - maximum coordinate values in the x, y, z directions (array of length dim)
npoints - number of points in each spatial direction (array of length dim)
mode - indicates whether to append points to the swarm (ADD_VALUES), or over-ride existing points (INSERT_VALUES)

Notes

When using mode = INSERT_VALUES, this method will reset the number of particles in the DMSwarm to be npoints[0]*npoints[1] (2D) or npoints[0]*npoints[1]*npoints[2] (3D). When using mode = ADD_VALUES, new points will be appended to any already existing in the DMSwarm

See Also

DMSwarmSetType(), DMSwarmSetCellDM(), DMSwarmType

Level

beginner

Location

src/dm/impls/swarm/swarmpic.c

Examples

src/dm/tutorials/ex20.c.html
src/ksp/ksp/tutorials/ex70.c.html

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