Lines Matching refs:dimR

8   PetscInt   i, j, dimC, dimR;  in testIdentity()  local
12 PetscCall(DMGetDimension(dm, &dimR)); in testIdentity()
15 PetscCall(DMGetWorkArray(dm, dimR * numPoints, MPIU_REAL, &preimage)); in testIdentity()
17 PetscCall(DMGetWorkArray(dm, dimR * numPoints, MPIU_REAL, &inverted)); in testIdentity()
19 for (i = 0; i < dimR * numPoints; i++) PetscCall(PetscRandomGetValueReal(randCtx, &preimage[i])); in testIdentity()
20 if (dmIsSimplicial && dimR > 1) { in testIdentity()
22 for (j = 0; j < dimR; j++) { in testIdentity()
23 PetscReal x = preimage[i * dimR + j]; in testIdentity()
24 PetscReal y = preimage[i * dimR + ((j + 1) % dimR)]; in testIdentity()
26 preimage[i * dimR + ((j + 1) % dimR)] = -1. + (y + 1.) * 0.5 * (1. - x); in testIdentity()
37 …for (j = 0; j < dimR; j++) max = PetscMax(max, PetscAbsReal(preimage[i * dimR + j] - inverted[i * in testIdentity()
40 for (j = 0; j < dimR; j++) { in testIdentity()
41 PetscCall(PetscPrintf(PETSC_COMM_SELF, "%+f", (double)preimage[i * dimR + j])); in testIdentity()
42 if (j < dimR - 1) PetscCall(PetscPrintf(PETSC_COMM_SELF, ",")); in testIdentity()
50 for (j = 0; j < dimR; j++) { in testIdentity()
51 PetscCall(PetscPrintf(PETSC_COMM_SELF, "%+f", (double)inverted[i * dimR + j])); in testIdentity()
52 if (j < dimR - 1) PetscCall(PetscPrintf(PETSC_COMM_SELF, ",")); in testIdentity()
61 for (j = 0; j < dimR; j++) { in testIdentity()
62 …tscSNPrintfCount(strBuf + offset, BUFSIZ - offset, "%+f", &count, (double)preimage[i * dimR + j])); in testIdentity()
64 if (j < dimR - 1) { in testIdentity()
81 for (j = 0; j < dimR; j++) { in testIdentity()
82 …tscSNPrintfCount(strBuf + offset, BUFSIZ - offset, "%+f", &count, (double)inverted[i * dimR + j])); in testIdentity()
84 if (j < dimR - 1) { in testIdentity()
94 PetscCall(DMRestoreWorkArray(dm, dimR * numPoints, MPIU_REAL, &inverted)); in testIdentity()
96 PetscCall(DMRestoreWorkArray(dm, dimR * numPoints, MPIU_REAL, &preimage)); in testIdentity()