| /petsc/src/ts/tutorials/phasefield/ |
| H A D | biharmonic.c | 58 PetscReal tol; member 91 ctx.tol = 1.0e-8; in main() 92 PetscCall(PetscOptionsGetReal(NULL, NULL, "-tol", &ctx.tol, NULL)); in main() 205 …PetscReal tol = ctx->tol, theta = ctx->theta, theta_c = ctx->theta_c, a, b; /* a and b are used… in FormFunction() local 260 …if (PetscRealPart(x[i]) < -1.0 + 2.0 * tol) f[i] += (.25 * theta / (tol - tol * tol)) * (x[i - 1] … in FormFunction() 261 …else if (PetscRealPart(x[i]) > 1.0 - 2.0 * tol) f[i] += (.25 * theta / (tol - tol * tol)) * (x[i -… in FormFunction() 264 a = 2.0 * theta * (1.0 - 2.0 * tol) / (16.0 * tol * tol * (1.0 - tol) * (1.0 - tol)); in FormFunction() 265 b = theta / (4.0 * tol * (1.0 - tol)) - a * (1.0 - 2.0 * tol); in FormFunction() 266 …if (PetscRealPart(x[i]) < -1.0 + 2.0 * tol) f[i] += -1.0 * a * .25 * (x[i + 1] - x[i - 1]) * (x[i … in FormFunction() 267 …else if (PetscRealPart(x[i]) > 1.0 - 2.0 * tol) f[i] += 1.0 * a * .25 * (x[i + 1] - x[i - 1]) * (x… in FormFunction() [all …]
|
| H A D | biharmonic2.c | 38 PetscReal tol; member 72 ctx.tol = 1.0e-8; in main() 73 PetscCall(PetscOptionsGetReal(NULL, NULL, "-tol", &ctx.tol, NULL)); in main() 238 …if (PetscRealPart(x[i].u) < -1.0 + 2.0 * ctx->tol) f[i].w += .5 * ctx->theta * (-PetscLogReal(ctx-… in FormFunction() 239 …t(x[i].u) > 1.0 - 2.0 * ctx->tol) f[i].w += .5 * ctx->theta * (-PetscLogScalar((1.0 + x[i].u) / 2.… in FormFunction()
|
| /petsc/src/vec/vec/tutorials/ |
| H A D | ex20f90.F90 | 18 PetscReal norm, v, v1, v2, tol 32 tol = 1.e-10_PETSC_REAL_KIND 100 if (v > -tol .and. v < tol) v = 0.0 107 if (v > -tol .and. v < tol) v = 0.0 114 if (v > -tol .and. v < tol) v = 0.0 121 if (v > -tol .and. v < tol) v = 0.0 128 if (v > -tol .and. v < tol) v = 0.0 134 if (v > -tol .and. v < tol) v = 0.0 141 if (v > -tol .and. v < tol) v = 0.0 148 if (v > -tol .and. v < tol) v = 0.0 [all …]
|
| /petsc/src/vec/vec/tests/ |
| H A D | ex28.c | 4 #define CheckError(a, b, tol) \ argument 6 …AtTol(a, b, 0, tol)) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Real error at line %d, tol %g: %s %g… 9 #define CheckErrorScalar(a, b, tol) \ argument 11 if (!PetscIsCloseAtTol(PetscRealPart(a), PetscRealPart(b), 0, tol)) { \ 12 … "Real error at line %d, tol %g: %s %g %s %g diff %g\n", __LINE__, (double)tol, #a, (double)PetscR… 15 … "Imag error at line %d, tol %g: %s %g %s %g diff %g\n", __LINE__, (double)tol, #a, (double)PetscI… 26 PetscReal tol = PETSC_SMALL; in main() local 60 CheckErrorScalar(result1, result1a, tol); in main() 61 CheckErrorScalar(result2, result2a, tol); in main() 62 CheckError(result3, result3a, tol); in main() [all …]
|
| /petsc/src/ts/tests/ |
| H A D | ex13.c | 23 PetscReal times[10], tol = PETSC_SMALL; in main() local 76 …PetscCheck(!check || serr <= tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in state %g > %g", (doub… in main() 77 …scCheck(!check || derr <= tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in state derivative %g > %g… in main() 88 …PetscCheck(!check || serr <= tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in state %g > %g", (doub… in main() 99 …scCheck(!check || derr <= tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in state derivative %g > %g… in main() 116 …PetscCheck(!check || serr <= tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in state %g > %g", (doub… in main() 117 …scCheck(!check || derr <= tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in state derivative %g > %g… in main() 152 …PetscCheck(!check || serr <= tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in state %g > %g", (doub… in main() 159 …check || i < p || derr <= tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in state derivative %g > %g… in main()
|
| /petsc/src/vec/is/sf/utils/ |
| H A D | sfcoord.c | 19 … IntersectBoundingBox_Internal(PetscInt dim, const PetscReal *a, const PetscReal *b, PetscReal tol) in IntersectBoundingBox_Internal() argument 22 …if (a[1 * dim + d] + tol < b[0 * dim + d] || b[1 * dim + d] + tol < a[0 * dim + d]) return PETSC_F… in IntersectBoundingBox_Internal() 27 …Bool InBoundingBox_Internal(PetscInt dim, const PetscReal *x, const PetscReal *bbox, PetscReal tol) in InBoundingBox_Internal() argument 30 if (x[d] + tol < bbox[0 * dim + d] || bbox[1 * dim + d] + tol < x[d]) return PETSC_FALSE; in InBoundingBox_Internal() 118 …tes(PetscSF sf, PetscInt nroots, PetscInt nleaves, PetscInt dim, PetscReal tol, const PetscReal ro… in PetscSFSetGraphFromCoordinates() argument 131 PetscValidLogicalCollectiveReal(sf, tol, 5); in PetscSFSetGraphFromCoordinates() 148 if (IntersectBoundingBox_Internal(dim, bbox, &bboxes[2 * dim * r], tol)) { in PetscSFSetGraphFromCoordinates() 175 if (InBoundingBox_Internal(dim, &target_coords[i * dim], bbox, tol)) { in PetscSFSetGraphFromCoordinates() 191 …PetscCall(PetscKDTreeQueryPointsNearestNeighbor(tree, nleaves, leafcoords, tol, indices, distances… in PetscSFSetGraphFromCoordinates() 193 if (distances[i] < tol) { in PetscSFSetGraphFromCoordinates()
|
| /petsc/src/dm/impls/plex/tests/ |
| H A D | ex33.c | 8 PetscReal tol; /* Tolerance for volume check */ member 15 options->tol = PETSC_SMALL; in ProcessOptions() 19 …nsReal("-tol", "The tolerance for the volume check", "ex33.c", options->tol, &options->tol, NULL)); in ProcessOptions() 64 PetscReal vol, tol = ctx->tol; in CheckVolume() local 72 …tol, PetscObjectComm((PetscObject)dm), PETSC_ERR_PLIB, "Calculated volume %g != %g actual volume (… in CheckVolume()
|
| H A D | ex99.c | 60 static PetscErrorCode CheckIntegral(DM dm, PetscReal integral, PetscReal tol) in CheckIntegral() argument 71 if (integral > 0 && PetscAbsReal(integral - rval) > tol) { in CheckIntegral() 72 …> %g tol)\n", (double)rval, (double)integral, (double)PetscAbsReal(integral - rval), (double)tol)); in CheckIntegral() 147 PetscReal integral = 0, tol = (PetscReal)1.0e-4; in main() local 149 PetscCall(PetscOptionsGetReal(NULL, NULL, "-tol", &tol, NULL)); in main() 152 PetscCall(CheckIntegral(dm, integral, tol)); in main()
|
| /petsc/src/dm/impls/plex/tutorials/ |
| H A D | ex9.c | 7 PetscReal condLimit, tol; /* Condition number limit for cell output */ member 14 options->tol = 0.5; in ProcessOptions() 20 …l_atol", "Absolute tolerance for Orthogonal Quality", "ex9.c", options->tol, &options->tol, NULL)); in ProcessOptions() 48 PetscCall(DMPlexComputeOrthogonalQuality(dm, NULL, ctx.tol, &OQ, &OQLabel)); in main()
|
| /petsc/src/mat/tests/ |
| H A D | ex53.c | 12 PetscReal s1norm, s2norm, rnorm, tol = 1.e-10; in main() local 51 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] Error: MatNorm_FROBENIUS()- NormA=%1… in main() 55 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] Error: MatNorm_INFINITY()- NormA=%16… in main() 59 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] Error: MatNorm_NORM_1()- NormA=%16.1… in main() 68 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] Error: MatMult - Norm2=%16.14e bs = … in main() 79 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] Error: MatMultAdd - Norm2=%16.14e bs… in main() 90 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] Error: MatMultTransp… in main() 101 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] Error: MatMultTransp… in main() 157 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] Error in MatConvert:… in main() 171 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] Error in MatConvert:… in main()
|
| H A D | ex48.c | 13 PetscReal s1norm, s2norm, rnorm, tol = 1.e-4; in main() local 71 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatNorm_FROBENIUS()- NormA=%16.14e… in main() 75 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatNorm_INFINITY()- NormA=%16.14e … in main() 79 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatNorm_NORM_1()- NormA=%16.14e No… in main() 115 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "MatMult not equal to MatM… in main() 173 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatForwardSolve/Mat… in main() 188 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatSolveAdd - Norm1… in main() 201 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatSolveAdd(same) -… in main() 212 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatSolve - Norm1=%1… in main() 224 …if (rnorm < -tol || rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatSolveTranspose -… in main()
|
| H A D | ex204.c | 52 const PetscReal tol = 1e-5; in main() local 87 …tol, PETSC_COMM_WORLD, PETSC_ERR_ARG_INCOMP, "Sequential CPU and MPI ViennaCL vector results incom… in main() 105 const PetscReal tol = 1e-5; in main() local 140 …<= tol, PETSC_COMM_WORLD, PETSC_ERR_ARG_INCOMP, "MPI CPU and MPI ViennaCL Vector results incompati… in main() 157 const PetscReal tol = 1e-5; in main() local 191 …<= tol, PETSC_COMM_WORLD, PETSC_ERR_ARG_INCOMP, "MPI CPU and MPI ViennaCL Vector results incompati… in main() 209 const PetscReal tol = 1e-5; in main() local 243 …<= tol, PETSC_COMM_WORLD, PETSC_ERR_ARG_INCOMP, "MPI CPU and MPI ViennaCL Vector results incompati… in main()
|
| H A D | ex75.c | 10 PetscReal r1, r2, rnorm, tol = PETSC_SQRT_MACHINE_EPSILON; in main() local 171 …if (rnorm > tol && rank == 0) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatNorm_FROBENIUS(), … in main() 175 …if (rnorm > tol && rank == 0) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Error: MatNorm_INFINITY(), … in main() 179 …if (rnorm > tol && rank == 0) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Error: MatNorm_1(), Anorm=%… in main() 203 if (r1 < -tol || r1 > tol) { in main() 218 if (r1 < -tol || r1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatGetRowMaxAbs() \n")); in main() 241 if (r1 < -tol || r1 > tol) { in main() 254 if (r1 < -tol || r1 > tol) { in main()
|
| H A D | ex74.c | 12 PetscReal norm1, norm2, rnorm, tol = 10 * PETSC_SMALL; in main() local 191 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatNorm_FROBENIUS, NormA=%16.14e N… in main() 195 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatNorm_INFINITY(), NormA=%16.14e … in main() 199 …if (rnorm > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatNorm_INFINITY(), NormA=%16.14e … in main() 240 …if (norm1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatGetDiagonal(), ||s1-s2||=%g\n", … in main() 255 …if (norm1 < -tol || norm1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatGetRowMaxAbs() \… in main() 265 …if (norm1 < -tol || norm1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatMult(), norm1-n… in main() 277 …if (norm1 < -tol || norm1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatMultAdd(), norm1… in main() 292 norm1 = tol; in main() 342 if (norm2 < tol && lf != -1) break; in main() [all …]
|
| H A D | ex1.c | 93 PetscReal norm, tol = PETSC_SMALL; in main() local 135 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Warning: Norm of error for in-place Chole… in main() 141 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Error: Norm of residual for in-place Chol… in main() 154 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Warning: Norm of error for out-of-place C… in main() 171 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Warning: Norm of error for in-place LU %g… in main() 176 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Error: Norm of residual for in-place LU (… in main() 188 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Warning: Norm of error for out-of-place L… in main() 218 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Warning: Norm of error for in-place QR %g… in main() 224 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Error: Norm of error for in-place QR (Mat… in main() 236 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Warning: Norm of error for out-of-place Q… in main() [all …]
|
| H A D | ex77.c | 18 PetscReal norm1, norm2, tol = 10 * PETSC_SMALL; in main() local 157 …if (norm1 < -tol || norm1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatNorm(), fnorm1-… in main() 161 …if (norm1 < -tol || norm1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatNorm(), inf_nor… in main() 197 …if (norm1 < -tol || norm1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatGetDiagonal() \n… in main() 210 …if (norm1 < -tol || norm1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error: MatMult(), MatDiag… in main() 221 …if (norm1 < -tol || norm1 > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Error:MatMultAdd(), MatDi… in main()
|
| H A D | ex27.c | 10 PetscReal nrm, tol = 10 * PETSC_SMALL; in main() local 26 …if (nrm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Error: MatNorm(), norm1=: %g\n", (double)n… in main() 35 …if (nrm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Error: MatNorm(), norm1=: %g\n", (double)n… in main()
|
| H A D | ex222.c | 56 PetscReal err, tol = PETSC_SMALL; in main() local 58 PetscCall(PetscOptionsGetReal(NULL, NULL, "-tol", &tol, NULL)); in main() 62 …if (err > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Error %g > %g (type %s)\n", (double)err, (… in main()
|
| H A D | ex267.c | 11 PetscReal norm, tol = 1000 * PETSC_MACHINE_EPSILON; in TestMatrix() local 48 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "%12s MatSolve : Error of nor… in TestMatrix() 56 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "%12s MatSolveTranspose : Error of nor… in TestMatrix() 66 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "%12s MatSolveAdd : Error of nor… in TestMatrix() 76 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "%12s MatSolveTransposeAdd : Error of nor… in TestMatrix() 95 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "%12s MatMatSolve : Error of nor… in TestMatrix() 102 …if (norm > tol) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "%12s MatMatSolveTranspose : Error of nor… in TestMatrix()
|
| /petsc/src/ts/event/tests/output/ |
| H A D | ex16_1.out | 1 [0] TSEvent: iter 0 - Event 0 zero crossing located at time 1.1 (tol=1e-06) 3 [0] TSEvent: iter 0 - Event 1 zero crossing located at time 1.2 (tol=1e-06) 5 [0] TSEvent: iter 0 - Event 2 zero crossing located at time 1.3 (tol=1e-06)
|
| H A D | ex16_2.out | 2 [0] TSEvent: iter 1 - Event 0 zero crossing located at time 1.1 (tol=1e-06) 4 [0] TSEvent: iter 0 - Event 1 zero crossing located at time 1.2 (tol=1e-06) 7 [0] TSEvent: iter 1 - Event 2 zero crossing located at time 1.3 (tol=1e-06)
|
| H A D | ex16_3.out | 4 [0] TSEvent: iter 1 - Event 0 zero crossing located at time 1.1 (tol=1e-06) 8 [0] TSEvent: iter 1 - Event 1 zero crossing located at time 1.2 (tol=1e-06) 11 [0] TSEvent: iter 1 - Event 2 zero crossing located at time 1.3 (tol=1e-06)
|
| /petsc/src/ksp/ksp/tests/raja/ |
| H A D | ex1.raja.cxx | 110 double tol = 1e-10; in main() local 137 while (resI2 > tol * tol) { in main() 194 while (resI2 > tol * tol) { in main() 241 while (resI2 > tol * tol) { in main() 291 while (resI2 > tol * tol) { in main() 353 while (resI2 > tol * tol) { in main()
|
| /petsc/src/dm/impls/forest/tests/ |
| H A D | ex2.c | 78 static PetscErrorCode IdentifyBadPoints(DM dm, Vec vec, PetscReal tol) in IdentifyBadPoints() argument 105 if (absDiff > tol) { in IdentifyBadPoints() 125 … if (absDiff > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, " Bad dof %" PetscInt_FMT "\n", c)); in IdentifyBadPoints() 143 PetscReal diff, tol = PETSC_SMALL; in main() local 168 tol = PetscMax(1.e-10, tol); /* XXX fix for quadruple precision -> why do I need to do this? */ in main() 262 if (diff < tol) { in main() 265 …DMForestTransferVecFromBase() fails with error %g and tolerance %g\n", (double)diff, (double)tol)); in main() 299 if (diff < tol) { in main() 302 …(comm, "DMForestTransferVec() fails with error %g and tolerance %g\n", (double)diff, (double)tol)); in main() 303 PetscCall(IdentifyBadPoints(postForest, postVecExact, tol)); in main() [all …]
|
| /petsc/src/mat/graphops/partition/impls/chaco/ |
| H A D | chaco.c | 484 PetscErrorCode MatPartitioningChacoSetEigenTol(MatPartitioning part, PetscReal tol) in MatPartitioningChacoSetEigenTol() argument 488 PetscValidLogicalCollectiveReal(part, tol, 2); in MatPartitioningChacoSetEigenTol() 489 …tscTryMethod(part, "MatPartitioningChacoSetEigenTol_C", (MatPartitioning, PetscReal), (part, tol)); in MatPartitioningChacoSetEigenTol() 493 static PetscErrorCode MatPartitioningChacoSetEigenTol_Chaco(MatPartitioning part, PetscReal tol) in MatPartitioningChacoSetEigenTol_Chaco() argument 498 if (tol == PETSC_DEFAULT) chaco->eigtol = 0.001; in MatPartitioningChacoSetEigenTol_Chaco() 500 …PetscCheck(tol > 0.0, PetscObjectComm((PetscObject)part), PETSC_ERR_ARG_OUTOFRANGE, "Tolerance mus… in MatPartitioningChacoSetEigenTol_Chaco() 501 chaco->eigtol = tol; in MatPartitioningChacoSetEigenTol_Chaco() 521 PetscErrorCode MatPartitioningChacoGetEigenTol(MatPartitioning part, PetscReal *tol) in MatPartitioningChacoGetEigenTol() argument 525 PetscAssertPointer(tol, 2); in MatPartitioningChacoGetEigenTol() 526 …cUseMethod(part, "MatPartitioningChacoGetEigenTol_C", (MatPartitioning, PetscReal *), (part, tol)); in MatPartitioningChacoGetEigenTol() [all …]
|