Lines Matching refs:npoints

22   if (ctx->list) qsort(ctx->list, ctx->npoints, sizeof(SwarmPoint), sort_CompareSwarmPoint);  in DMSwarmSortApplyCellIndexSort()
34 ctx->npoints = 0; in DMSwarmSortCreate()
45 PetscInt p, npoints; in DMSwarmSortSetup() local
62 PetscCall(DMSwarmGetLocalSize(dm, &npoints)); in DMSwarmSortSetup()
63 if (npoints != ctx->npoints) { in DMSwarmSortSetup()
64 PetscCall(PetscRealloc(sizeof(SwarmPoint) * npoints, &ctx->list)); in DMSwarmSortSetup()
65 ctx->npoints = npoints; in DMSwarmSortSetup()
67 PetscCall(PetscArrayzero(ctx->list, npoints)); in DMSwarmSortSetup()
72 for (p = 0; p < ctx->npoints; p++) { in DMSwarmSortSetup()
80 for (p = 0; p < ctx->npoints; p++) ctx->pcell_offsets[ctx->list[p].cell_index]++; in DMSwarmSortSetup()
130 PetscErrorCode DMSwarmSortGetNumberOfPointsPerCell(DM sw, PetscInt cell, PetscInt *npoints) in DMSwarmSortGetNumberOfPointsPerCell() argument
142 *npoints = ctx->pcell_offsets[cell + 1] - ctx->pcell_offsets[cell]; in DMSwarmSortGetNumberOfPointsPerCell()
164 PetscErrorCode DMSwarmSortGetPointsPerCell(DM sw, PetscInt cell, PetscInt *npoints, PetscInt **pidl… in DMSwarmSortGetPointsPerCell() argument
174 PetscCall(DMSwarmSortGetNumberOfPointsPerCell(sw, cell, npoints)); in DMSwarmSortGetPointsPerCell()
175 PetscCall(DMGetWorkArray(sw, *npoints, MPIU_SCALAR, pidlist)); in DMSwarmSortGetPointsPerCell()
176 for (PetscInt p = 0; p < *npoints; ++p) { in DMSwarmSortGetPointsPerCell()
202 PetscErrorCode DMSwarmSortRestorePointsPerCell(DM dm, PetscInt e, PetscInt *npoints, PetscInt **pid… in DMSwarmSortRestorePointsPerCell() argument
205 PetscCall(DMRestoreWorkArray(dm, *npoints, MPIU_SCALAR, pidlist)); in DMSwarmSortRestorePointsPerCell()
372 PetscErrorCode DMSwarmSortGetSizes(DM sw, PetscInt *ncells, PetscInt *npoints) in DMSwarmSortGetSizes() argument
382 if (npoints) *npoints = 0; in DMSwarmSortGetSizes()
386 if (npoints) *npoints = ctx->npoints; in DMSwarmSortGetSizes()