PetscBag#
PETSc object that manages a collection of user data including parameters. A bag is essentially a C struct with serialization (you can save it and load it from files).
Synopsis#
typedef struct _n_PetscBag *PetscBag;
Sample Usage#
typedef struct {
PetscInt height;
PetscScalar root;
PetscReal byebye;
} MyParameters;
PetscBag bag;
MyParameters *params;
PetscCall(PetscBagCreate(PETSC_COMM_WORLD,sizeof(MyParameters),&bag));
PetscCall(PetscBagGetData(bag,(void **)¶ms));
PetscCall(PetscBagSetName(bag,"MyParameters"));
PetscCall(PetscBagRegisterInt(bag,¶ms.height,22,"height","Height of the water tower"));
Note#
PetscBag
is a C struct, it is not a PetscObject
See Also#
PetscBagSetName()
, PetscBagGetName()
, PetscBagView()
, PetscBagLoad()
, PetscBagGetData()
PetscBagRegisterReal()
, PetscBagRegisterInt()
, PetscBagRegisterBool()
, PetscBagRegisterScalar()
PetscBagSetFromOptions()
, PetscBagRegisterVec()
, PetscBagCreate()
, PetscBagDestroy()
, PetscBagRegisterEnum()
Level#
beginner
Location#
Examples#
src/snes/tutorials/ex27.c
src/snes/tutorials/ex76.c
src/snes/tutorials/ex71.c
src/snes/tutorials/ex62.c
src/dm/tutorials/ex7.c
src/snes/tutorials/ex36.c
src/ts/tutorials/ex76.c
src/snes/tutorials/ex69.c
src/snes/tutorials/ex17.c
src/ts/tutorials/ex77.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages