Lines Matching +full:- +full:d

29   PetscCall(DMViewFromOptions(*dm, NULL, "-dm_view"));  in ReadMesh()
39 options->runType = RUN_REFERENCE; in ProcessOptions()
40 options->transform = PETSC_FALSE; in ProcessOptions()
43 run = options->runType; in ProcessOptions()
44 …PetscCall(PetscOptionsEList("-run_type", "The run type", "ex8.c", runTypes, 3, runTypes[options->r… in ProcessOptions()
45 options->runType = (RunType)run; in ProcessOptions()
46 …PetscCall(PetscOptionsBool("-transform", "Use random transforms", "ex8.c", options->transform, &op… in ProcessOptions()
48 if (options->runType == RUN_FILE) { in ProcessOptions()
52 PetscCall(ReadMesh(PETSC_COMM_WORLD, options, &options->dm)); in ProcessOptions()
53 PetscCall(DMGetDimension(options->dm, &dim)); in ProcessOptions()
54 PetscCall(DMPlexGetHeightStratum(options->dm, 0, &cStart, &cEnd)); in ProcessOptions()
55 numCells = cEnd - cStart; in ProcessOptions()
56 …c4(numCells * dim, &options->v0, numCells * dim * dim, &options->J, numCells * dim * dim, &options in ProcessOptions()
57 PetscCall(PetscMalloc1(numCells * dim, &options->centroid)); in ProcessOptions()
58 PetscCall(PetscMalloc1(numCells * dim, &options->normal)); in ProcessOptions()
59 PetscCall(PetscMalloc1(numCells, &options->vol)); in ProcessOptions()
61 …PetscCall(PetscOptionsRealArray("-v0", "Input v0 for each cell", "ex8.c", options->v0, &n, &feFlg)… in ProcessOptions()
64 …PetscCall(PetscOptionsRealArray("-J", "Input Jacobian for each cell", "ex8.c", options->J, &n, &fl… in ProcessOptions()
67 …PetscCall(PetscOptionsRealArray("-invJ", "Input inverse Jacobian for each cell", "ex8.c", options- in ProcessOptions()
70 …PetscCall(PetscOptionsRealArray("-detJ", "Input Jacobian determinant for each cell", "ex8.c", opti… in ProcessOptions()
74 PetscCall(PetscFree4(options->v0, options->J, options->invJ, options->detJ)); in ProcessOptions()
75 options->v0 = options->J = options->invJ = options->detJ = NULL; in ProcessOptions()
77 …PetscCall(PetscOptionsRealArray("-centroid", "Input centroid for each cell", "ex8.c", options->cen… in ProcessOptions()
80 PetscCall(PetscFree(options->centroid)); in ProcessOptions()
81 options->centroid = NULL; in ProcessOptions()
84 …PetscCall(PetscOptionsRealArray("-normal", "Input normal for each cell", "ex8.c", options->normal,… in ProcessOptions()
87 PetscCall(PetscFree(options->normal)); in ProcessOptions()
88 options->normal = NULL; in ProcessOptions()
91 …PetscCall(PetscOptionsRealArray("-vol", "Input volume for each cell", "ex8.c", options->vol, &n, &… in ProcessOptions()
94 PetscCall(PetscFree(options->vol)); in ProcessOptions()
95 options->vol = NULL; in ProcessOptions()
97 } else if (options->runType == RUN_DISPLAY) { in ProcessOptions()
98 PetscCall(ReadMesh(PETSC_COMM_WORLD, options, &options->dm)); in ProcessOptions()
102 if (options->transform) PetscCall(PetscPrintf(comm, "Using random transforms\n")); in ProcessOptions()
111 PetscInt vStart, vEnd, v, d, coordSize; in ChangeCoordinates() local
134 for (d = 0; d < spaceDim; ++d) coords[off + d] = vertexCoords[(v - vStart) * spaceDim + d]; in ChangeCoordinates()
140 PetscCall(DMViewFromOptions(dm, NULL, "-dm_view")); in ChangeCoordinates()
144 #define RelativeError(a, b) PetscAbs(a - b) / (1.0 + PetscMax(PetscAbs(a), PetscAbs(b)))
149 PetscInt d, i, j; in CheckFEMGeometry() local
153 for (d = 0; d < spaceDim; ++d) { in CheckFEMGeometry()
154 if (v0[d] != v0Ex[d]) { in CheckFEMGeometry()
171 …ERR_PLIB, "Invalid |J| = %g != %g diff %g", (double)detJ, (double)detJEx, (double)(detJ - detJEx)); in CheckFEMGeometry()
177 PetscReal tol = PetscMax(10 * PETSC_SMALL, 1e-10); in CheckFVMGeometry()
179 PetscInt d; in CheckFVMGeometry() local
183 for (d = 0; d < spaceDim; ++d) { in CheckFVMGeometry()
185d], centroidEx[d]) < tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Cell %" PetscInt_FMT ", Invalid centro… in CheckFVMGeometry()
186d], normalEx[d]) < tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Cell %" PetscInt_FMT ", Invalid normal[%… in CheckFVMGeometry()
188 …MT ", Invalid volume = %g != %g diff %g", cell, (double)vol, (double)volEx, (double)(vol - volEx)); in CheckFVMGeometry()
195 PetscReal tol = PetscMax(10 * PETSC_SMALL, 1e-10); in CheckGaussLaw()
198 PetscInt coneSize, f, dim, cdim, d; in CheckGaussLaw() local
210 const PetscInt sgn = dim == 1 ? (f == 0 ? -1 : 1) : (ornt[f] < 0 ? -1 : 1); in CheckGaussLaw()
213 for (d = 0; d < cdim; ++d) integral[d] += sgn * area * normal[d]; in CheckGaussLaw()
215 for (d = 0; d < cdim; ++d) in CheckGaussLaw()
216d]) < tol, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Cell %" PetscInt_FMT " Surface integral for component… in CheckGaussLaw()
272 PetscInt d, e, f, p; in CheckCell() local
278 for (d = 0; d < cdim; ++d) PetscCall(PetscRandomGetValue(r, &trans[d])); in CheckCell()
282 R[1] = -PetscSinReal(phi); in CheckCell()
291 R[1] = sp * st * cs - cp * ss; in CheckCell()
295 R[5] = cp * st * ss - sp * cs; in CheckCell()
296 R[6] = -st; in CheckCell()
306 for (d = 0; d < cdim; ++d) { in CheckCell()
307 v0ExT[d] = v0Ex[d]; in CheckCell()
309 JExT[d * cdim + e] = JEx[d * cdim + e]; in CheckCell()
310 invJExT[d * cdim + e] = invJEx[d * cdim + e]; in CheckCell()
313 for (d = 0; d < cdim; ++d) { in CheckCell()
314 v0ExT[d] *= scale; in CheckCell()
315 v0ExT[d] += PetscRealPart(trans[d]); in CheckCell()
318 JExT[d * cdim + e] *= scale; in CheckCell()
319 invJExT[d * cdim + e] /= scale; in CheckCell()
321 if (d < dim) detJExT *= scale; in CheckCell()
324 for (d = 0; d < cdim; ++d) { in CheckCell()
325 for (e = 0, rot[d] = 0.0; e < cdim; ++e) rot[d] += R[d * cdim + e] * v0ExT[e]; in CheckCell()
327 for (d = 0; d < cdim; ++d) v0ExT[d] = rot[d]; in CheckCell()
328 for (d = 0; d < cdim; ++d) { in CheckCell()
330 …for (f = 0, rotM[d * cdim + e] = 0.0; f < cdim; ++f) rotM[d * cdim + e] += R[d * cdim + f] * JExT[… in CheckCell()
333 for (d = 0; d < cdim; ++d) { in CheckCell()
334 for (e = 0; e < cdim; ++e) JExT[d * cdim + e] = rotM[d * cdim + e]; in CheckCell()
336 for (d = 0; d < cdim; ++d) { in CheckCell()
338 …for (f = 0, rotM[d * cdim + e] = 0.0; f < cdim; ++f) rotM[d * cdim + e] += invJExT[d * cdim + f] *… in CheckCell()
341 for (d = 0; d < cdim; ++d) { in CheckCell()
342 for (e = 0; e < cdim; ++e) invJExT[d * cdim + e] = rotM[d * cdim + e]; in CheckCell()
347 for (d = 0; d < cdim; ++d) { in CheckCell()
348 centroidExT[d] = centroidEx[d]; in CheckCell()
349 normalExT[d] = normalEx[d]; in CheckCell()
351 for (d = 0; d < cdim; ++d) { in CheckCell()
352 centroidExT[d] *= scale; in CheckCell()
353 centroidExT[d] += PetscRealPart(trans[d]); in CheckCell()
354 normalExT[d] /= scale; in CheckCell()
356 if (d < dim) volExT *= scale; in CheckCell()
359 for (d = 0; d < cdim; ++d) { in CheckCell()
360 for (e = 0, rot[d] = 0.0; e < cdim; ++e) rot[d] += R[d * cdim + e] * centroidExT[e]; in CheckCell()
362 for (d = 0; d < cdim; ++d) centroidExT[d] = rot[d]; in CheckCell()
363 for (d = 0; d < cdim; ++d) { in CheckCell()
364 for (e = 0, rot[d] = 0.0; e < cdim; ++e) rot[d] += R[d * cdim + e] * normalExT[e]; in CheckCell()
366 for (d = 0; d < cdim; ++d) normalExT[d] = rot[d]; in CheckCell()
367 for (d = 0, norm = 0.0; d < cdim; ++d) norm += PetscSqr(normalExT[d]); in CheckCell()
370 for (d = 0; d < cdim; ++d) normalExT[d] /= norm; in CheckCell()
372 for (d = 0; d < cdim; ++d) { in CheckCell()
374 newCoords[p * cdim + d] *= scale; in CheckCell()
375 newCoords[p * cdim + d] += trans[d]; in CheckCell()
379 for (d = 0; d < cdim; ++d) { in CheckCell()
380 …for (e = 0, rot[d] = 0.0; e < cdim; ++e) rot[d] += R[d * cdim + e] * PetscRealPart(newCoords[p * c… in CheckCell()
382 for (d = 0; d < cdim; ++d) newCoords[p * cdim + d] = rot[d]; in CheckCell()
397 for (d = 0; d < cdim; ++d) { in CheckCell()
398 faceCentroidExT[d] = faceCentroidEx[off + d]; in CheckCell()
399 faceNormalExT[d] = faceNormalEx[off + d]; in CheckCell()
401 for (d = 0; d < cdim; ++d) { in CheckCell()
402 faceCentroidExT[d] *= scale; in CheckCell()
403 faceCentroidExT[d] += PetscRealPart(trans[d]); in CheckCell()
404 faceNormalExT[d] /= scale; in CheckCell()
406 if (d < dim - 1) faceVolExT *= scale; in CheckCell()
408 for (d = 0; d < cdim; ++d) { in CheckCell()
409 … for (e = 0, rot[d] = 0.0; e < cdim; ++e) rot[d] += R[d * cdim + e] * faceCentroidExT[e]; in CheckCell()
411 for (d = 0; d < cdim; ++d) faceCentroidExT[d] = rot[d]; in CheckCell()
412 for (d = 0; d < cdim; ++d) { in CheckCell()
413 for (e = 0, rot[d] = 0.0; e < cdim; ++e) rot[d] += R[d * cdim + e] * faceNormalExT[e]; in CheckCell()
415 for (d = 0; d < cdim; ++d) faceNormalExT[d] = rot[d]; in CheckCell()
416 for (d = 0, norm = 0.0; d < cdim; ++d) norm += PetscSqr(faceNormalExT[d]); in CheckCell()
418 for (d = 0; d < cdim; ++d) faceNormalExT[d] /= norm; in CheckCell()
441 PetscCall(DMViewFromOptions(dm, NULL, "-dm_view")); in TestTriangle()
444 PetscReal v0Ex[2] = {-1.0, -1.0}; in TestTriangle()
448 …PetscReal centroidEx[2] = {-((PetscReal)1.) / ((PetscReal)3.), -((PetscReal)1.) / ((PetscReal)3.)}; in TestTriangle()
454 /* Move to 3D: Check reference geometry: determinant is scaled by reference volume (2.0) */ in TestTriangle()
456 PetscScalar vertexCoords[9] = {-1.0, -1.0, 0.0, 1.0, -1.0, 0.0, -1.0, 1.0, 0.0}; in TestTriangle()
457 PetscReal v0Ex[3] = {-1.0, -1.0, 0.0}; in TestTriangle()
461 …PetscReal centroidEx[3] = {-((PetscReal)1.) / ((PetscReal)3.), -((PetscReal)1.) / ((PetscReal)… in TestTriangle()
479 PetscCall(DMViewFromOptions(dm, NULL, "-dm_view")); in TestQuadrilateral()
482 PetscReal v0Ex[2] = {-1.0, -1.0}; in TestQuadrilateral()
492 /* Move to 3D: Check reference geometry: determinant is scaled by reference volume (4.0) */ in TestQuadrilateral()
494 PetscScalar vertexCoords[12] = {-1.0, -1.0, 0.0, 1.0, -1.0, 0.0, 1.0, 1.0, 0.0, -1.0, 1.0, 0.0}; in TestQuadrilateral()
495 PetscReal v0Ex[3] = {-1.0, -1.0, 0.0}; in TestQuadrilateral()
517 PetscCall(DMViewFromOptions(dm, NULL, "-dm_view")); in TestTetrahedron()
520 PetscReal v0Ex[3] = {-1.0, -1.0, -1.0}; in TestTetrahedron()
524 PetscReal centroidEx[3] = {-0.5, -0.5, -0.5}; in TestTetrahedron()
541 PetscCall(DMViewFromOptions(dm, NULL, "-dm_view")); in TestHexahedron()
544 PetscReal v0Ex[3] = {-1.0, -1.0, -1.0}; in TestHexahedron()
562 …lar coords[24] = {-1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, … in TestHexahedronCurved()
567 PetscCall(DMViewFromOptions(dm, NULL, "-dm_view")); in TestHexahedronCurved()
586 PetscCall(DMViewFromOptions(dm, NULL, "-dm_view")); in TestWedge()
591 PetscReal v0Ex[3] = {-1.0, -1.0, -1.0}; in TestWedge()
598 …PetscReal centroidEx[3] = {-((PetscReal)1.) / ((PetscReal)3.), -((PetscReal)1.) / ((PetscReal… in TestWedge()
602 …alEx[15] = {0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, -1.0, 0.0, PETSC_SQRT2 / 2.0, PETSC_SQRT2 / 2.0, … in TestWedge()
603-((PetscReal)1.) / ((PetscReal)3.), -((PetscReal)1.) / ((PetscReal)3.), -1.0, -((PetscReal)1.) / (… in TestWedge()
633 for (c = 0; c < cEnd - cStart; ++c) { in main()
653 PetscInt dim, d, cStart, cEnd, cEndInterior, c; in main() local
667 for (c = 0; c < cEnd - cStart; ++c) { in main()
672 for (d = 0; d < dim; ++d) { in main()
673 if (d > 0) PetscCall(PetscPrintf(PETSC_COMM_SELF, ", ")); in main()
674 PetscCall(PetscPrintf(PETSC_COMM_SELF, "%12.2g", (double)cg->centroid[d])); in main()
676 PetscCall(PetscPrintf(PETSC_COMM_SELF, ") Vol %12.2g\n", (double)cg->volume)); in main()
691 args: -dm_view ascii::ascii_info_detail
694 args: -run_type hex_curved
698 args: -transform
702-run_type file -dm_plex_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/simpleblock-100.exo -d…
705-run_type file -dm_plex_dim 3 -dm_plex_simplex 0 -dm_plex_box_faces 3,1,1 -dm_plex_box_lower -1.5,
708-run_type file -dm_plex_dim 1 -dm_plex_simplex 0 -dm_plex_box_faces 3 -dm_plex_box_lower -1.5 -dm_…