DMProjectField#
This projects a given function of the input fields into the function space provided by a DM, putting the coefficients in a global vector.
Synopsis#
#include "petscdm.h"
#include "petscdmda.h"
#include "petscdmplex.h"
#include "petscdmswarm.h"
#include "petscksp.h"
PetscErrorCode DMProjectField(DM dm, PetscReal time, Vec U, PetscPointFn **funcs, InsertMode mode, Vec X)
Collective
Input Parameters#
dm - The
DMtime - The time
U - The input field vector
funcs - The functions to evaluate, one per field, see
PetscPointFnmode - The insertion mode for values
Output Parameter#
X - The output vector
Note#
There are three different DMs that potentially interact in this function. The output dm, specifies the layout of the values calculates by the function.
The input DM, attached to U, may be different. For example, you can input the solution over the full domain, but output over a piece of the boundary, or
a subdomain. You can also output a different number of fields than the input, with different discretizations. Last the auxiliary DM, attached to the
auxiliary field vector, which is attached to dm, can also be different. It can have a different topology, number of fields, and discretizations.
See Also#
DM Basics, DM, PetscPointFn, DMProjectFieldLocal(), DMProjectFieldLabelLocal(), DMProjectFunction(), DMComputeL2Diff()
Level#
advanced
Location#
Examples#
src/ts/tutorials/ex30.c
src/snes/tutorials/ex12.c
src/ts/tutorials/ex76.c
src/snes/tutorials/ex13.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages