Actual source code: petscbag.h
4: #include petsc.h
7: /*S
8: PetscBag - PETSc object that manages a collection of user data including parameters.
9: A bag is essentially a C struct with serialization (you can save it and load it from files).
11: Level: beginner
13: Sample Usage:
14: $ typedef struct {
15: $ PetscInt height;
16: $ PetscScalar root;
17: $ PetscReal byebye;
18: $ } MyParameters;
19: $
20: $ PetscBag bag;
21: $ MyParameters *params;
22: $
23: $ PetscBagCreate(PETSC_COMM_WORLD,sizeof(MyParameters),&bag);
24: $ PetscBagGetData(bag,(void **)¶ms);
25: $ PetscBagSetName(bag,"MyParameters");
26: $ PetscBagRegisterInt(bag,¶ms.height,22,"height","Height of the water tower");
27: $
29: .seealso: PetscBagSetName(), PetscBagGetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData()
30: PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterTruth(), PetscBagRegisterScalar()
31: PetscBagSetFromOptions(), PetscBagRegisterVec(), PetscBagCreate(), PetscBagDestroy(), PetscBagRegisterEnum()
32: S*/
33: typedef struct _n_PetscBag* PetscBag;
34: typedef struct _n_PetscBagItem* PetscBagItem;
58: #endif