Skip to main content
Ctrl+K
PETSc v3.23.3-230-ga3f8f6a37e1fd documentation - Home
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • DMSetMatType

DMSetMatType#

Sets the type of matrix created with DMCreateMatrix()

Synopsis#

#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMSetMatType(DM dm, MatType ctype)

Logically Collective

Input Parameters#

  • dm - the DM context

  • ctype - the matrix type, for example MATMPIAIJ

Options Database Key#

  • -dm_mat_type ctype - the type of the matrix to create, for example mpiaij

See Also#

DM Basics, DM, MatType, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatrixPreallocateOnly(), DMGetMatType(), DMCreateGlobalVector(), DMCreateLocalVector()

Level#

intermediate

Location#

src/dm/interface/dm.c

Examples#

src/ksp/ksp/tutorials/ex42.c
src/snes/tutorials/ex35.c
src/ksp/ksp/tutorials/ex71.c
src/ksp/ksp/tutorials/ex70.c
src/snes/tutorials/ex63.c
src/ksp/ksp/tutorials/ex49.c
src/ksp/ksp/tutorials/ex44f.F90
src/ksp/ksp/tutorials/ex43.c
src/snes/tutorials/ex55.c
src/snes/tutorials/ex5f90.F90


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

On this page
  • Synopsis
  • Input Parameters
  • Options Database Key
  • See Also
  • Level
  • Location
  • Examples
Edit on GitLab
Show Source

© Copyright 1991-2025, UChicago Argonne, LLC and the PETSc Development Team.

Created using Sphinx 7.3.7.

Built with the PyData Sphinx Theme 0.15.1.

Last updated on 2025-06-16T03:45:28-0500 (v3.23.3-230-ga3f8f6a37e1fd).