Lines Matching refs:entities
406 static PetscErrorCode GmshEntitiesCreate(PetscCount count[4], GmshEntities **entities) in GmshEntitiesCreate() argument
409 PetscCall(PetscNew(entities)); in GmshEntitiesCreate()
411 PetscCall(PetscCalloc1(count[dim], &(*entities)->entity[dim])); in GmshEntitiesCreate()
412 PetscCall(PetscHMapICreate(&(*entities)->entityMap[dim])); in GmshEntitiesCreate()
417 static PetscErrorCode GmshEntitiesDestroy(GmshEntities **entities) in GmshEntitiesDestroy() argument
422 if (!*entities) PetscFunctionReturn(PETSC_SUCCESS); in GmshEntitiesDestroy()
424 PetscCall(PetscFree((*entities)->entity[dim])); in GmshEntitiesDestroy()
425 PetscCall(PetscHMapIDestroy(&(*entities)->entityMap[dim])); in GmshEntitiesDestroy()
427 PetscCall(PetscFree(*entities)); in GmshEntitiesDestroy()
431 static PetscErrorCode GmshEntitiesAdd(GmshEntities *entities, PetscInt index, PetscInt dim, PetscIn… in GmshEntitiesAdd() argument
434 PetscCall(PetscHMapISet(entities->entityMap[dim], eid, index)); in GmshEntitiesAdd()
435 entities->entity[dim][index].dim = dim; in GmshEntitiesAdd()
436 entities->entity[dim][index].id = eid; in GmshEntitiesAdd()
437 if (entity) *entity = &entities->entity[dim][index]; in GmshEntitiesAdd()
441 static PetscErrorCode GmshEntitiesGet(GmshEntities *entities, PetscInt dim, PetscInt eid, GmshEntit… in GmshEntitiesGet() argument
446 PetscCall(PetscHMapIGet(entities->entityMap[dim], eid, &index)); in GmshEntitiesGet()
447 *entity = &entities->entity[dim][index]; in GmshEntitiesGet()
507 GmshEntities *entities; member
537 PetscCall(GmshEntitiesDestroy(&(*mesh)->entities)); in GmshMeshDestroy()
673 PetscCall(GmshEntitiesCreate(count, &mesh->entities)); in GmshReadEntities_v40()
678 PetscCall(GmshEntitiesAdd(mesh->entities, (PetscInt)index, dim, eid, &entity)); in GmshReadEntities_v40()
801 PetscCall(GmshEntitiesGet(mesh->entities, dim, eid, &entity)); in GmshReadElements_v40()
938 PetscCall(GmshEntitiesCreate(count, &mesh->entities)); in GmshReadEntities_v41()
942 PetscCall(GmshEntitiesAdd(mesh->entities, (PetscInt)index, dim, eid, &entity)); in GmshReadEntities_v41()
989 …if (numEntityBlocks && !mesh->entities) PetscCall(PetscInfo(NULL, "File specifies %" PetscCount_FM… in GmshReadNodes_v41()
995 if (mesh->entities) PetscCall(GmshEntitiesGet(mesh->entities, dim, eid, &entity)); in GmshReadNodes_v41()
1038 …if (numEntityBlocks && !mesh->entities) PetscCall(PetscInfo(NULL, "File specifies %" PetscCount_FM… in GmshReadElements_v41()
1044 if (mesh->entities) PetscCall(GmshEntitiesGet(mesh->entities, dim, eid, &entity)); in GmshReadElements_v41()