petsc-3.3-p7 2013-05-11

PetscNew

Allocates memory of a particular type, zeros the memory! Aligned to PETSC_MEMALIGN

Synopsis

PetscErrorCode PetscNew(struct type,((type *))result)
Not Collective

Input Parameter

type -structure name of space to be allocated. Memory of size sizeof(type) is allocated

Output Parameter

result -memory allocated

See Also

PetscFree(), PetscMalloc(), PetscNewLog()

Level:beginner
Location:
include/petscsys.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/dm/examples/tutorials/ex6.c.html
src/dm/examples/tutorials/ex8.c.html
src/ksp/ksp/examples/tutorials/ex15.c.html
src/snes/examples/tutorials/ex10.c.html
src/snes/examples/tutorials/ex28.c.html
src/snes/examples/tutorials/ex48.c.html
src/snes/examples/tutorials/ex58.c.html
src/ts/examples/tutorials/ex8.c.html
src/ts/examples/tutorials/ex9.c.html
src/ts/examples/tutorials/ex10.c.html
src/ts/examples/tutorials/ex14.c.html