Actual source code: mapcreate.c

  1: #define PETSCVEC_DLL
 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 PETSCVEC_DLLEXPORT 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:   PetscLogObjectMemory(m, sizeof(struct _p_PetscMap));
 37:   PetscMemzero(m->ops, sizeof(struct _PetscMapOps));
 38:   m->bops->publish  = PETSC_NULL /* PetscMapPublish_Petsc */;
 39:   m->type_name      = PETSC_NULL;

 41:   m->n      = -1;
 42:   m->N      = -1;
 43:   m->rstart = -1;
 44:   m->rend   = -1;
 45:   m->range  = PETSC_NULL;

 47:   *map = m;
 48:   return(0);
 49: }