Skip to main content
Ctrl+K
PETSc v3.26.1-554-gc8d5ad6b3782 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
  • PetscMemzero

PetscMemzero#

Zeros the specified memory.

Synopsis#

static inline PetscErrorCode PetscMemzero(void *a, size_t n)

Not Collective, No Fortran Support

Input Parameters#

  • a - pointer to beginning memory location

  • n - length (in bytes) of memory to initialize

Note#

Prefer PetscArrayzero()

See Also#

PetscMemcpy(), PetscMemcmp(), PetscArrayzero(), PetscArraycmp(), PetscArraycpy(), PetscMemmove(), PetscStrallocpy()

Level#

intermediate

Location#

include/petscstring.h

Examples#

src/sys/tutorials/ex5.c
src/sys/tests/ex20.c
src/ksp/ksp/tutorials/ex42.c
src/ksp/ksp/tutorials/ex43.c
src/ksp/ksp/tutorials/ex49.c
src/ksp/ksp/tutorials/ex70.c
src/snes/tutorials/ex48.c
src/ts/tutorials/ex10.c
src/ts/tutorials/ex11.c
src/ts/tutorials/ex14.c


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

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

© Copyright 1991-2026, 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 2026-11-28T03:39:59-0600 (v3.26.1-554-gc8d5ad6b3782).