Home
last modified time | relevance | path

Searched refs:nc (Results 1 – 25 of 78) sorted by relevance

1234

/petsc/src/ts/tutorials/power_grid/
H A Dex6.c325 PetscInt nc = 0; in IJacobian() local
332 col[nc].i = i; in IJacobian()
333 col[nc].j = j; in IJacobian()
334 val[nc++] = 1.0; in IJacobian()
340 col[nc].i = i + 1; in IJacobian()
341 col[nc].j = j; in IJacobian()
342 val[nc++] = fwc / user->dx; in IJacobian()
343 col[nc].i = i; in IJacobian()
344 col[nc].j = j + 1; in IJacobian()
345 val[nc++] = -user->disper_coe / user->dy; in IJacobian()
[all …]
H A Dex8.c296 PetscInt nc = 0; in IJacobian() local
308 col[nc].i = i - 1; in IJacobian()
309 col[nc].j = j; in IJacobian()
310 val[nc++] = c1pos; in IJacobian()
311 col[nc].i = i + 1; in IJacobian()
312 col[nc].j = j; in IJacobian()
313 val[nc++] = -c1neg; in IJacobian()
314 col[nc].i = i; in IJacobian()
315 col[nc].j = j - 1; in IJacobian()
316 val[nc++] = c3pos + c5; in IJacobian()
[all …]
H A Dex7.c320 PetscInt nc = 0; in IJacobian() local
332 col[nc].i = i - 1; in IJacobian()
333 col[nc].j = j; in IJacobian()
334 val[nc++] = c1pos; in IJacobian()
335 col[nc].i = i + 1; in IJacobian()
336 col[nc].j = j; in IJacobian()
337 val[nc++] = -c1neg; in IJacobian()
338 col[nc].i = i; in IJacobian()
339 col[nc].j = j - 1; in IJacobian()
340 val[nc++] = c3pos + c5; in IJacobian()
[all …]
/petsc/src/dm/field/impls/da/
H A Ddmfieldda.c32 PetscInt nc; in DMFieldView_DA() local
38 nc = field->numComponents; in DMFieldView_DA()
42 for (j = 0; j < nc; j++) { in DMFieldView_DA()
43 PetscScalar val = dafield->cornerVals[nc * i + j]; in DMFieldView_DA()
67 #define MEHess(out, cf, etaB, etaD, dim, nc, cast) \ argument
70 for (_m = 0; _m < (nc) * (dim) * (dim); _m++) (out)[_m] = 0.; \
74 for (_m = 0; _m < (nc); _m++) { \
83 static void MultilinearEvaluate(PetscInt dim, PetscReal (*coordRange)[2], PetscInt nc, PetscScalar … in MultilinearEvaluate() argument
118 PetscScalar *out = &((PetscScalar *)B)[nc * i]; in MultilinearEvaluate()
120 MEdot(out, cf, etaB, (1 << dim), nc, (PetscScalar)); in MultilinearEvaluate()
[all …]
/petsc/src/ts/tutorials/
H A Dex15.c248 PetscInt i, j, Mx, My, xs, ys, xm, ym, nc; in FormIJacobian() local
265 nc = 0; in FormIJacobian()
269 col[nc].j = j; in FormIJacobian()
270 col[nc].i = i; in FormIJacobian()
271 vals[nc++] = 1.0; in FormIJacobian()
274 col[nc].j = j; in FormIJacobian()
275 col[nc].i = i; in FormIJacobian()
276 vals[nc++] = 1.0; in FormIJacobian()
277 col[nc].j = j; in FormIJacobian()
278 col[nc].i = i + 1; in FormIJacobian()
[all …]
H A Dex13.c204 PetscInt nc = 0; in RHSJacobian() local
210 col[nc].i = i; in RHSJacobian()
211 col[nc].j = j; in RHSJacobian()
212 val[nc++] = 1.0; in RHSJacobian()
214 col[nc].i = i - 1; in RHSJacobian()
215 col[nc].j = j; in RHSJacobian()
216 val[nc++] = sx; in RHSJacobian()
217 col[nc].i = i + 1; in RHSJacobian()
218 col[nc].j = j; in RHSJacobian()
219 val[nc++] = sx; in RHSJacobian()
[all …]
H A Dex17.c221 PetscInt nc; in FormIJacobian() local
231 nc = 0; in FormIJacobian()
234 col[nc].i = i; in FormIJacobian()
235 vals[nc++] = 1.0; in FormIJacobian()
237 col[nc].i = i; in FormIJacobian()
238 vals[nc++] = 1.0; in FormIJacobian()
239 col[nc].i = i + 1; in FormIJacobian()
240 vals[nc++] = -1.0; in FormIJacobian()
242 col[nc].i = i - 1; in FormIJacobian()
243 vals[nc++] = -1.0; in FormIJacobian()
[all …]
/petsc/src/dm/impls/da/
H A Dfdda.c189 PetscInt dim, m, n, p, nc; in DMCreateColoring_DA() local
219 PetscCall(DMDAGetInfo(da, &dim, NULL, NULL, NULL, &m, &n, &p, &nc, NULL, &bx, &by, &bz, NULL)); in DMCreateColoring_DA()
234 dd->xs = dd->xs / nc; in DMCreateColoring_DA()
235 dd->xe = dd->xe / nc; in DMCreateColoring_DA()
236 dd->Xs = dd->Xs / nc; in DMCreateColoring_DA()
237 dd->Xe = dd->Xe / nc; in DMCreateColoring_DA()
250 dd->w = nc; in DMCreateColoring_DA()
251 dd->xs = dd->xs * nc; in DMCreateColoring_DA()
252 dd->xe = dd->xe * nc; in DMCreateColoring_DA()
253 dd->Xs = dd->Xs * nc; in DMCreateColoring_DA()
[all …]
H A Ddainterp.c44 PetscInt row, col, i_start_ghost, mx, m_c, nc, ratio; in DMCreateInterpolation_DA_1D_Q1() local
103 nc = 0; in DMCreateInterpolation_DA_1D_Q1()
106 cols[nc] = idx_c[col]; in DMCreateInterpolation_DA_1D_Q1()
107 v[nc++] = -x + 1.0; in DMCreateInterpolation_DA_1D_Q1()
110 cols[nc] = idx_c[col + 1]; in DMCreateInterpolation_DA_1D_Q1()
111 v[nc++] = x; in DMCreateInterpolation_DA_1D_Q1()
113 PetscCall(MatSetValues(mat, 1, &row, nc, cols, v, INSERT_VALUES)); in DMCreateInterpolation_DA_1D_Q1()
176 PetscInt row, col, i_start_ghost, mx, m_c, nc, ratio; in DMCreateInterpolation_DA_1D_Q0() local
234 nc = 0; in DMCreateInterpolation_DA_1D_Q0()
237 cols[nc] = idx_c[col]; in DMCreateInterpolation_DA_1D_Q0()
[all …]
/petsc/src/mat/impls/nest/
H A Dmatnest.c27 for (j = 0; j < bA->nc; j++) { /* cols */ in MatNestGetSizes_Private()
42 PetscInt i, j, nr = bA->nr, nc = bA->nc; in MatMult_Nest() local
46 for (i = 0; i < nc; i++) PetscCall(VecGetSubVector(x, bA->isglobal.col[i], &bx[i])); in MatMult_Nest()
49 for (j = 0; j < nc; j++) { in MatMult_Nest()
56 for (i = 0; i < nc; i++) PetscCall(VecRestoreSubVector(x, bA->isglobal.col[i], &bx[i])); in MatMult_Nest()
64 PetscInt i, j, nr = bA->nr, nc = bA->nc; in MatMultAdd_Nest() local
68 for (i = 0; i < nc; i++) PetscCall(VecGetSubVector(x, bA->isglobal.col[i], &bx[i])); in MatMultAdd_Nest()
76 for (j = 0; j < nc; j++) { in MatMultAdd_Nest()
83 for (i = 0; i < nc; i++) PetscCall(VecRestoreSubVector(x, bA->isglobal.col[i], &bx[i])); in MatMultAdd_Nest()
100 PetscInt i, j, M, N, nr, nc, ldb, ldc; in MatProductNumeric_Nest_Dense() local
[all …]
/petsc/src/dm/impls/composite/
H A Dpackm.c88 PetscInt nc, rstart, *ccols, maxnc; in DMCreateMatrix_Composite_AIJ() local
104 PetscCall(MatGetRow(Atmp, rstart + i, &nc, NULL, NULL)); in DMCreateMatrix_Composite_AIJ()
105 maxnc = PetscMax(nc, maxnc); in DMCreateMatrix_Composite_AIJ()
106 PetscCall(MatRestoreRow(Atmp, rstart + i, &nc, NULL, NULL)); in DMCreateMatrix_Composite_AIJ()
110 PetscCall(MatGetRow(Atmp, rstart + i, &nc, &cols, NULL)); in DMCreateMatrix_Composite_AIJ()
112 for (j = 0; j < nc; j++) { in DMCreateMatrix_Composite_AIJ()
117 PetscCall(MatPreallocateSet(com->rstart + next->rstart + i, nc, ccols, dnz, onz)); in DMCreateMatrix_Composite_AIJ()
118 PetscCall(MatRestoreRow(Atmp, rstart + i, &nc, &cols, NULL)); in DMCreateMatrix_Composite_AIJ()
135 PetscInt nc, rstart, row, maxnc, *ccols; in DMCreateMatrix_Composite_AIJ() local
151 PetscCall(MatGetRow(Atmp, rstart + i, &nc, NULL, NULL)); in DMCreateMatrix_Composite_AIJ()
[all …]
/petsc/src/mat/impls/nest/ftn-custom/
H A Dzmatnestf.c14 PETSC_EXTERN void matcreatenest_(MPI_Fint *comm, PetscInt *nr, IS is_row[], PetscInt *nc, IS is_col… in matcreatenest_() argument
22 *ierr = PetscMalloc1((*nr) * (*nc), &m); in matcreatenest_()
24 for (i = 0; i < (*nr) * (*nc); i++) { in matcreatenest_()
34 *ierr = MatCreateNest(MPI_Comm_f2c(*comm), *nr, is_row, *nc, is_col, m, B); in matcreatenest_()
39 PETSC_EXTERN void matnestsetsubmats_(Mat *B, PetscInt *nr, IS is_row[], PetscInt *nc, IS is_col[], … in matnestsetsubmats_() argument
48 *ierr = PetscMalloc1((*nr) * (*nc), &m); in matnestsetsubmats_()
50 for (i = 0; i < (*nr) * (*nc); i++) { in matnestsetsubmats_()
62 *ierr = MatNestSetSubMats(*B, *nr, is_row, *nc, is_col, m); in matnestsetsubmats_()
/petsc/src/dm/field/tutorials/
H A Dex1.c29 PetscInt dim, i, nc; in TestEvaluate() local
39 PetscCall(DMFieldGetNumComponents(field, &nc)); in TestEvaluate()
47 …PetscCall(PetscMalloc6(n * nc, &B, n * nc, &rB, n * nc * dim, &D, n * nc * dim, &rD, n * nc * dim … in TestEvaluate()
54 PetscCall(ViewResults(viewer, n * nc, dim, B, D, H, rB, rD, rH)); in TestEvaluate()
64 PetscInt dim, i, nc, nq; in TestEvaluateFE() local
75 PetscCall(DMFieldGetNumComponents(field, &nc)); in TestEvaluateFE()
89 N = n * nq * nc; in TestEvaluateFE()
108 PetscInt dim, i, nc; in TestEvaluateFV() local
119 PetscCall(DMFieldGetNumComponents(field, &nc)); in TestEvaluateFV()
132 N = n * nc; in TestEvaluateFV()
[all …]
/petsc/src/mat/tutorials/
H A Dex12.c18 PetscInt n, i, *cnt, *indices, nc; in PadMatrix() local
31 PetscCall(MatGetRow(A, i, &nc, NULL, NULL)); in PadMatrix()
32 cnt[i] = nc + (vv[i] != 0.0); in PadMatrix()
33 PetscCall(MatRestoreRow(A, i, &nc, NULL, NULL)); in PadMatrix()
42 PetscCall(MatGetRow(A, i, &nc, &aj, &aa)); in PadMatrix()
43 PetscCall(MatSetValues(*B, 1, &i, nc, aj, aa, INSERT_VALUES)); in PadMatrix()
44 PetscCall(MatRestoreRow(A, i, &nc, &aj, &aa)); in PadMatrix()
/petsc/src/dm/field/impls/ds/
H A Ddmfieldds.c151 PetscInt nq, nc, dim, meshDim, numCells, feDim, i, K = H ? 2 : (D ? 1 : (B ? 0 : -1)); in DMFieldEvaluateFE_DS() local
162 nc = field->numComponents; in DMFieldEvaluateFE_DS()
189 PetscScalar *cB = &((PetscScalar *)B)[nc * nq * i]; in DMFieldEvaluateFE_DS()
191 DMFieldDSdot(cB, T->T[0], elem, nq, feDim, nc, (PetscScalar)); in DMFieldEvaluateFE_DS()
193 PetscReal *cB = &((PetscReal *)B)[nc * nq * i]; in DMFieldEvaluateFE_DS()
195 DMFieldDSdot(cB, T->T[0], elem, nq, feDim, nc, PetscRealPart); in DMFieldEvaluateFE_DS()
200 PetscScalar *cD = &((PetscScalar *)D)[nc * nq * dim * i]; in DMFieldEvaluateFE_DS()
202 DMFieldDSdot(cD, T->T[1], elem, nq, feDim, (nc * dim), (PetscScalar)); in DMFieldEvaluateFE_DS()
204 PetscReal *cD = &((PetscReal *)D)[nc * nq * dim * i]; in DMFieldEvaluateFE_DS()
206 DMFieldDSdot(cD, T->T[1], elem, nq, feDim, (nc * dim), PetscRealPart); in DMFieldEvaluateFE_DS()
[all …]
/petsc/src/tao/constrained/impls/ipm/
H A Dpdipm.c278 PetscInt i, row, cols[2], Jrstart, rjstart, nc, j; in TaoSNESJacobian_PDIPM() local
319 PetscCall(MatGetRow(tao->jacobian_equality, i + rjstart, &nc, &aj, &aa)); in TaoSNESJacobian_PDIPM()
321 for (j = 0; j < nc; j++) { in TaoSNESJacobian_PDIPM()
326 PetscCall(MatRestoreRow(tao->jacobian_equality, i + rjstart, &nc, &aj, &aa)); in TaoSNESJacobian_PDIPM()
339 PetscCall(MatGetRow(tao->jacobian_inequality, i + rjstart, &nc, &aj, &aa)); in TaoSNESJacobian_PDIPM()
341 for (j = 0; j < nc; j++) { in TaoSNESJacobian_PDIPM()
346 PetscCall(MatRestoreRow(tao->jacobian_inequality, i + rjstart, &nc, &aj, &aa)); in TaoSNESJacobian_PDIPM()
371 PetscCall(MatGetRow(tao->hessian, i + rjstart, &nc, &aj, &aa)); in TaoSNESJacobian_PDIPM()
373 for (j = 0; j < nc; j++) { in TaoSNESJacobian_PDIPM()
383 PetscCall(MatRestoreRow(tao->hessian, i + rjstart, &nc, &aj, &aa)); in TaoSNESJacobian_PDIPM()
[all …]
/petsc/src/vec/is/is/utils/
H A Discoloring.c199 PetscErrorCode ISColoringGetColors(ISColoring iscoloring, PetscInt *n, PetscInt *nc, const ISColori… in ISColoringGetColors() argument
205 if (nc) *nc = iscoloring->n; in ISColoringGetColors()
238 PetscInt *mcolors, **ii, nc = iscoloring->n, i, base, n = iscoloring->N; in ISColoringGetIS() local
243nc, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Coloring is our of range index %" PetscInt_FMT "va… in ISColoringGetIS()
247 PetscCall(PetscCalloc1(nc, &mcolors)); in ISColoringGetIS()
250 PetscCall(PetscMalloc1(nc, &ii)); in ISColoringGetIS()
252 for (i = 1; i < nc; i++) ii[i] = ii[i - 1] + mcolors[i - 1]; in ISColoringGetIS()
253 PetscCall(PetscArrayzero(mcolors, nc)); in ISColoringGetIS()
263 PetscCall(PetscMalloc1(nc, &is)); in ISColoringGetIS()
264 …for (i = 0; i < nc; i++) PetscCall(ISCreateGeneral(iscoloring->comm, mcolors[i], ii[i], PETSC_COPY… in ISColoringGetIS()
[all …]
/petsc/src/mat/tests/
H A Dex240.c9 PetscInt N, mx = 5, my = 4, i, j, nc, nrow, n, ncols, rstart, *colors, *map; in main() local
32 PetscCall(ISColoringGetColors(iscoloring, &n, &nc, &icolors)); in main()
51 PetscCall(PetscCalloc1(nrow * nc, &cm)); in main()
64 …for (j = 0; j < nc; j++) PetscCall(PetscSynchronizedPrintf(MPI_COMM_WORLD, "%12.4e ", (double)Pet… in main()
75 if (single) PetscCall(MatFDColoringSetBlockSize(fdcoloring, PETSC_DEFAULT, nc)); in main()
H A Dex202.c7 const PetscInt nr = 2, nc = 3, nk = 10; in TestInitialMatrix() local
25 …for (i = 0; i < (nr * nc); i++) PetscCall(MatCreateSeqDense(PETSC_COMM_WORLD, arow[i], acol[i], NU… in TestInitialMatrix()
26 PetscCall(MatCreateNest(PETSC_COMM_WORLD, nr, NULL, nc, NULL, subs, &A)); in TestInitialMatrix()
37 for (j = 0; j < nc; j++) PetscCall(MatView(block[i][j], PETSC_VIEWER_STDOUT_WORLD)); in TestInitialMatrix()
42 for (i = 0; i < nc; i++) { in TestInitialMatrix()
91 for (i = 0; i < (nr * nc); i++) PetscCall(MatDestroy(&subs[i])); in TestInitialMatrix()
/petsc/src/ts/tutorials/power_grid/stability_9bus/
H A Dex9busdmnetwork.c104 PetscErrorCode read_data(PetscInt nc, Gen **pgen, Exc **pexc, Load **pload, Bus **pbus, Branch **pb… in read_data() argument
184 …PetscCall(PetscCalloc5(NBUS * nc, &bus, NGEN * nc, &gen, NLOAD * nc, &load, NBRANCH * nc + (nc - 1… in read_data()
189 for (i = 0; i < nc; i++) { in read_data()
205 for (i = 0; i < nc; i++) { in read_data()
223 for (i = 0; i < nc; i++) { in read_data()
238 for (i = 0; i < nc; i++) { in read_data()
263 PetscCall(PetscCalloc1(2 * NBRANCH * nc + 2 * (nc - 1), &edgelist)); in read_data()
266 for (i = 0; i < nc; i++) { in read_data()
312 for (i = 1; i < nc; i++) { in read_data()
313 edgelist[18 * nc + 2 * (i - 1)] = 8 + (i - 1) * 9; in read_data()
[all …]
/petsc/src/dm/ftn-mod/
H A Dpetscdt.h902 subroutine PetscQuadratureRestoreData(q, dim, nc, np, p, w, ierr)
5 PetscInt dim, nc, np
/petsc/src/ksp/ksp/tests/
H A Dex9.c7 PetscInt i, j, nr, nc; in replace_submats() local
10 PetscCall(MatNestGetSubMats(A, &nr, &nc, NULL)); in replace_submats()
12 PetscCall(PetscMalloc1(nc, &c)); in replace_submats()
15 for (j = 0; j < nc; j++) { in replace_submats()
/petsc/src/mat/graphops/color/impls/minpack/
H A Dcolor.c38 PetscInt bs = 1, rstart, rend, N_loc, nc; in MatColoringApply_SL() local
95 nc = iscoloring_seq->n; in MatColoringApply_SL()
96 PetscCall(ISColoringCreate(comm, nc, N_loc, colors_loc, PETSC_OWN_POINTER, iscoloring)); in MatColoringApply_SL()
138 PetscInt bs = 1, rstart, rend, N_loc, nc; in MatColoringApply_LF() local
198 nc = iscoloring_seq->n; in MatColoringApply_LF()
199 PetscCall(ISColoringCreate(comm, nc, N_loc, colors_loc, PETSC_OWN_POINTER, iscoloring)); in MatColoringApply_LF()
241 PetscInt bs = 1, rstart, rend, N_loc, nc; in MatColoringApply_ID() local
299 nc = iscoloring_seq->n; in MatColoringApply_ID()
300 PetscCall(ISColoringCreate(comm, nc, N_loc, colors_loc, PETSC_OWN_POINTER, iscoloring)); in MatColoringApply_ID()
/petsc/src/dm/tutorials/
H A Dex5.c9 PetscInt M = 10, N = 8, ne, nc, i; in main() local
43 PetscCall(DMDAGetElements(da, &ne, &nc, &e)); in main()
51 PetscCall(DMDARestoreElements(da, &ne, &nc, &e)); in main()
/petsc/src/mat/graphops/color/impls/natural/
H A Dnatural.c15 PetscInt rstart, rend, N_loc, nc; in MatColoringApply_Natural() local
54 nc = iscoloring_seq->n; in MatColoringApply_Natural()
55 PetscCall(ISColoringCreate(comm, nc, N_loc, colors_loc, PETSC_OWN_POINTER, iscoloring)); in MatColoringApply_Natural()

1234