Lines Matching refs:dim
205 static PetscErrorCode DMPlexGetPlaneSimplexIntersection_Coords_Internal(DM dm, PetscInt dim, PetscI… in DMPlexGetPlaneSimplexIntersection_Coords_Internal() argument
220 for (PetscInt v = 0; v < dim + 1; ++v) { in DMPlexGetPlaneSimplexIntersection_Coords_Internal()
235 for (v = 0; v < dim + 1; ++v) in DMPlexGetPlaneSimplexIntersection_Coords_Internal()
237 if (v == dim + 1) PetscFunctionReturn(PETSC_SUCCESS); in DMPlexGetPlaneSimplexIntersection_Coords_Internal()
238 for (v = 0; v < dim + 1; ++v) in DMPlexGetPlaneSimplexIntersection_Coords_Internal()
240 if (v == dim + 1) { in DMPlexGetPlaneSimplexIntersection_Coords_Internal()
246 for (PetscInt v = 0; v < dim + 1; ++v) { in DMPlexGetPlaneSimplexIntersection_Coords_Internal()
255 for (PetscInt w = v + 1; w < dim + 1; ++w) { in DMPlexGetPlaneSimplexIntersection_Coords_Internal()
269 static PetscErrorCode DMPlexGetPlaneSimplexIntersection_Internal(DM dm, PetscInt dim, PetscInt c, c… in DMPlexGetPlaneSimplexIntersection_Internal() argument
279 …heck(cdim == dim, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "DM has coordinates in %" PetscInt_FMT "D … in DMPlexGetPlaneSimplexIntersection_Internal()
281 …s == dim * (dim + 1), PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Tetrahedron should have %" PetscInt_F… in DMPlexGetPlaneSimplexIntersection_Internal()
282 PetscCall(PetscArrayzero(intPoints, dim * (dim + 1))); in DMPlexGetPlaneSimplexIntersection_Internal()
284 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, coords, p, normal, pos,… in DMPlexGetPlaneSimplexIntersection_Internal()
290 static PetscErrorCode DMPlexGetPlaneQuadIntersection_Internal(DM dm, PetscInt dim, PetscInt c, cons… in DMPlexGetPlaneQuadIntersection_Internal() argument
304 …heck(cdim == dim, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "DM has coordinates in %" PetscInt_FMT "D … in DMPlexGetPlaneQuadIntersection_Internal()
306 …umCoords == dim * 4, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Quadrilateral should have %" PetscInt_… in DMPlexGetPlaneQuadIntersection_Internal()
307 PetscCall(PetscArrayzero(intPoints, dim * 4)); in DMPlexGetPlaneQuadIntersection_Internal()
311 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, tcoords, p, normal, pos… in DMPlexGetPlaneQuadIntersection_Internal()
314 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, tcoords, p, normal, pos… in DMPlexGetPlaneQuadIntersection_Internal()
321 static PetscErrorCode DMPlexGetPlaneHexIntersection_Internal(DM dm, PetscInt dim, PetscInt c, const… in DMPlexGetPlaneHexIntersection_Internal() argument
340 …heck(cdim == dim, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "DM has coordinates in %" PetscInt_FMT "D … in DMPlexGetPlaneHexIntersection_Internal()
342 …numCoords == dim * 8, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Hexahedron should have %" PetscInt_FM… in DMPlexGetPlaneHexIntersection_Internal()
343 PetscCall(PetscArrayzero(intPoints, dim * 18)); in DMPlexGetPlaneHexIntersection_Internal()
347 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, tcoords, p, normal, pos… in DMPlexGetPlaneHexIntersection_Internal()
351 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, tcoords, p, normal, pos… in DMPlexGetPlaneHexIntersection_Internal()
355 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, tcoords, p, normal, pos… in DMPlexGetPlaneHexIntersection_Internal()
359 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, tcoords, p, normal, pos… in DMPlexGetPlaneHexIntersection_Internal()
363 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, tcoords, p, normal, pos… in DMPlexGetPlaneHexIntersection_Internal()
367 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, tcoords, p, normal, pos… in DMPlexGetPlaneHexIntersection_Internal()
688 static PetscErrorCode PetscGridHashInitialize_Internal(PetscGridHash box, PetscInt dim, const Petsc… in PetscGridHashInitialize_Internal() argument
693 box->dim = dim; in PetscGridHashInitialize_Internal()
694 for (d = 0; d < dim; ++d) box->lower[d] = box->upper[d] = point ? PetscRealPart(point[d]) : 0.; in PetscGridHashInitialize_Internal()
698 PetscErrorCode PetscGridHashCreate(MPI_Comm comm, PetscInt dim, const PetscScalar point[], PetscGri… in PetscGridHashCreate() argument
702 PetscCall(PetscGridHashInitialize_Internal(*box, dim, point)); in PetscGridHashCreate()
711 for (d = 0; d < box->dim; ++d) { in PetscGridHashEnlarge()
766 for (d = 0; d < box->dim; ++d) { in PetscGridHashSetGrid()
807 const PetscInt dim = box->dim; in PetscGridHashGetEnclosingBox() local
812 for (d = 0; d < dim; ++d) { in PetscGridHashGetEnclosingBox()
813 PetscInt dbox = PetscFloorReal((PetscRealPart(points[p * dim + d]) - lower[d]) / h[d]); in PetscGridHashGetEnclosingBox()
815 …if (dbox == n[d] && PetscAbsReal(PetscRealPart(points[p * dim + d]) - upper[d]) < 1.0e-9) dbox = n… in PetscGridHashGetEnclosingBox()
816 … if (dbox == -1 && PetscAbsReal(PetscRealPart(points[p * dim + d]) - lower[d]) < 1.0e-9) dbox = 0; in PetscGridHashGetEnclosingBox()
817 …alPart(points[p * dim + 0]), dim > 1 ? (double)PetscRealPart(points[p * dim + 1]) : 0.0, dim > 2 ?… in PetscGridHashGetEnclosingBox()
818 dboxes[p * dim + d] = dbox; in PetscGridHashGetEnclosingBox()
821 …for (d = dim - 2, boxes[p] = dboxes[p * dim + dim - 1]; d >= 0; --d) boxes[p] = boxes[p] * n[d] + … in PetscGridHashGetEnclosingBox()
855 const PetscInt dim = box->dim; in PetscGridHashGetEnclosingBoxQuery() local
863 for (d = 0; d < dim; ++d) { in PetscGridHashGetEnclosingBoxQuery()
864 PetscInt dbox = PetscFloorReal((PetscRealPart(points[p * dim + d]) - lower[d]) / h[d]); in PetscGridHashGetEnclosingBoxQuery()
866 …if (dbox == n[d] && PetscAbsReal(PetscRealPart(points[p * dim + d]) - upper[d]) < 1.0e-9) dbox = n… in PetscGridHashGetEnclosingBoxQuery()
868 dboxes[p * dim + d] = dbox; in PetscGridHashGetEnclosingBoxQuery()
871 …for (d = dim - 2, boxes[p] = dboxes[p * dim + dim - 1]; d >= 0; --d) boxes[p] = boxes[p] * n[d] + … in PetscGridHashGetEnclosingBoxQuery()
891 PetscErrorCode DMPlexLocatePoint_Internal(DM dm, PetscInt dim, const PetscScalar point[], PetscInt … in DMPlexLocatePoint_Internal() argument
922 static PetscErrorCode DMPlexClosestPoint_Internal(DM dm, PetscInt dim, const PetscScalar point[], P… in DMPlexClosestPoint_Internal() argument
1567 const PetscInt dim = 3; in DMPlexComputeProjection3Dto2D() local
1572 for (d = 0; d < dim; ++d) { in DMPlexComputeProjection3Dto2D()
1573 x1[d] = PetscRealPart(coords[1 * dim + d] - coords[0 * dim + d]); in DMPlexComputeProjection3Dto2D()
1574 x2[d] = PetscRealPart(coords[2 * dim + d] - coords[0 * dim + d]); in DMPlexComputeProjection3Dto2D()
1581 for (d = 0; d < dim; d++) n[d] /= norm; in DMPlexComputeProjection3Dto2D()
1583 for (d = 0; d < dim; d++) x1[d] /= norm; in DMPlexComputeProjection3Dto2D()
1588 for (d = 0; d < dim; d++) { in DMPlexComputeProjection3Dto2D()
1589 R[d * dim + 0] = x1[d]; in DMPlexComputeProjection3Dto2D()
1590 R[d * dim + 1] = x2[d]; in DMPlexComputeProjection3Dto2D()
1591 R[d * dim + 2] = n[d]; in DMPlexComputeProjection3Dto2D()
1592 c[d] = PetscRealPart(coords[0 * dim + d]); in DMPlexComputeProjection3Dto2D()
1594 for (p = 0; p < coordSize / dim; p++) { in DMPlexComputeProjection3Dto2D()
1596 for (d = 0; d < dim; d++) y[d] = PetscRealPart(coords[p * dim + d]) - c[d]; in DMPlexComputeProjection3Dto2D()
1597 …for (d = 0; d < 2; d++) coords[p * 2 + d] = R[0 * dim + d] * y[0] + R[1 * dim + d] * y[1] + R[2 * … in DMPlexComputeProjection3Dto2D()
1673 PetscInt dim, d, off; in DMPlexComputePointGeometry_Internal() local
1678 PetscCall(PetscSectionGetDof(coordSection, e, &dim)); in DMPlexComputePointGeometry_Internal()
1679 if (!dim) PetscFunctionReturn(PETSC_SUCCESS); in DMPlexComputePointGeometry_Internal()
1683 for (d = 0; d < dim; d++) v0[d] = PetscRealPart(coords[off + d]); in DMPlexComputePointGeometry_Internal()
1688 for (d = 0; d < dim * dim; d++) J[d] = 0.; in DMPlexComputePointGeometry_Internal()
1689 for (d = 0; d < dim; d++) J[d * dim + d] = 1.; in DMPlexComputePointGeometry_Internal()
1691 for (d = 0; d < dim * dim; d++) invJ[d] = 0.; in DMPlexComputePointGeometry_Internal()
1692 for (d = 0; d < dim; d++) invJ[d * dim + d] = 1.; in DMPlexComputePointGeometry_Internal()
1810 const PetscInt dim = 3; in DMPlexComputeLineGeometry_Internal() local
1814 for (d = 0; d < dim; d++) v0[d] = PetscRealPart(coords[d]); in DMPlexComputeLineGeometry_Internal()
1832 const PetscInt dim = 2; in DMPlexComputeLineGeometry_Internal() local
1836 for (d = 0; d < dim; d++) v0[d] = PetscRealPart(coords[d]); in DMPlexComputeLineGeometry_Internal()
1849 const PetscInt dim = 1; in DMPlexComputeLineGeometry_Internal() local
1852 for (d = 0; d < dim; d++) v0[d] = PetscRealPart(coords[d]); in DMPlexComputeLineGeometry_Internal()
1880 const PetscInt dim = 3; in DMPlexComputeTriangleGeometry_Internal() local
1884 for (d = 0; d < dim; d++) v0[d] = PetscRealPart(coords[d]); in DMPlexComputeTriangleGeometry_Internal()
1891 …for (PetscInt f = 0; f < pdim; f++) J0[d * dim + f] = 0.5 * (PetscRealPart(coords[(f + 1) * pdim +… in DMPlexComputeTriangleGeometry_Internal()
1895 for (d = 0; d < dim; d++) { in DMPlexComputeTriangleGeometry_Internal()
1896 for (PetscInt f = 0; f < dim; f++) { in DMPlexComputeTriangleGeometry_Internal()
1897 J[d * dim + f] = 0.0; in DMPlexComputeTriangleGeometry_Internal()
1898 for (PetscInt g = 0; g < dim; g++) J[d * dim + f] += R[d * dim + g] * J0[g * dim + f]; in DMPlexComputeTriangleGeometry_Internal()
1905 const PetscInt dim = 2; in DMPlexComputeTriangleGeometry_Internal() local
1908 for (d = 0; d < dim; d++) v0[d] = PetscRealPart(coords[d]); in DMPlexComputeTriangleGeometry_Internal()
1911 for (d = 0; d < dim; d++) { in DMPlexComputeTriangleGeometry_Internal()
1912 …or (PetscInt f = 0; f < dim; f++) J[d * dim + f] = 0.5 * (PetscRealPart(coords[(f + 1) * dim + d])… in DMPlexComputeTriangleGeometry_Internal()
1942 const PetscInt dim = 3; in DMPlexComputeRectangleGeometry_Internal() local
1946 for (d = 0; d < dim; d++) v[d] = PetscRealPart(coords[d]); in DMPlexComputeRectangleGeometry_Internal()
1953 …J0[d * dim + 0] = 0.5 * (PetscRealPart(coords[vorder[1] * pdim + d]) - PetscRealPart(coords[vorder… in DMPlexComputeRectangleGeometry_Internal()
1954 …J0[d * dim + 1] = 0.5 * (PetscRealPart(coords[vorder[2] * pdim + d]) - PetscRealPart(coords[vorder… in DMPlexComputeRectangleGeometry_Internal()
1958 for (d = 0; d < dim; d++) { in DMPlexComputeRectangleGeometry_Internal()
1959 for (PetscInt f = 0; f < dim; f++) { in DMPlexComputeRectangleGeometry_Internal()
1960 J[d * dim + f] = 0.0; in DMPlexComputeRectangleGeometry_Internal()
1961 for (PetscInt g = 0; g < dim; g++) J[d * dim + f] += R[d * dim + g] * J0[g * dim + f]; in DMPlexComputeRectangleGeometry_Internal()
1968 const PetscInt dim = 2; in DMPlexComputeRectangleGeometry_Internal() local
1971 for (d = 0; d < dim; d++) v[d] = PetscRealPart(coords[d]); in DMPlexComputeRectangleGeometry_Internal()
1974 for (d = 0; d < dim; d++) { in DMPlexComputeRectangleGeometry_Internal()
1975 …J[d * dim + 0] = 0.5 * (PetscRealPart(coords[vorder[1] * dim + d]) - PetscRealPart(coords[vorder[0… in DMPlexComputeRectangleGeometry_Internal()
1976 …J[d * dim + 1] = 0.5 * (PetscRealPart(coords[vorder[3] * dim + d]) - PetscRealPart(coords[vorder[0… in DMPlexComputeRectangleGeometry_Internal()
1989 PetscInt i, j, k, l, dim; in DMPlexComputeRectangleGeometry_Internal() local
1996 dim = 3; in DMPlexComputeRectangleGeometry_Internal()
1998 dim = 2; in DMPlexComputeRectangleGeometry_Internal()
2003 for (j = 0; j < dim; j++) zOrder[dim * i + j] = PetscRealPart(coords[dim * zi + j]); in DMPlexComputeRectangleGeometry_Internal()
2005 for (j = 0; j < dim; j++) { in DMPlexComputeRectangleGeometry_Internal()
2012 …zCoeff[dim * 0 + j] = 0.25 * (zOrder[dim * 0 + j] + zOrder[dim * 1 + j] + zOrder[dim * 2 + j] + zO… in DMPlexComputeRectangleGeometry_Internal()
2013 …zCoeff[dim * 1 + j] = 0.25 * (-zOrder[dim * 0 + j] + zOrder[dim * 1 + j] - zOrder[dim * 2 + j] + z… in DMPlexComputeRectangleGeometry_Internal()
2014 …zCoeff[dim * 2 + j] = 0.25 * (-zOrder[dim * 0 + j] - zOrder[dim * 1 + j] + zOrder[dim * 2 + j] + z… in DMPlexComputeRectangleGeometry_Internal()
2015 …zCoeff[dim * 3 + j] = 0.25 * (zOrder[dim * 0 + j] - zOrder[dim * 1 + j] - zOrder[dim * 2 + j] + zO… in DMPlexComputeRectangleGeometry_Internal()
2027 for (j = 0; j < dim; j++) { in DMPlexComputeRectangleGeometry_Internal()
2030 for (k = 0; k < Nv; k++) val += extPoint[k] * zCoeff[dim * k + j]; in DMPlexComputeRectangleGeometry_Internal()
2031 v[i * dim + j] = val; in DMPlexComputeRectangleGeometry_Internal()
2045 for (j = 0; j < dim; j++) { in DMPlexComputeRectangleGeometry_Internal()
2049 for (l = 0; l < Nv; l++) val += zCoeff[dim * l + j] * extJ[dimR * l + k]; in DMPlexComputeRectangleGeometry_Internal()
2050 J[i * dim * dim + dim * j + k] = val; in DMPlexComputeRectangleGeometry_Internal()
2053 if (dim == 3) { /* put the cross product in the third component of the Jacobian */ in DMPlexComputeRectangleGeometry_Internal()
2055 PetscReal *iJ = &J[i * dim * dim]; in DMPlexComputeRectangleGeometry_Internal()
2058 x = iJ[1 * dim + 0] * iJ[2 * dim + 1] - iJ[1 * dim + 1] * iJ[2 * dim + 0]; in DMPlexComputeRectangleGeometry_Internal()
2059 y = iJ[0 * dim + 1] * iJ[2 * dim + 0] - iJ[0 * dim + 0] * iJ[2 * dim + 1]; in DMPlexComputeRectangleGeometry_Internal()
2060 z = iJ[0 * dim + 0] * iJ[1 * dim + 1] - iJ[0 * dim + 1] * iJ[1 * dim + 0]; in DMPlexComputeRectangleGeometry_Internal()
2065 DMPlex_Det3D_Internal(&detJ[i], &J[i * dim * dim]); in DMPlexComputeRectangleGeometry_Internal()
2066 if (invJ) DMPlex_Invert3D_Internal(&invJ[i * dim * dim], &J[i * dim * dim], detJ[i]); in DMPlexComputeRectangleGeometry_Internal()
2068 DMPlex_Det2D_Internal(&detJ[i], &J[i * dim * dim]); in DMPlexComputeRectangleGeometry_Internal()
2069 if (invJ) DMPlex_Invert2D_Internal(&invJ[i * dim * dim], &J[i * dim * dim], detJ[i]); in DMPlexComputeRectangleGeometry_Internal()
2082 const PetscInt dim = 3; in DMPlexComputeTetrahedronGeometry_Internal() local
2091 for (d = 0; d < dim; d++) v0[d] = PetscRealPart(coords[d]); in DMPlexComputeTetrahedronGeometry_Internal()
2094 for (d = 0; d < dim; d++) { in DMPlexComputeTetrahedronGeometry_Internal()
2096 … J[d * dim + 0] = 0.5 * (PetscRealPart(coords[2 * dim + d]) - PetscRealPart(coords[0 * dim + d])); in DMPlexComputeTetrahedronGeometry_Internal()
2097 … J[d * dim + 1] = 0.5 * (PetscRealPart(coords[1 * dim + d]) - PetscRealPart(coords[0 * dim + d])); in DMPlexComputeTetrahedronGeometry_Internal()
2098 … J[d * dim + 2] = 0.5 * (PetscRealPart(coords[3 * dim + d]) - PetscRealPart(coords[0 * dim + d])); in DMPlexComputeTetrahedronGeometry_Internal()
2112 const PetscInt dim = 3; in DMPlexComputeHexahedronGeometry_Internal() local
2122 for (d = 0; d < dim; d++) v[d] = PetscRealPart(coords[d]); in DMPlexComputeHexahedronGeometry_Internal()
2125 for (d = 0; d < dim; d++) { in DMPlexComputeHexahedronGeometry_Internal()
2126 … J[d * dim + 0] = 0.5 * (PetscRealPart(coords[3 * dim + d]) - PetscRealPart(coords[0 * dim + d])); in DMPlexComputeHexahedronGeometry_Internal()
2127 … J[d * dim + 1] = 0.5 * (PetscRealPart(coords[1 * dim + d]) - PetscRealPart(coords[0 * dim + d])); in DMPlexComputeHexahedronGeometry_Internal()
2128 … J[d * dim + 2] = 0.5 * (PetscRealPart(coords[4 * dim + d]) - PetscRealPart(coords[0 * dim + d])); in DMPlexComputeHexahedronGeometry_Internal()
2137 const PetscInt dim = 3; in DMPlexComputeHexahedronGeometry_Internal() local
2146 for (j = 0; j < dim; j++) zOrder[dim * i + j] = PetscRealPart(coords[dim * zi + j]); in DMPlexComputeHexahedronGeometry_Internal()
2148 for (j = 0; j < dim; j++) { in DMPlexComputeHexahedronGeometry_Internal()
2149 …dim * 0 + j] = 0.125 * (zOrder[dim * 0 + j] + zOrder[dim * 1 + j] + zOrder[dim * 2 + j] + zOrder[d… in DMPlexComputeHexahedronGeometry_Internal()
2150 …dim * 1 + j] = 0.125 * (-zOrder[dim * 0 + j] + zOrder[dim * 1 + j] - zOrder[dim * 2 + j] + zOrder[… in DMPlexComputeHexahedronGeometry_Internal()
2151 …dim * 2 + j] = 0.125 * (-zOrder[dim * 0 + j] - zOrder[dim * 1 + j] + zOrder[dim * 2 + j] + zOrder[… in DMPlexComputeHexahedronGeometry_Internal()
2152 …dim * 3 + j] = 0.125 * (zOrder[dim * 0 + j] - zOrder[dim * 1 + j] - zOrder[dim * 2 + j] + zOrder[d… in DMPlexComputeHexahedronGeometry_Internal()
2153 …dim * 4 + j] = 0.125 * (-zOrder[dim * 0 + j] - zOrder[dim * 1 + j] - zOrder[dim * 2 + j] - zOrder[… in DMPlexComputeHexahedronGeometry_Internal()
2154 …dim * 5 + j] = 0.125 * (+zOrder[dim * 0 + j] - zOrder[dim * 1 + j] + zOrder[dim * 2 + j] - zOrder[… in DMPlexComputeHexahedronGeometry_Internal()
2155 …dim * 6 + j] = 0.125 * (+zOrder[dim * 0 + j] + zOrder[dim * 1 + j] - zOrder[dim * 2 + j] - zOrder[… in DMPlexComputeHexahedronGeometry_Internal()
2156 …dim * 7 + j] = 0.125 * (-zOrder[dim * 0 + j] + zOrder[dim * 1 + j] + zOrder[dim * 2 + j] - zOrder[… in DMPlexComputeHexahedronGeometry_Internal()
2172 for (j = 0; j < dim; j++) { in DMPlexComputeHexahedronGeometry_Internal()
2175 for (k = 0; k < Nv; k++) val += extPoint[k] * zCoeff[dim * k + j]; in DMPlexComputeHexahedronGeometry_Internal()
2176 v[i * dim + j] = val; in DMPlexComputeHexahedronGeometry_Internal()
2207 for (j = 0; j < dim; j++) { in DMPlexComputeHexahedronGeometry_Internal()
2211 for (l = 0; l < Nv; l++) val += zCoeff[dim * l + j] * extJ[dimR * l + k]; in DMPlexComputeHexahedronGeometry_Internal()
2212 J[i * dim * dim + dim * j + k] = val; in DMPlexComputeHexahedronGeometry_Internal()
2215 DMPlex_Det3D_Internal(&detJ[i], &J[i * dim * dim]); in DMPlexComputeHexahedronGeometry_Internal()
2216 if (invJ) DMPlex_Invert3D_Internal(&invJ[i * dim * dim], &J[i * dim * dim], detJ[i]); in DMPlexComputeHexahedronGeometry_Internal()
2228 const PetscInt dim = 3; in DMPlexComputeTriangularPrismGeometry_Internal() local
2239 for (d = 0; d < dim; d++) v[d] = PetscRealPart(coords[d]); in DMPlexComputeTriangularPrismGeometry_Internal()
2242 for (d = 0; d < dim; d++) { in DMPlexComputeTriangularPrismGeometry_Internal()
2243 … J[d * dim + 0] = 0.5 * (PetscRealPart(coords[2 * dim + d]) - PetscRealPart(coords[0 * dim + d])); in DMPlexComputeTriangularPrismGeometry_Internal()
2244 … J[d * dim + 1] = 0.5 * (PetscRealPart(coords[1 * dim + d]) - PetscRealPart(coords[0 * dim + d])); in DMPlexComputeTriangularPrismGeometry_Internal()
2245 … J[d * dim + 2] = 0.5 * (PetscRealPart(coords[4 * dim + d]) - PetscRealPart(coords[0 * dim + d])); in DMPlexComputeTriangularPrismGeometry_Internal()
2252 const PetscInt dim = 3; in DMPlexComputeTriangularPrismGeometry_Internal() local
2260 for (j = 0; j < dim; ++j) verts[dim * i + j] = PetscRealPart(coords[dim * i + j]); in DMPlexComputeTriangularPrismGeometry_Internal()
2261 for (j = 0; j < dim; ++j) { in DMPlexComputeTriangularPrismGeometry_Internal()
2291 …coeff[dim * 0 + j] = (1. / 4.) * (verts[dim * 1 + j] + verts[dim * 2 + j] + verts[dim * 4 + j] + v… in DMPlexComputeTriangularPrismGeometry_Internal()
2292 …coeff[dim * 1 + j] = (1. / 4.) * (-verts[dim * 0 + j] + verts[dim * 1 + j] - verts[dim * 3 + j] + … in DMPlexComputeTriangularPrismGeometry_Internal()
2293 …coeff[dim * 2 + j] = (1. / 4.) * (-verts[dim * 0 + j] + verts[dim * 2 + j] - verts[dim * 3 + j] + … in DMPlexComputeTriangularPrismGeometry_Internal()
2294 …coeff[dim * 3 + j] = (1. / 4.) * (-verts[dim * 1 + j] - verts[dim * 2 + j] + verts[dim * 4 + j] + … in DMPlexComputeTriangularPrismGeometry_Internal()
2295 …coeff[dim * 4 + j] = (1. / 4.) * (verts[dim * 0 + j] - verts[dim * 2 + j] - verts[dim * 3 + j] + v… in DMPlexComputeTriangularPrismGeometry_Internal()
2296 …coeff[dim * 5 + j] = (1. / 4.) * (verts[dim * 0 + j] - verts[dim * 1 + j] - verts[dim * 3 + j] + v… in DMPlexComputeTriangularPrismGeometry_Internal()
2319 for (c = 0; c < dim; ++c) { in DMPlexComputeTriangularPrismGeometry_Internal()
2322 for (k = 0; k < Nv; ++k) val += extPoint[k] * coeff[k * dim + c]; in DMPlexComputeTriangularPrismGeometry_Internal()
2323 v[i * dim + c] = val; in DMPlexComputeTriangularPrismGeometry_Internal()
2348 for (j = 0; j < dim; j++) { in DMPlexComputeTriangularPrismGeometry_Internal()
2352 for (l = 0; l < Nv; l++) val += coeff[dim * l + j] * extJ[dimR * l + k]; in DMPlexComputeTriangularPrismGeometry_Internal()
2353 J[i * dim * dim + dim * j + k] = val; in DMPlexComputeTriangularPrismGeometry_Internal()
2356 DMPlex_Det3D_Internal(&detJ[i], &J[i * dim * dim]); in DMPlexComputeTriangularPrismGeometry_Internal()
2357 if (invJ) DMPlex_Invert3D_Internal(&invJ[i * dim * dim], &J[i * dim * dim], detJ[i]); in DMPlexComputeTriangularPrismGeometry_Internal()
2368 PetscInt depth, dim, coordDim, coneSize, i; in DMPlexComputeCellGeometryFEM_Implicit() local
2379 PetscCall(DMLabelGetValue(depthLabel, cell, &dim)); in DMPlexComputeCellGeometryFEM_Implicit()
2380 if (depth == 1 && dim == 1) PetscCall(DMGetDimension(dm, &dim)); in DMPlexComputeCellGeometryFEM_Implicit()
2424 …for (i = 0; i < Nq; i++) CoordinatesRefToReal(coordDim, dim, xi0, v0, J0, &points[dim * i], &v[coo… in DMPlexComputeCellGeometryFEM_Implicit()
2498 PetscInt dim, cdim, pdim, qdim, Nq, q; in DMPlexComputeCellGeometryFEM_FE() local
2501 PetscCall(DMGetDimension(dm, &dim)); in DMPlexComputeCellGeometryFEM_FE()
2522 …scCheck(qdim == dim, PETSC_COMM_SELF, PETSC_ERR_ARG_SIZ, "Point dimension %" PetscInt_FMT " != qua… in DMPlexComputeCellGeometryFEM_FE()
2531 …PetscAssert(dim == T->cdim, PETSC_COMM_SELF, PETSC_ERR_ARG_SIZ, "cdim %" PetscInt_FMT " != %" Pets… in DMPlexComputeCellGeometryFEM_FE()
2552 for (j = 0; j < dim; ++j) { in DMPlexComputeCellGeometryFEM_FE()
2553 …+i) J[(q * cdim + i) * cdim + j] += basisDer[((q * pdim + k) * cdim + i) * dim + j] * PetscRealPar… in DMPlexComputeCellGeometryFEM_FE()
2556 PetscCall(PetscLogFlops(2.0 * pdim * dim * cdim)); in DMPlexComputeCellGeometryFEM_FE()
2557 if (cdim > dim) { in DMPlexComputeCellGeometryFEM_FE()
2558 for (c = dim; c < cdim; ++c) in DMPlexComputeCellGeometryFEM_FE()
2565 DMPlex_Det3D_Internal(&detJt, &J[q * cdim * dim]); in DMPlexComputeCellGeometryFEM_FE()
2566 if (invJ) DMPlex_Invert3D_Internal(&invJ[q * cdim * dim], &J[q * cdim * dim], detJt); in DMPlexComputeCellGeometryFEM_FE()
2569 DMPlex_Det2D_Internal(&detJt, &J[q * cdim * dim]); in DMPlexComputeCellGeometryFEM_FE()
2570 if (invJ) DMPlex_Invert2D_Internal(&invJ[q * cdim * dim], &J[q * cdim * dim], detJt); in DMPlexComputeCellGeometryFEM_FE()
2573 detJt = J[q * cdim * dim]; in DMPlexComputeCellGeometryFEM_FE()
2574 if (invJ) invJ[q * cdim * dim] = 1.0 / detJt; in DMPlexComputeCellGeometryFEM_FE()
2616 PetscInt dim, cdim; in DMPlexComputeCellGeometryFEM() local
2620 PetscCall(DMGetDimension(dm, &dim)); in DMPlexComputeCellGeometryFEM()
2637 …if (!fe || (dim != cdim)) PetscCall(DMPlexComputeCellGeometryFEM_Implicit(dm, cell, quad, v, J, in… in DMPlexComputeCellGeometryFEM()
2642 static PetscErrorCode DMPlexComputeGeometryFVM_0D_Internal(DM dm, PetscInt dim, PetscInt cell, Pets… in DMPlexComputeGeometryFVM_0D_Internal() argument
2679 norm = DMPlex_NormD_Internal(dim, normal); in DMPlexComputeGeometryFVM_0D_Internal()
2680 for (d = 0; d < dim; ++d) normal[d] /= (norm * sign); in DMPlexComputeGeometryFVM_0D_Internal()
2687 static PetscErrorCode DMPlexComputeGeometryFVM_1D_Internal(DM dm, PetscInt dim, PetscInt cell, Pets… in DMPlexComputeGeometryFVM_1D_Internal() argument
2730 static PetscErrorCode DMPlexComputeGeometryFVM_2D_Internal(DM dm, PetscInt dim, PetscInt cell, Pets… in DMPlexComputeGeometryFVM_2D_Internal() argument
2795 static PetscErrorCode DMPlexComputeGeometryFVM_3D_Internal(DM dm, PetscInt dim, PetscInt cell, Pets… in DMPlexComputeGeometryFVM_3D_Internal() argument
2810 …PetscCheck(dim <= 3, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "No support for dim %" PetscInt_FM… in DMPlexComputeGeometryFVM_3D_Internal()
2824 for (d = 0; d < dim; ++d) centroid[d] = 0.0; in DMPlexComputeGeometryFVM_3D_Internal()
2837 for (d = 0; d < dim; d++) origin[d] = PetscRealPart(coords[d]); in DMPlexComputeGeometryFVM_3D_Internal()
2840 for (d = 0; d < dim; ++d) { in DMPlexComputeGeometryFVM_3D_Internal()
2841 coordsTmp[0 * dim + d] = PetscRealPart(coords[faces[fOff + 0] * dim + d]) - origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2842 coordsTmp[1 * dim + d] = PetscRealPart(coords[faces[fOff + 1] * dim + d]) - origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2843 coordsTmp[2 * dim + d] = PetscRealPart(coords[faces[fOff + 2] * dim + d]) - origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2849 for (d = 0; d < dim; ++d) { in DMPlexComputeGeometryFVM_3D_Internal()
2850 for (p = 0; p < 3; ++p) centroid[d] += coordsTmp[p * dim + d] * vtmp; in DMPlexComputeGeometryFVM_3D_Internal()
2865 for (d = 0; d < dim; ++d) { in DMPlexComputeGeometryFVM_3D_Internal()
2866 coordsTmp[0 * dim + d] = PetscRealPart(coords[faces[fOff + fv[0]] * dim + d]) - origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2867 coordsTmp[1 * dim + d] = PetscRealPart(coords[faces[fOff + fv[1]] * dim + d]) - origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2868 coordsTmp[2 * dim + d] = PetscRealPart(coords[faces[fOff + fv[3]] * dim + d]) - origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2874 for (d = 0; d < dim; ++d) { in DMPlexComputeGeometryFVM_3D_Internal()
2875 for (p = 0; p < 3; ++p) centroid[d] += coordsTmp[p * dim + d] * vtmp; in DMPlexComputeGeometryFVM_3D_Internal()
2879 for (d = 0; d < dim; ++d) { in DMPlexComputeGeometryFVM_3D_Internal()
2880 coordsTmp[0 * dim + d] = PetscRealPart(coords[faces[fOff + fv[1]] * dim + d]) - origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2881 coordsTmp[1 * dim + d] = PetscRealPart(coords[faces[fOff + fv[2]] * dim + d]) - origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2882 coordsTmp[2 * dim + d] = PetscRealPart(coords[faces[fOff + fv[3]] * dim + d]) - origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2888 for (d = 0; d < dim; ++d) { in DMPlexComputeGeometryFVM_3D_Internal()
2889 for (p = 0; p < 3; ++p) centroid[d] += coordsTmp[p * dim + d] * vtmp; in DMPlexComputeGeometryFVM_3D_Internal()
2903 for (d = 0; d < dim; ++d) normal[d] = 0.0; in DMPlexComputeGeometryFVM_3D_Internal()
2905 for (d = 0; d < dim; ++d) centroid[d] = centroid[d] / (vsum * 4) + origin[d]; in DMPlexComputeGeometryFVM_3D_Internal()
2929 PetscInt depth, dim; in DMPlexComputeCellGeometryFVM() local
2933 PetscCall(DMGetDimension(dm, &dim)); in DMPlexComputeCellGeometryFVM()
2934 PetscCheck(depth == dim, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Mesh must be interpolated"); in DMPlexComputeCellGeometryFVM()
2938 PetscCall(DMPlexComputeGeometryFVM_0D_Internal(dm, dim, cell, vol, centroid, normal)); in DMPlexComputeCellGeometryFVM()
2941 PetscCall(DMPlexComputeGeometryFVM_1D_Internal(dm, dim, cell, vol, centroid, normal)); in DMPlexComputeCellGeometryFVM()
2944 PetscCall(DMPlexComputeGeometryFVM_2D_Internal(dm, dim, cell, vol, centroid, normal)); in DMPlexComputeCellGeometryFVM()
2947 PetscCall(DMPlexComputeGeometryFVM_3D_Internal(dm, dim, cell, vol, centroid, normal)); in DMPlexComputeCellGeometryFVM()
2950 …mension %" PetscInt_FMT " (depth %" PetscInt_FMT ") for element geometry computation", dim, depth); in DMPlexComputeCellGeometryFVM()
2978 PetscInt dim, cStart, cEnd, cEndInterior, c, fStart, fEnd, f; in DMPlexComputeGeometryFVM() local
2981 PetscCall(DMGetDimension(dm, &dim)); in DMPlexComputeGeometryFVM()
3033 for (d = 0; d < dim; ++d) fg->normal[d] *= area; in DMPlexComputeGeometryFVM()
3048 PetscCall(DMLocalizeCoordinateReal_Internal(dm, dim, fg->centroid, lcentroid, l)); in DMPlexComputeGeometryFVM()
3049 PetscCall(DMLocalizeCoordinateReal_Internal(dm, dim, fg->centroid, rcentroid, r)); in DMPlexComputeGeometryFVM()
3050 DMPlex_WaxpyD_Internal(dim, -1, l, r, v); in DMPlexComputeGeometryFVM()
3051 if (DMPlex_DotRealD_Internal(dim, fg->normal, v) < 0) { in DMPlexComputeGeometryFVM()
3052 for (d = 0; d < dim; ++d) fg->normal[d] = -fg->normal[d]; in DMPlexComputeGeometryFVM()
3054 if (DMPlex_DotRealD_Internal(dim, fg->normal, v) <= 0) { in DMPlexComputeGeometryFVM()
3055 …PetscCheck(dim != 2, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Direction for face %" PetscInt_FMT " could … in DMPlexComputeGeometryFVM()
3056 …PetscCheck(dim != 3, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Direction for face %" PetscInt_FMT " could … in DMPlexComputeGeometryFVM()
3060 DMPlex_WaxpyD_Internal(dim, -1, fg->centroid, cL->centroid, v); in DMPlexComputeGeometryFVM()
3061 minradius = PetscMin(minradius, DMPlex_NormD_Internal(dim, v)); in DMPlexComputeGeometryFVM()
3064 DMPlex_WaxpyD_Internal(dim, -1, fg->centroid, cR->centroid, v); in DMPlexComputeGeometryFVM()
3065 minradius = PetscMin(minradius, DMPlex_NormD_Internal(dim, v)); in DMPlexComputeGeometryFVM()
3092 … DMPlex_WaxpyD_Internal(dim, -1, ci->centroid, fg->centroid, c2f); /* cell to face centroid */ in DMPlexComputeGeometryFVM()
3093 …a = DMPlex_DotRealD_Internal(dim, c2f, fg->normal) / DMPlex_DotRealD_Internal(dim, fg->normal, fg-… in DMPlexComputeGeometryFVM()
3095 DMPlex_WaxpyD_Internal(dim, 2 * a, fg->normal, ci->centroid, cg->centroid); in DMPlexComputeGeometryFVM()
3207 PetscInt dim, cStart, cEnd, c, cEndInterior, maxNumFaces; in BuildGradientReconstruction_Internal() local
3210 PetscCall(DMGetDimension(dm, &dim)); in BuildGradientReconstruction_Internal()
3217 PetscCall(PetscMalloc3(maxNumFaces * dim, &dx, maxNumFaces * dim, &grad, maxNumFaces, &gref)); in BuildGradientReconstruction_Internal()
3232 …PetscCheck(numFaces >= dim, PETSC_COMM_SELF, PETSC_ERR_ARG_INCOMP, "Cell %" PetscInt_FMT " has onl… in BuildGradientReconstruction_Internal()
3247 for (d = 0; d < dim; ++d) dx[usedFaces * dim + d] = cg1->centroid[d] - cg->centroid[d]; in BuildGradientReconstruction_Internal()
3256 for (d = 0; d < dim; ++d) gref[usedFaces][d] = grad[usedFaces * dim + d]; in BuildGradientReconstruction_Internal()
3268 PetscInt dim, cStart, cEnd, c, cEndInterior, fStart, fEnd, f, nStart, nEnd, maxNumFaces = 0; in BuildGradientReconstruction_Internal_Tree() local
3274 PetscCall(DMGetDimension(dm, &dim)); in BuildGradientReconstruction_Internal_Tree()
3335 PetscCall(PetscMalloc3(maxNumFaces * dim, &dx, maxNumFaces * dim, &grad, maxNumFaces, &gref)); in BuildGradientReconstruction_Internal_Tree()
3348 …PetscCheck(numFaces >= dim, PETSC_COMM_SELF, PETSC_ERR_ARG_INCOMP, "Cell %" PetscInt_FMT " has onl… in BuildGradientReconstruction_Internal_Tree()
3361 for (d = 0; d < dim; ++d) dx[f * dim + d] = cg1->centroid[d] - cg->centroid[d]; in BuildGradientReconstruction_Internal_Tree()
3366 for (d = 0; d < dim; ++d) gref[f][d] = grad[f * dim + d]; in BuildGradientReconstruction_Internal_Tree()
3401 PetscInt dim, pdim, cStart, cEnd, cEndInterior, c; in DMPlexComputeGradientFVM() local
3404 PetscCall(DMGetDimension(dm, &dim)); in DMPlexComputeGradientFVM()
3425 for (c = cStart; c < cEnd; ++c) PetscCall(PetscSectionSetDof(sectionGrad, c, pdim * dim)); in DMPlexComputeGradientFVM()
3998 void coordMap_identity(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Pets… in coordMap_identity() argument
4011 void coordMap_shear(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscIn… in coordMap_shear() argument
4024 void coordMap_flare(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscIn… in coordMap_flare() argument
4045 void coordMap_annulus(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Petsc… in coordMap_annulus() argument
4061 void coordMap_shell(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscIn… in coordMap_shell() argument
4075 void coordMap_sinusoid(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Pets… in coordMap_sinusoid() argument
4083 …if (dim > 2) xp[2] = c * PetscCosReal(2. * m * PETSC_PI * x[0]) * PetscCosReal(2. * n * PETSC_PI *… in coordMap_sinusoid()
4120 PetscErrorCode DMPlexRemapGeometry(DM dm, PetscReal time, void (*func)(PetscInt dim, PetscInt Nf, P… in DMPlexRemapGeometry() argument
4140 PetscInt dim, cdim, Nc, vStart, vEnd; in DMPlexRemapGeometry() local
4142 PetscCall(DMGetDimension(dm, &dim)); in DMPlexRemapGeometry()
4154 …(*func)(dim, 1, 0, uOff, NULL, &coords[off], NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.0, NULL, … in DMPlexRemapGeometry()