PetscCopyMode#
Determines how an array or PetscObject
passed to certain functions is copied or retained by the aggregate PetscObject
Synopsis#
typedef enum {
PETSC_COPY_VALUES,
PETSC_OWN_POINTER,
PETSC_USE_POINTER
} PetscCopyMode;
Values for array input#
PETSC_COPY_VALUES
- the array values are copied into new space, the user is free to reuse or delete the passed in arrayPETSC_OWN_POINTER
- the array values are NOT copied, the object takes ownership of the array and will free it later, the user cannot change or delete the array. The array MUST have been obtained withPetscMalloc()
. Hence this mode cannot be used in Fortran.PETSC_USE_POINTER
- the array values are NOT copied, the object uses the array but does NOT take ownership of the array. The user cannot use the array but the user must delete the array after the object is destroyed.
Values for PetscObject#
PETSC_COPY_VALUES
- the inputPetscObject
is cloned into the aggregatePetscObject
; the user is free to reuse/modify the inputPetscObject
without side effects.PETSC_OWN_POINTER
- the inputPetscObject
is referenced by pointer (with reference count), thus should not be modified by the user. increases its reference count).PETSC_USE_POINTER
- invalid forPetscObject
inputs.
See Also#
PetscInsertMode
Level#
beginner
Location#
Examples#
src/mat/tutorials/ex3.c
src/ksp/ksp/tutorials/ex71.c
src/vec/is/is/tutorials/ex3.c
src/ksp/ksp/tutorials/ex84.c
src/ksp/ksp/tutorials/ex85.c
src/ksp/ksp/tutorials/ex59.c
src/dm/tutorials/ex6.c
src/ksp/ksp/tutorials/ex49.c
src/vec/is/is/tutorials/ex5.c
src/dm/label/tutorials/ex1.c
Examples#
src/ksp/ksp/tutorials/ex71.c
src/ksp/ksp/tutorials/ex85.c
src/ksp/ksp/tutorials/ex59.c
src/dm/tutorials/ex6.c
src/dm/field/tutorials/ex1.c
src/dm/label/tutorials/ex1.c
src/dm/tutorials/swarm_ex3.c
src/dm/impls/plex/tutorials/ex6.c
Examples#
src/dm/tutorials/ex22.c
src/dm/label/tutorials/ex1.c
src/ksp/pc/tutorials/ex4.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages