Actual source code: mapcreate.c
2: #include vecimpl.h
7: /*@C
8: PetscMapCreate - Creates an empty map object. The type can then be set with PetscMapSetType().
10: Collective on MPI_Comm
11:
12: Input Parameter:
13: . comm - The MPI communicator for the map object
15: Output Parameter:
16: . map - The map object
18: Level: beginner
20: .keywords: PetscMap, create
21: .seealso: PetscMapDestroy(), PetscMapGetLocalSize(), PetscMapGetSize(), PetscMapGetGlobalRange(), PetscMapGetLocalRange()
22: @*/
23: PetscErrorCode PetscMapCreate(MPI_Comm comm, PetscMap *map)
24: {
25: PetscMap m;
30: *map = PETSC_NULL;
31: #ifndef PETSC_USE_DYNAMIC_LIBRARIES
32: VecInitializePackage(PETSC_NULL);
33: #endif
35: PetscHeaderCreate(m, _p_PetscMap, struct _PetscMapOps, MAP_COOKIE, -1, "PetscMap", comm, PetscMapDestroy, PETSC_NULL);
36: PetscLogObjectCreate(m);
37: PetscLogObjectMemory(m, sizeof(struct _p_PetscMap));
38: PetscMemzero(m->ops, sizeof(struct _PetscMapOps));
39: m->bops->publish = PETSC_NULL /* PetscMapPublish_Petsc */;
40: m->type_name = PETSC_NULL;
42: m->n = -1;
43: m->N = -1;
44: m->rstart = -1;
45: m->rend = -1;
46: m->range = PETSC_NULL;
48: *map = m;
49: return(0);
50: }