# DMClone#

Creates a DM object with the same topology as the original.

## Synopsis#

#include "petscdm.h"
#include "petscdmlabel.h"
#include "petscds.h"
PetscErrorCode DMClone(DM dm, DM *newdm)


Collective

## Input Parameter#

• dm - The original DM object

## Output Parameter#

• newdm - The new DM object

## Notes#

For some DM implementations this is a shallow clone, the result of which may share (reference counted) information with its parent. For example, DMClone() applied to a DMPLEX object will result in a new DMPLEX that shares the topology with the original DMPLEX. It does not share the PetscSection of the original DM.

The clone is considered set up if the original has been set up.

Use DMConvert() for a general way to create new DM from a given DM

DMDestroy(), DMCreate(), DMSetType(), DMSetLocalSection(), DMSetGlobalSection(), DMPLEX, DMSetType(), DMConvert()

beginner

## Location#

src/dm/interface/dm.c

Edit on GitLab