Actual source code: mapcreate.c
1: #ifdef PETSC_RCS_HEADER
2: static char vcid[] = "$Id: mapcreate.c,v 1.1 1999/06/21 02:03:50 knepley Exp $";
3: #endif
5: #include vecimpl.h
10: /*@C
11: PetscMapCreate - Creates an empty map object. The type can then be set with PetscMapSetType().
13: Collective on MPI_Comm
14:
15: Input Parameter:
16: . comm - The MPI communicator for the map object
18: Output Parameter:
19: . map - The map object
21: Level: beginner
23: .keywords: PetscMap, create
24: .seealso: PetscMapDestroy(), PetscMapGetLocalSize(), PetscMapGetSize(), PetscMapGetGlobalRange(), PetscMapGetLocalRange()
25: @*/
26: int PetscMapCreate(MPI_Comm comm, PetscMap *map)
27: {
28: PetscMap m;
29: int ierr;
33: *map = PETSC_NULL;
34: #ifndef PETSC_USE_DYNAMIC_LIBRARIES
35: VecInitializePackage(PETSC_NULL);
36: #endif
38: PetscHeaderCreate(m, _p_PetscMap, struct _PetscMapOps, MAP_COOKIE, -1, "PetscMap", comm, PetscMapDestroy, PETSC_NULL);
39: PetscLogObjectCreate(m);
40: PetscLogObjectMemory(m, sizeof(struct _p_PetscMap));
41: PetscMemzero(m->ops, sizeof(struct _PetscMapOps));
42: m->bops->publish = PETSC_NULL /* PetscMapPublish_Petsc */;
43: m->type_name = PETSC_NULL;
45: m->n = -1;
46: m->N = -1;
47: m->rstart = -1;
48: m->rend = -1;
49: m->range = PETSC_NULL;
51: *map = m;
52: return(0);
53: }