Lines Matching refs:c

10 PetscErrorCode MatFDColoringCreate_SeqXAIJ(Mat mat, ISColoring iscoloring, MatFDColoring c)  in MatFDColoringCreate_SeqXAIJ()  argument
21 c->brows = m; in MatFDColoringCreate_SeqXAIJ()
22 c->bcols = 1; in MatFDColoringCreate_SeqXAIJ()
42 c->brows = brows; in MatFDColoringCreate_SeqXAIJ()
43 c->bcols = bcols; in MatFDColoringCreate_SeqXAIJ()
46 c->M = mat->rmap->N / bs; /* set total rows, columns and local rows */ in MatFDColoringCreate_SeqXAIJ()
47 c->N = mat->cmap->N / bs; in MatFDColoringCreate_SeqXAIJ()
48 c->m = mat->rmap->N / bs; in MatFDColoringCreate_SeqXAIJ()
49 c->rstart = 0; in MatFDColoringCreate_SeqXAIJ()
50 c->ncolors = nis; in MatFDColoringCreate_SeqXAIJ()
51 c->ctype = iscoloring->ctype; in MatFDColoringCreate_SeqXAIJ()
62 PetscErrorCode MatFDColoringSetUpBlocked_AIJ_Private(Mat mat, MatFDColoring c, PetscInt nz) in MatFDColoringSetUpBlocked_AIJ_Private() argument
64 PetscInt i, j, nrows, nbcols, brows = c->brows, bcols = c->bcols, mbs = c->m, nis = c->ncolors; in MatFDColoringSetUpBlocked_AIJ_Private()
71 PetscCall(PetscMalloc1(bcols * mat->rmap->n, &c->dy)); in MatFDColoringSetUpBlocked_AIJ_Private()
77 if (c->htype[0] == 'd') { /* c->htype == 'ds', use MatEntry */ in MatFDColoringSetUpBlocked_AIJ_Private()
78 MatEntry *Jentry_new, *Jentry = c->matentry; in MatFDColoringSetUpBlocked_AIJ_Private()
89 color_start[j + 1] = c->nrows[i + j] + color_start[j]; in MatFDColoringSetUpBlocked_AIJ_Private()
98 nrows = c->nrows[i + j]; in MatFDColoringSetUpBlocked_AIJ_Private()
121 c->matentry = Jentry_new; in MatFDColoringSetUpBlocked_AIJ_Private()
123 MatEntry2 *Jentry2_new, *Jentry2 = c->matentry2; in MatFDColoringSetUpBlocked_AIJ_Private()
134 color_start[j + 1] = c->nrows[i + j] + color_start[j]; in MatFDColoringSetUpBlocked_AIJ_Private()
143 nrows = c->nrows[i + j]; in MatFDColoringSetUpBlocked_AIJ_Private()
165 c->matentry2 = Jentry2_new; in MatFDColoringSetUpBlocked_AIJ_Private()
171 PetscCall(PetscFree(c->nrows)); in MatFDColoringSetUpBlocked_AIJ_Private()
172 c->nrows = nrows_new; in MatFDColoringSetUpBlocked_AIJ_Private()
176 PetscErrorCode MatFDColoringSetUp_SeqXAIJ(Mat mat, ISColoring iscoloring, MatFDColoring c) in MatFDColoringSetUp_SeqXAIJ() argument
178 …PetscInt i, n, nrows, mbs = c->m, j, k, m, ncols, col, nis = iscoloring->n, *rowhit, bs,… in MatFDColoringSetUp_SeqXAIJ()
187 PetscCall(ISColoringGetIS(iscoloring, PETSC_OWN_POINTER, PETSC_IGNORE, &c->isa)); in MatFDColoringSetUp_SeqXAIJ()
210 PetscCall(PetscMalloc2(nis, &c->ncolumns, nis, &c->columns)); in MatFDColoringSetUp_SeqXAIJ()
211 PetscCall(PetscMalloc1(nis, &c->nrows)); /* nrows is freed separately from ncolumns and columns */ in MatFDColoringSetUp_SeqXAIJ()
213 if (c->htype[0] == 'd') { in MatFDColoringSetUp_SeqXAIJ()
215 c->matentry = Jentry; in MatFDColoringSetUp_SeqXAIJ()
216 } else if (c->htype[0] == 'w') { in MatFDColoringSetUp_SeqXAIJ()
218 c->matentry2 = Jentry2; in MatFDColoringSetUp_SeqXAIJ()
229 PetscCall(PetscCalloc1(c->m, &rowhit)); in MatFDColoringSetUp_SeqXAIJ()
230 PetscCall(PetscMalloc1(c->m, &valaddrhit)); in MatFDColoringSetUp_SeqXAIJ()
234 PetscCall(ISGetLocalSize(c->isa[i], &n)); in MatFDColoringSetUp_SeqXAIJ()
235 PetscCall(ISGetIndices(c->isa[i], &is)); in MatFDColoringSetUp_SeqXAIJ()
237 c->ncolumns[i] = n; in MatFDColoringSetUp_SeqXAIJ()
238 c->columns[i] = (PetscInt *)is; in MatFDColoringSetUp_SeqXAIJ()
240 PetscCall(ISRestoreIndices(c->isa[i], &is)); in MatFDColoringSetUp_SeqXAIJ()
257 c->nrows[i] = nrows; /* total num of rows for this color */ in MatFDColoringSetUp_SeqXAIJ()
259 if (c->htype[0] == 'd') { in MatFDColoringSetUp_SeqXAIJ()
281 if (c->bcols > 1) { /* reorder Jentry for faster MatFDColoringApply() */ in MatFDColoringSetUp_SeqXAIJ()
282 PetscCall(MatFDColoringSetUpBlocked_AIJ_Private(mat, c, nz)); in MatFDColoringSetUp_SeqXAIJ()
287 PetscCall(PetscMalloc1(bs * mat->rmap->n, &c->dy)); in MatFDColoringSetUp_SeqXAIJ()
295 PetscCall(ISColoringRestoreIS(iscoloring, PETSC_OWN_POINTER, &c->isa)); in MatFDColoringSetUp_SeqXAIJ()
297 …reateGhost(PetscObjectComm((PetscObject)mat), mat->rmap->n, PETSC_DETERMINE, 0, NULL, &c->vscale)); in MatFDColoringSetUp_SeqXAIJ()
298 …cCall(PetscInfo(c, "ncolors %" PetscInt_FMT ", brows %" PetscInt_FMT " and bcols %" PetscInt_FMT "… in MatFDColoringSetUp_SeqXAIJ()