# DMMoabLoadFromFile
Creates a DM object by loading the mesh from a user specified file. 
## Synopsis
```
#include "petscdmmoab.h"   
PetscErrorCode DMMoabLoadFromFile(MPI_Comm comm, PetscInt dim, PetscInt nghost, const char *filename, const char *usrreadopts, DM *dm)
```
Collective


## Input Parameters

- ***comm -*** The communicator for the DM object
- ***dim -*** The spatial dimension
- ***filename -*** The name of the mesh file to be loaded
- ***usrreadopts -*** The options string to read a MOAB mesh.


Reference (Parallel Mesh Initialization: https://www.mcs.anl.gov/~fathom/moab-docs/html/contents.html#fivetwo)


## Output Parameter

- ***dm  -*** The DM object





## See Also
 `DMSetType()`, `DMCreate()`, `DMMoabCreateBoxMesh()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/moab/dmmbutil.cxx.html#DMMoabLoadFromFile">src/dm/impls/moab/dmmbutil.cxx</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex35.cxx.html">src/ksp/ksp/tutorials/ex35.cxx.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex36.cxx.html">src/ksp/ksp/tutorials/ex36.cxx.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/moab/dmmbutil.cxx)


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