DMSetNumFields — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# DMSetNumFields

Set the number of fields in the `DM`

## Synopsis

    #include "petscdm.h"
    #include "petscdmlabel.h"
    #include "petscds.h"
    PetscErrorCode DMSetNumFields(DM dm, PetscInt numFields)

Logically Collective

## Input Parameters

- dm - The `DM`

- numFields - The number of fields

## See Also

DM Basics, `DM`, `DMGetNumFields()`, `DMSetField()`

## Level

intermediate

## Location

src/dm/interface/dm.c

## Examples

src/dm/impls/plex/tutorials/ex14f90.F90
src/dm/impls/plex/tutorials/ex6.c
src/tao/tutorials/ex3.c
src/ts/tutorials/ex11_sa.c
src/dm/impls/plex/tutorials/ex14.c
src/dm/impls/plex/tutorials/ex1f90.F90
src/ts/tutorials/ex30.c
src/dm/impls/plex/tutorials/ex1.c
src/ts/tutorials/ex52.c

Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages