petsc-3.7.1 2016-05-15
Report Typos and Errors

# PetscBagCreate

Create a bag of values

### Synopsis

    #include "petscbag.h"
    PetscErrorCode PetscBagCreate(MPI_Comm comm, size_t bagsize, PetscBag *bag)

Collective on MPI_Comm Many br

Many br

### Input Parameters

| comm | - communicator to share bag Many br
| bagsize | - size of the C structure holding the values Many br

### Output Parameter

bag -the bag of values Many br

### Notes

The size of the A struct must be small enough to fit in a PetscInt; by default Many brPetscInt is 4 bytes; this means a bag cannot be larger than 2 gigabytes in length. Many brThe warning about casting to a shorter length can be ignored below unless your A struct is too large Many br

### See Also

PetscBag, PetscBagGetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData()
PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar() Many brPetscBagSetFromOptions(), PetscBagCreate(), PetscBagDestroy(), PetscBagRegisterEnum() Many br

Level:Intermediate
Location:src/sys/classes/bag/bag.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/sys/examples/tutorials/ex5.c.html
src/sys/examples/tutorials/ex5f90.F90.html
src/dm/examples/tutorials/ex7.c.html
src/snes/examples/tutorials/ex7.c.html