# DMInterpolateSolution
Interpolates a solution from a coarse mesh to a fine mesh. 
## Synopsis
```
#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMInterpolateSolution(DM coarse, DM fine, Mat interp, Vec coarseSol, Vec fineSol)
```
Collective on dm


## Input Parameters

- ***coarse -*** coarse `DM`
- ***fine   -*** fine `DM`
- ***interp -*** (optional) the matrix computed by `DMCreateInterpolation()`.  Implementations may not need this, but if it
is available it can avoid some recomputation.  If it is provided, `MatInterpolate()` will be used if
the coarse `DM` does not have a specialized implementation.
- ***coarseSol -*** solution on the coarse mesh



## Output Parameter

- ***fineSol -*** the interpolation of coarseSol to the fine mesh





## Note
This function exists because the interpolation of a solution vector between meshes is not always a linear
map.  For example, if a boundary value problem has an inhomogeneous Dirichlet boundary condition that is compressed
out of the solution vector.  Or if interpolation is inherently a nonlinear operation, such as a method using
slope-limiting reconstruction.


## Developer Note
This doesn't just interpolate "solutions" so its API name is questionable.


## See Also
 `DMInterpolate()`, `DMCreateInterpolation()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/interface/dm.c.html#DMInterpolateSolution">src/dm/interface/dm.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plex.c.html#DMInterpolateSolution_Plex">DMInterpolateSolution_Plex in src/dm/impls/plex/plex.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/interface/dm.c)


[Index of all DM routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
