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 with PetscMalloc(). 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. E*/ typedef enum { PETSC_COPY_VALUES, PETSC_OWN_POINTER, PETSC_USE_POINTER } PetscCopyMode; PETSC_EXTERN const char *const PetscCopyModes[];
/*MC
PETSC_FALSE - False value of PetscBool
Note#
Zero integer
See Also#
PetscBool
, PetscBool3
, PETSC_TRUE
M*/
/*MC
PETSC_TRUE - True value of PetscBool
Note#
Nonzero integer
See Also#
PetscBool
, PetscBool3
, PETSC_FALSE
M*/
/*MC PetscLogDouble - Used for logging times
Note#
Contains double precision numbers that are not used in the numerical computations, but rather in logging, timing etc.
M*/ typedef double PetscLogDouble;
/*E PetscDataType - Used for handling different basic data types.
Notes#
Use of this should be avoided if one can directly use MPI_Datatype
instead.
PETSC_INT
is the datatype for a PetscInt
, regardless of whether it is 4 or 8 bytes.
PETSC_REAL
, PETSC_COMPLEX
and PETSC_SCALAR
are the datatypes for PetscReal
, PetscComplex
and PetscScalar
, regardless of their sizes.
Developer Notes#
It would be nice if we could always just use MPI Datatypes, why can we not?
If you change any values in PetscDatatype
make sure you update their usage in
share/petsc/matlab/PetscBagRead.m and share/petsc/matlab/@PetscOpenSocket/read/write.m
TODO#
Add PETSC_INT32 and remove use of improper PETSC_ENUM
See Also#
PetscBinaryRead()
, PetscBinaryWrite()
, PetscDataTypeToMPIDataType()
,
PetscDataTypeGetSize()
Level#
beginner
Location#
Examples#
src/vec/vec/utils/tagger/tutorials/ex1.c.html
src/vec/vec/tutorials/ex8.c.html
src/vec/vec/tutorials/ex8f.F90.html
src/vec/is/is/tutorials/ex1.c.html
src/vec/is/is/tutorials/ex1f90.F90.html
src/vec/is/is/tutorials/ex1f.F90.html
src/vec/is/is/tutorials/ex3.c.html
src/vec/is/is/tutorials/ex3f90.F90.html
src/vec/is/is/tutorials/ex4.c.html
src/vec/is/is/tutorials/ex5.c.html
src/vec/is/sf/tutorials/ex1.c.html
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages