# DMCreateInterpolation#

Gets the interpolation matrix between two DM objects. The resulting matrix map degrees of freedom in the vector obtained by DMCreateGlobalVector() on the coarse DM to similar vectors on the fine grid DM.

## Synopsis#

#include "petscdm.h"
#include "petscdmlabel.h"
#include "petscds.h"
PetscErrorCode DMCreateInterpolation(DM dmc, DM dmf, Mat *mat, Vec *vec)


Collective on dmc

## Input Parameters#

• dmc - the DM object

• dmf - the second, finer DM object

## Output Parameters#

• mat - the interpolation

• vec - the scaling (optional), see DMCreateInterpolationScale()

## Notes#

For DMDA objects this only works for “uniform refinement”, that is the refined mesh was obtained DMRefine() or the coarse mesh was obtained by DMCoarsen(). The coordinates set into the DMDA are completely ignored in computing the interpolation.

For DMDA objects you can use this interpolation (more precisely the interpolation from the DMGetCoordinateDM()) to interpolate the mesh coordinate vectors EXCEPT in the periodic case where it does not make sense since the coordinate vectors are not periodic.

DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMRefine(), DMCoarsen(), DMCreateRestriction(), DMCreateInterpolationScale()

developer

## Location#

src/dm/interface/dm.c

Edit on GitLab