# DACreate1d

Creates an object that will manage the communication of one-dimensional regular array data that is distributed across some processors.

### Synopsis

    #include "petscda.h"
    PetscErrorCode PETSCDM_DLLEXPORT DACreate1d(MPI_Comm comm,DAPeriodicType wrap,PetscInt M,PetscInt dof,PetscInt s,PetscInt *lc,DA *inra)

Collective on MPI_Comm

### Input Parameters

| comm | - MPI communicator
| wrap | - type of periodicity should the array have, if any. Use either DA_NONPERIODIC or DA_XPERIODIC
| M | - global dimension of the array (use -M to indicate that it may be set to a different value from the command line with -da_grid_x <M>)
| dof | - number of degrees of freedom per node
| s | - stencil width
| lc | - array containing number of nodes in the X direction on each processor, or PETSC_NULL. If non-null, must be of length as m.

### Output Parameter

inra -the resulting distributed array object

### Options Database Key

| -da_view | - Calls DAView() at the conclusion of DACreate1d()
| -da_grid_x <nx> | - number of grid points in x direction; can set if M < 0
| -da_refine_x | - refinement factor

### Notes

The array data itself is NOT stored in the DA, it is stored in Vec objects; The appropriate vector objects can be obtained with calls to DACreateGlobalVector() and DACreateLocalVector() and calls to VecDuplicate() if more are needed.

### Keywords

distributed array, create, one-dimensional

### See Also

DADestroy(), DAView(), DACreate2d(), DACreate3d(), DAGlobalToLocalBegin(), DASetRefinementFactor(),
DAGlobalToLocalEnd(), DALocalToGlobal(), DALocalToLocalBegin(), DALocalToLocalEnd(), DAGetRefinementFactor(), DAGetInfo(), DACreateGlobalVector(), DACreateLocalVector(), DACreateNaturalVector(), DALoad(), DAView()

Level:beginner
Location: src/dm/da/src/da1.c
Index of all DA routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/ksp/examples/tutorials/ex25.c.html
src/ksp/ksp/examples/tutorials/ex28.c.html
src/snes/examples/tutorials/ex3.c.html
src/snes/examples/tutorials/ex21.c.html
src/snes/examples/tutorials/ex22.c.html
src/snes/examples/tutorials/ex23.c.html
src/snes/examples/tutorials/ex24.c.html
src/snes/examples/tutorials/ex26.c.html
src/snes/examples/tutorials/ex31.c.html
src/snes/examples/tutorials/ex34f90.F.html
src/snes/examples/tutorials/ex35f90.F90.html