Lines Matching refs:Ns
31 PetscInt Ns, Nc, i, Nv, deg; in PetscSpaceSetFromOptions_Tensor() local
38 PetscCall(PetscSpaceTensorGetNumSubspaces(sp, &Ns)); in PetscSpaceSetFromOptions_Tensor()
40 if (Ns > 1) { in PetscSpaceSetFromOptions_Tensor()
44 for (i = 1; i < Ns; i++) { in PetscSpaceSetFromOptions_Tensor()
54 Ns = (Ns == PETSC_DEFAULT) ? PetscMax(Nv, 1) : Ns; in PetscSpaceSetFromOptions_Tensor()
56 …e_tensor_spaces", "The number of subspaces", "PetscSpaceTensorSetNumSubspaces", Ns, &Ns, NULL, 0)); in PetscSpaceSetFromOptions_Tensor()
59 …Ns >= 0 && (Nv <= 0 || Ns != 0), PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_OUTOFRANGE, "Cann… in PetscSpaceSetFromOptions_Tensor()
60 …Ns <= Nv, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_OUTOFRANGE, "Cannot have a tensor space … in PetscSpaceSetFromOptions_Tensor()
61 if (Ns != tens->numTensSpaces) PetscCall(PetscSpaceTensorSetNumSubspaces(sp, Ns)); in PetscSpaceSetFromOptions_Tensor()
63 PetscInt Nvs = Nv / Ns; in PetscSpaceSetFromOptions_Tensor()
67 …Ns == 0, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_WRONG, "Cannot use %" PetscInt_FMT " unif… in PetscSpaceSetFromOptions_Tensor()
68 Ncs = (PetscInt)PetscPowReal((PetscReal)Nc, 1. / Ns); in PetscSpaceSetFromOptions_Tensor()
69 …Ns) == 0, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_WRONG, "Cannot use %" PetscInt_FMT " uni… in PetscSpaceSetFromOptions_Tensor()
74 for (i = 0; i < Ns; i++) PetscCall(PetscSpaceTensorSetSubspace(sp, i, subspace)); in PetscSpaceSetFromOptions_Tensor()
77 for (i = 0; i < Ns; i++) { in PetscSpaceSetFromOptions_Tensor()
100 PetscInt Ns = tens->numTensSpaces, i, n; in PetscSpaceTensorView_Ascii() local
103 for (i = 1; i < Ns; i++) { in PetscSpaceTensorView_Ascii()
109 …ll(PetscViewerASCIIPrintf(v, "Tensor space of %" PetscInt_FMT " subspaces (all identical)\n", Ns)); in PetscSpaceTensorView_Ascii()
110 else PetscCall(PetscViewerASCIIPrintf(v, "Tensor space of %" PetscInt_FMT " subspaces\n", Ns)); in PetscSpaceTensorView_Ascii()
111 n = uniform ? 1 : Ns; in PetscSpaceTensorView_Ascii()
133 PetscInt Nc, Nv, Ns; in PetscSpaceSetUp_Tensor() local
142 PetscCall(PetscSpaceTensorGetNumSubspaces(sp, &Ns)); in PetscSpaceSetUp_Tensor()
143 if (Ns == PETSC_DEFAULT) { in PetscSpaceSetUp_Tensor()
144 Ns = Nv; in PetscSpaceSetUp_Tensor()
145 PetscCall(PetscSpaceTensorSetNumSubspaces(sp, Ns)); in PetscSpaceSetUp_Tensor()
147 if (!Ns) { in PetscSpaceSetUp_Tensor()
152 …Ns <= Nv, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_OUTOFRANGE, "Cannot have a tensor space … in PetscSpaceSetUp_Tensor()
154 for (PetscInt i = 1; i < Ns; i++) { in PetscSpaceSetUp_Tensor()
164 PetscInt Nvs = Nv / Ns; in PetscSpaceSetUp_Tensor()
167 …Ns == 0, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_WRONG, "Cannot use %" PetscInt_FMT " unif… in PetscSpaceSetUp_Tensor()
168 Ncs = (PetscInt)(PetscPowReal((PetscReal)Nc, 1. / Ns)); in PetscSpaceSetUp_Tensor()
169 …Ns) == 0, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_WRONG, "Cannot use %" PetscInt_FMT " uni… in PetscSpaceSetUp_Tensor()
173 for (PetscInt i = 0; i < Ns; i++) PetscCall(PetscSpaceTensorSetSubspace(sp, i, s0)); in PetscSpaceSetUp_Tensor()
175 Ncprod = PetscPowInt(Ncs, Ns); in PetscSpaceSetUp_Tensor()
180 for (PetscInt i = 0; i < Ns; i++) { in PetscSpaceSetUp_Tensor()
220 PetscCall(PetscSpaceTensorSetNumSubspaces(subsp, Ns)); in PetscSpaceSetUp_Tensor()
221 for (PetscInt i = 0; i < Ns; i++) { in PetscSpaceSetUp_Tensor()
238 for (PetscInt i = 0; i < Ns; i++) { in PetscSpaceSetUp_Tensor()
257 PetscInt Ns, i; in PetscSpaceDestroy_Tensor() local
260 Ns = tens->numTensSpaces; in PetscSpaceDestroy_Tensor()
269 for (i = 0; i < Ns; i++) PetscCall(PetscSpaceDestroy(&tens->tensspaces[i])); in PetscSpaceDestroy_Tensor()
282 PetscInt i, Ns, d; in PetscSpaceGetDimension_Tensor() local
286 Ns = tens->numTensSpaces; in PetscSpaceGetDimension_Tensor()
288 for (i = 0; i < Ns; i++) { in PetscSpaceGetDimension_Tensor()
304 PetscInt Ns; in PetscSpaceEvaluate_Tensor() local
314 Ns = tens->numTensSpaces; in PetscSpaceEvaluate_Tensor()
329 for (PetscInt s = 0, d = 0, vstep = 1, cstep = 1; s < Ns; s++) { in PetscSpaceEvaluate_Tensor()
336 …, s %" PetscInt_FMT ", vstep %" PetscInt_FMT ", spdim %" PetscInt_FMT, Nv, Ns, pdim, s, vstep, spd… in PetscSpaceEvaluate_Tensor()
337 … ", s %" PetscInt_FMT ", cstep %" PetscInt_FMT ", sNc %" PetscInt_FMT, Nv, Ns, Nc, s, cstep, spdim… in PetscSpaceEvaluate_Tensor()
530 PetscInt Ns; in PetscSpaceTensorSetNumSubspaces_Tensor() local
534 Ns = tens->numTensSpaces; in PetscSpaceTensorSetNumSubspaces_Tensor()
535 if (numTensSpaces == Ns) PetscFunctionReturn(PETSC_SUCCESS); in PetscSpaceTensorSetNumSubspaces_Tensor()
536 if (Ns >= 0) { in PetscSpaceTensorSetNumSubspaces_Tensor()
539 for (s = 0; s < Ns; s++) PetscCall(PetscSpaceDestroy(&tens->tensspaces[s])); in PetscSpaceTensorSetNumSubspaces_Tensor()
542 Ns = tens->numTensSpaces = numTensSpaces; in PetscSpaceTensorSetNumSubspaces_Tensor()
543 PetscCall(PetscCalloc1(Ns, &tens->tensspaces)); in PetscSpaceTensorSetNumSubspaces_Tensor()
559 PetscInt Ns; in PetscSpaceTensorSetSubspace_Tensor() local
563 Ns = tens->numTensSpaces; in PetscSpaceTensorSetSubspace_Tensor()
564 …PetscCheck(Ns >= 0, PetscObjectComm((PetscObject)space), PETSC_ERR_ARG_WRONGSTATE, "Must call Pets… in PetscSpaceTensorSetSubspace_Tensor()
565 …PetscCheck(s >= 0 && s < Ns, PetscObjectComm((PetscObject)space), PETSC_ERR_ARG_OUTOFRANGE, "Inval… in PetscSpaceTensorSetSubspace_Tensor()
613 PetscInt Ns; in PetscSpaceTensorGetSubspace_Tensor() local
616 Ns = tens->numTensSpaces; in PetscSpaceTensorGetSubspace_Tensor()
617 …PetscCheck(Ns >= 0, PetscObjectComm((PetscObject)space), PETSC_ERR_ARG_WRONGSTATE, "Must call Pets… in PetscSpaceTensorGetSubspace_Tensor()
618 …PetscCheck(s >= 0 && s < Ns, PetscObjectComm((PetscObject)space), PETSC_ERR_ARG_OUTOFRANGE, "Inval… in PetscSpaceTensorGetSubspace_Tensor()