Lines Matching refs:cell

421 …DMPlexLocatePoint_Simplex_1D_Internal(DM dm, const PetscScalar point[], PetscInt c, PetscInt *cell)  in DMPlexLocatePoint_Simplex_1D_Internal()  argument
432 if ((xi >= -eps) && (xi <= 2. + eps)) *cell = c; in DMPlexLocatePoint_Simplex_1D_Internal()
433 else *cell = DMLOCATEPOINT_POINT_NOT_FOUND; in DMPlexLocatePoint_Simplex_1D_Internal()
437 …DMPlexLocatePoint_Simplex_2D_Internal(DM dm, const PetscScalar point[], PetscInt c, PetscInt *cell) in DMPlexLocatePoint_Simplex_2D_Internal() argument
451 if ((xi[0] >= -eps) && (xi[1] >= -eps) && (xi[0] + xi[1] <= 2.0 + eps)) *cell = c; in DMPlexLocatePoint_Simplex_2D_Internal()
452 else *cell = DMLOCATEPOINT_POINT_NOT_FOUND; in DMPlexLocatePoint_Simplex_2D_Internal()
482 …exLocatePoint_Quad_2D_Linear_Internal(DM dm, const PetscScalar point[], PetscInt c, PetscInt *cell) in DMPlexLocatePoint_Quad_2D_Linear_Internal() argument
518 if (crossings % 2) *cell = c; in DMPlexLocatePoint_Quad_2D_Linear_Internal()
519 else *cell = DMLOCATEPOINT_POINT_NOT_FOUND; in DMPlexLocatePoint_Quad_2D_Linear_Internal()
524 …de DMPlexLocatePoint_Quad_2D_Internal(DM dm, const PetscScalar point[], PetscInt c, PetscInt *cell) in DMPlexLocatePoint_Quad_2D_Internal() argument
548 PetscCall(DMPlexLocatePoint_Quad_2D_Linear_Internal(dm, point, c, cell)); in DMPlexLocatePoint_Quad_2D_Internal()
567 if (found) *cell = c; in DMPlexLocatePoint_Quad_2D_Internal()
568 else *cell = DMLOCATEPOINT_POINT_NOT_FOUND; in DMPlexLocatePoint_Quad_2D_Internal()
572 …DMPlexLocatePoint_Simplex_3D_Internal(DM dm, const PetscScalar point[], PetscInt c, PetscInt *cell) in DMPlexLocatePoint_Simplex_3D_Internal() argument
588 if ((xi >= -eps) && (eta >= -eps) && (zeta >= -eps) && (xi + eta + zeta <= 2.0 + eps)) *cell = c; in DMPlexLocatePoint_Simplex_3D_Internal()
589 else *cell = DMLOCATEPOINT_POINT_NOT_FOUND; in DMPlexLocatePoint_Simplex_3D_Internal()
593 …lexLocatePoint_Hex_3D_Linear_Internal(DM dm, const PetscScalar point[], PetscInt c, PetscInt *cell) in DMPlexLocatePoint_Hex_3D_Linear_Internal() argument
634 if (found) *cell = c; in DMPlexLocatePoint_Hex_3D_Linear_Internal()
635 else *cell = DMLOCATEPOINT_POINT_NOT_FOUND; in DMPlexLocatePoint_Hex_3D_Linear_Internal()
640 …ode DMPlexLocatePoint_Hex_3D_Internal(DM dm, const PetscScalar point[], PetscInt c, PetscInt *cell) in DMPlexLocatePoint_Hex_3D_Internal() argument
664 PetscCall(DMPlexLocatePoint_Hex_3D_Linear_Internal(dm, point, c, cell)); in DMPlexLocatePoint_Hex_3D_Internal()
683 if (found) *cell = c; in DMPlexLocatePoint_Hex_3D_Internal()
684 else *cell = DMLOCATEPOINT_POINT_NOT_FOUND; in DMPlexLocatePoint_Hex_3D_Internal()
891 …ePoint_Internal(DM dm, PetscInt dim, const PetscScalar point[], PetscInt cellStart, PetscInt *cell) in DMPlexLocatePoint_Internal() argument
899 PetscCall(DMPlexLocatePoint_Simplex_1D_Internal(dm, point, cellStart, cell)); in DMPlexLocatePoint_Internal()
902 PetscCall(DMPlexLocatePoint_Simplex_2D_Internal(dm, point, cellStart, cell)); in DMPlexLocatePoint_Internal()
905 PetscCall(DMPlexLocatePoint_Quad_2D_Internal(dm, point, cellStart, cell)); in DMPlexLocatePoint_Internal()
908 PetscCall(DMPlexLocatePoint_Simplex_3D_Internal(dm, point, cellStart, cell)); in DMPlexLocatePoint_Internal()
911 PetscCall(DMPlexLocatePoint_Hex_3D_Internal(dm, point, cellStart, cell)); in DMPlexLocatePoint_Internal()
922 …stPoint_Internal(DM dm, PetscInt dim, const PetscScalar point[], PetscInt cell, PetscReal cpoint[]) in DMPlexClosestPoint_Internal() argument
927 PetscCall(DMPlexGetCellType(dm, cell, &ct)); in DMPlexClosestPoint_Internal()
930 PetscCall(DMPlexClosestPoint_Simplex_2D_Internal(dm, point, cell, cpoint)); in DMPlexClosestPoint_Internal()
934 PetscCall(DMPlexClosestPoint_General_2D_Internal(dm, point, cell, cpoint));break; in DMPlexClosestPoint_Internal()
936 PetscCall(DMPlexClosestPoint_Simplex_3D_Internal(dm, point, cell, cpoint));break; in DMPlexClosestPoint_Internal()
938 PetscCall(DMPlexClosestPoint_General_3D_Internal(dm, point, cell, cpoint));break; in DMPlexClosestPoint_Internal()
941 …NGE, "No closest point location for cell %" PetscInt_FMT " with type %s", cell, DMPolytopeTypes[ct… in DMPlexClosestPoint_Internal()
1315 PetscInt dbin[3] = {-1, -1, -1}, bin, cell = -1, cellOffset; in DMLocatePoints_Plex() local
1341 PetscCall(DMPlexLocatePoint_Internal(dm, cdim, point, c, &cell)); in DMLocatePoints_Plex()
1342 if (cell >= 0) { in DMLocatePoints_Plex()
1344 cells[p].index = cell; in DMLocatePoints_Plex()
1366 PetscCall(DMPlexLocatePoint_Internal(dm, cdim, point, boxCells[c], &cell)); in DMLocatePoints_Plex()
1367 if (cell >= 0) { in DMLocatePoints_Plex()
1368 …PetscCall(PetscPrintf(PETSC_COMM_SELF, "[%d] FOUND in cell %" PetscInt_FMT "\n", rank, cell)); in DMLocatePoints_Plex()
1370 cells[p].index = cell; in DMLocatePoints_Plex()
1384 PetscCall(DMPlexLocatePoint_Internal(dm, cdim, point, c, &cell)); in DMLocatePoints_Plex()
1385 if (cell >= 0) { in DMLocatePoints_Plex()
1387 cells[p].index = cell; in DMLocatePoints_Plex()
1717 PetscErrorCode DMPlexGetCellCoordinates(DM dm, PetscInt cell, PetscBool *isDG, PetscInt *Nc, const … in DMPlexGetCellCoordinates() argument
1735 if (cell < pStart || cell >= pEnd) goto cg; in DMPlexGetCellCoordinates()
1737 PetscCall(PetscSectionGetDof(cs, cell, Nc)); in DMPlexGetCellCoordinates()
1745 PetscCall(DMPlexPointLocalRead(cdm, cell, *array, &ccoords)); in DMPlexGetCellCoordinates()
1756 PetscCall(DMPlexVecGetOrientedClosure(cdm, cs, PETSC_FALSE, coordinates, cell, 0, Nc, coords)); in DMPlexGetCellCoordinates()
1779 PetscErrorCode DMPlexRestoreCellCoordinates(DM dm, PetscInt cell, PetscBool *isDG, PetscInt *Nc, co… in DMPlexRestoreCellCoordinates() argument
1793 PetscCall(DMPlexVecRestoreClosure(cdm, cs, coordinates, cell, Nc, coords)); in DMPlexRestoreCellCoordinates()
2365 static PetscErrorCode DMPlexComputeCellGeometryFEM_Implicit(DM dm, PetscInt cell, PetscQuadrature q… in DMPlexComputeCellGeometryFEM_Implicit() argument
2377 PetscCall(DMPlexGetConeSize(dm, cell, &coneSize)); in DMPlexComputeCellGeometryFEM_Implicit()
2379 PetscCall(DMLabelGetValue(depthLabel, cell, &dim)); in DMPlexComputeCellGeometryFEM_Implicit()
2384 PetscCall(DMPlexGetCellType(dm, cell, &ct)); in DMPlexComputeCellGeometryFEM_Implicit()
2387 PetscCall(DMPlexComputePointGeometry_Internal(dm, cell, v, J, invJ, detJ)); in DMPlexComputeCellGeometryFEM_Implicit()
2392 if (Nq) PetscCall(DMPlexComputeLineGeometry_Internal(dm, cell, v0, J0, NULL, &detJ0)); in DMPlexComputeCellGeometryFEM_Implicit()
2393 else PetscCall(DMPlexComputeLineGeometry_Internal(dm, cell, v, J, invJ, detJ)); in DMPlexComputeCellGeometryFEM_Implicit()
2396 if (Nq) PetscCall(DMPlexComputeTriangleGeometry_Internal(dm, cell, v0, J0, NULL, &detJ0)); in DMPlexComputeCellGeometryFEM_Implicit()
2397 else PetscCall(DMPlexComputeTriangleGeometry_Internal(dm, cell, v, J, invJ, detJ)); in DMPlexComputeCellGeometryFEM_Implicit()
2400 …PetscCall(DMPlexComputeRectangleGeometry_Internal(dm, cell, PETSC_FALSE, Nq, points, v, J, invJ, d… in DMPlexComputeCellGeometryFEM_Implicit()
2404 …PetscCall(DMPlexComputeRectangleGeometry_Internal(dm, cell, PETSC_TRUE, Nq, points, v, J, invJ, de… in DMPlexComputeCellGeometryFEM_Implicit()
2408 if (Nq) PetscCall(DMPlexComputeTetrahedronGeometry_Internal(dm, cell, v0, J0, NULL, &detJ0)); in DMPlexComputeCellGeometryFEM_Implicit()
2409 else PetscCall(DMPlexComputeTetrahedronGeometry_Internal(dm, cell, v, J, invJ, detJ)); in DMPlexComputeCellGeometryFEM_Implicit()
2412 PetscCall(DMPlexComputeHexahedronGeometry_Internal(dm, cell, Nq, points, v, J, invJ, detJ)); in DMPlexComputeCellGeometryFEM_Implicit()
2416 … PetscCall(DMPlexComputeTriangularPrismGeometry_Internal(dm, cell, Nq, points, v, J, invJ, detJ)); in DMPlexComputeCellGeometryFEM_Implicit()
2420 …UTOFRANGE, "No element geometry for cell %" PetscInt_FMT " with type %s", cell, DMPolytopeTypes[Pe… in DMPlexComputeCellGeometryFEM_Implicit()
2482 PetscErrorCode DMPlexComputeCellGeometryAffineFEM(DM dm, PetscInt cell, PetscReal v0[], PetscReal J… in DMPlexComputeCellGeometryAffineFEM() argument
2485 PetscCall(DMPlexComputeCellGeometryFEM_Implicit(dm, cell, NULL, v0, J, invJ, detJ)); in DMPlexComputeCellGeometryAffineFEM()
2612 PetscErrorCode DMPlexComputeCellGeometryFEM(DM dm, PetscInt cell, PetscQuadrature quad, PetscReal v… in DMPlexComputeCellGeometryFEM() argument
2637 …if (!fe || (dim != cdim)) PetscCall(DMPlexComputeCellGeometryFEM_Implicit(dm, cell, quad, v, J, in… in DMPlexComputeCellGeometryFEM()
2638 else PetscCall(DMPlexComputeCellGeometryFEM_FE(dm, fe, cell, quad, v, J, invJ, detJ)); in DMPlexComputeCellGeometryFEM()
2642 static PetscErrorCode DMPlexComputeGeometryFVM_0D_Internal(DM dm, PetscInt dim, PetscInt cell, Pets… in DMPlexComputeGeometryFVM_0D_Internal() argument
2656 PetscCall(PetscSectionGetDof(coordSection, cell, &dof)); in DMPlexComputeGeometryFVM_0D_Internal()
2657 PetscCall(PetscSectionGetOffset(coordSection, cell, &off)); in DMPlexComputeGeometryFVM_0D_Internal()
2666 PetscCall(DMPlexGetSupportSize(dm, cell, &supportSize)); in DMPlexComputeGeometryFVM_0D_Internal()
2667 PetscCall(DMPlexGetSupport(dm, cell, &support)); in DMPlexComputeGeometryFVM_0D_Internal()
2671 PetscCall(PetscSectionGetDof(coordSection, cell, &dof)); in DMPlexComputeGeometryFVM_0D_Internal()
2672 PetscCall(PetscSectionGetOffset(coordSection, cell, &off)); in DMPlexComputeGeometryFVM_0D_Internal()
2677 sign = cones[0] == cell ? 1.0 : -1.0; in DMPlexComputeGeometryFVM_0D_Internal()
2687 static PetscErrorCode DMPlexComputeGeometryFVM_1D_Internal(DM dm, PetscInt dim, PetscInt cell, Pets… in DMPlexComputeGeometryFVM_1D_Internal() argument
2696 PetscCall(DMPlexGetCellCoordinates(dm, cell, &isDG, &coordSize, &array, &coords)); in DMPlexComputeGeometryFVM_1D_Internal()
2725 PetscCall(DMPlexRestoreCellCoordinates(dm, cell, &isDG, &coordSize, &array, &coords)); in DMPlexComputeGeometryFVM_1D_Internal()
2730 static PetscErrorCode DMPlexComputeGeometryFVM_2D_Internal(DM dm, PetscInt dim, PetscInt cell, Pets… in DMPlexComputeGeometryFVM_2D_Internal() argument
2742 PetscCall(DMPlexGetCellType(dm, cell, &ct)); in DMPlexComputeGeometryFVM_2D_Internal()
2752 PetscCall(DMPlexGetConeSize(dm, cell, &numCorners)); in DMPlexComputeGeometryFVM_2D_Internal()
2753 PetscCall(DMPlexGetCellCoordinates(dm, cell, &isDG, &coordSize, &array, &coords)); in DMPlexComputeGeometryFVM_2D_Internal()
2790 PetscCall(DMPlexRestoreCellCoordinates(dm, cell, &isDG, &coordSize, &array, &coords)); in DMPlexComputeGeometryFVM_2D_Internal()
2795 static PetscErrorCode DMPlexComputeGeometryFVM_3D_Internal(DM dm, PetscInt dim, PetscInt cell, Pets… in DMPlexComputeGeometryFVM_3D_Internal() argument
2812 PetscCall(DMPlexGetCellType(dm, cell, &ct)); in DMPlexComputeGeometryFVM_3D_Internal()
2825 PetscCall(DMPlexGetCone(dm, cell, &cone)); in DMPlexComputeGeometryFVM_3D_Internal()
2829 PetscCall(DMPlexGetCellCoordinates(dm, cell, &isDG, &coordSize, &array, &coords)); in DMPlexComputeGeometryFVM_3D_Internal()
2900 PetscCall(DMPlexRestoreCellCoordinates(dm, cell, &isDG, &coordSize, &array, &coords)); in DMPlexComputeGeometryFVM_3D_Internal()
2927 PetscErrorCode DMPlexComputeCellGeometryFVM(DM dm, PetscInt cell, PetscReal *vol, PetscReal centroi… in DMPlexComputeCellGeometryFVM() argument
2935 PetscCall(DMPlexGetPointDepth(dm, cell, &depth)); 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()
3296 PetscInt cell = fcells[c]; in BuildGradientReconstruction_Internal_Tree() local
3298 if (cell >= cStart && cell < cEndInterior) PetscCall(PetscSectionAddDof(neighSec, cell, 1)); in BuildGradientReconstruction_Internal_Tree()
3323 PetscInt cell = fcells[c], off; in BuildGradientReconstruction_Internal_Tree() local
3325 if (cell >= cStart && cell < cEndInterior) { in BuildGradientReconstruction_Internal_Tree()
3326 PetscCall(PetscSectionGetOffset(neighSec, cell, &off)); in BuildGradientReconstruction_Internal_Tree()
3327 off += counter[cell - cStart]++; in BuildGradientReconstruction_Internal_Tree()
3550 static PetscErrorCode DMPlexCoordinatesToReference_Tensor(DM dm, PetscInt cell, PetscInt numPoints,… in DMPlexCoordinatesToReference_Tensor() argument
3559 PetscCall(DMPlexVecGetClosure(dm, NULL, coords, cell, &coordSize, &coordsScalar)); in DMPlexCoordinatesToReference_Tensor()
3641 …tscInt_FMT ", point %" PetscInt_FMT ", iter %" PetscInt_FMT ": res %g\n", cell, j, i, (double)maxA… in DMPlexCoordinatesToReference_Tensor()
3649 PetscCall(DMPlexVecRestoreClosure(dm, NULL, coords, cell, &coordSize, &coordsScalar)); in DMPlexCoordinatesToReference_Tensor()
3653 static PetscErrorCode DMPlexReferenceToCoordinates_Tensor(DM dm, PetscInt cell, PetscInt numPoints,… in DMPlexReferenceToCoordinates_Tensor() argument
3661 PetscCall(DMPlexVecGetClosure(dm, NULL, coords, cell, &coordSize, &coordsScalar)); in DMPlexReferenceToCoordinates_Tensor()
3723 PetscCall(DMPlexVecRestoreClosure(dm, NULL, coords, cell, &coordSize, &coordsScalar)); in DMPlexReferenceToCoordinates_Tensor()
3727 PetscErrorCode DMPlexCoordinatesToReference_FE(DM dm, PetscFE fe, PetscInt cell, PetscInt numPoints… in DMPlexCoordinatesToReference_FE() argument
3741 …PetscCall(DMPlexVecGetOrientedClosure(dm, NULL, PETSC_FALSE, coords, cell, 0, &coordSize, &nodes)); in DMPlexCoordinatesToReference_FE()
3774 …tscInt_FMT ", point %" PetscInt_FMT ", iter %" PetscInt_FMT ": res %g\n", cell, j, i, (double)maxA… in DMPlexCoordinatesToReference_FE()
3787 PetscCall(DMPlexVecRestoreClosure(dm, NULL, coords, cell, &coordSize, &nodes)); in DMPlexCoordinatesToReference_FE()
3792 PetscErrorCode DMPlexReferenceToCoordinates_FE(DM dm, PetscFE fe, PetscInt cell, PetscInt numPoints… in DMPlexReferenceToCoordinates_FE() argument
3804 …PetscCall(DMPlexVecGetOrientedClosure(dm, NULL, PETSC_FALSE, coords, cell, 0, &coordSize, &nodes)); in DMPlexReferenceToCoordinates_FE()
3824 PetscCall(DMPlexVecRestoreClosure(dm, NULL, coords, cell, &coordSize, &nodes)); in DMPlexReferenceToCoordinates_FE()
3853 PetscErrorCode DMPlexCoordinatesToReference(DM dm, PetscInt cell, PetscInt numPoints, const PetscRe… in DMPlexCoordinatesToReference() argument
3883 PetscCall(DMPlexGetCellType(dm, cell, &ct)); in DMPlexCoordinatesToReference()
3884 PetscCall(DMPlexGetPointHeight(dm, cell, &height)); in DMPlexCoordinatesToReference()
3885 …RR_ARG_OUTOFRANGE, "point %" PetscInt_FMT " not in a cell, height = %" PetscInt_FMT, cell, height); in DMPlexCoordinatesToReference()
3886 …RR_ARG_OUTOFRANGE, "point %" PetscInt_FMT " is unsupported cell type %s", cell, DMPolytopeTypes[ct… in DMPlexCoordinatesToReference()
3891 PetscCall(DMPlexGetConeSize(dm, cell, &coneSize)); in DMPlexCoordinatesToReference()
3900 PetscCall(DMPlexComputeCellGeometryAffineFEM(dm, cell, v0, J, invJ, &detJ)); in DMPlexCoordinatesToReference()
3908 …PetscCall(DMPlexCoordinatesToReference_Tensor(coordDM, cell, numPoints, realCoords, refCoords, coo… in DMPlexCoordinatesToReference()
3911 …PetscCall(DMPlexCoordinatesToReference_FE(coordDM, fe, cell, numPoints, realCoords, refCoords, coo… in DMPlexCoordinatesToReference()
3936 PetscErrorCode DMPlexReferenceToCoordinates(DM dm, PetscInt cell, PetscInt numPoints, const PetscRe… in DMPlexReferenceToCoordinates() argument
3966 PetscCall(DMPlexGetCellType(dm, cell, &ct)); in DMPlexReferenceToCoordinates()
3967 PetscCall(DMPlexGetPointHeight(dm, cell, &height)); in DMPlexReferenceToCoordinates()
3968 …RR_ARG_OUTOFRANGE, "point %" PetscInt_FMT " not in a cell, height = %" PetscInt_FMT, cell, height); in DMPlexReferenceToCoordinates()
3969 …RR_ARG_OUTOFRANGE, "point %" PetscInt_FMT " is unsupported cell type %s", cell, DMPolytopeTypes[ct… in DMPlexReferenceToCoordinates()
3974 PetscCall(DMPlexGetConeSize(dm, cell, &coneSize)); in DMPlexReferenceToCoordinates()
3982 PetscCall(DMPlexComputeCellGeometryAffineFEM(dm, cell, v0, J, NULL, &detJ)); in DMPlexReferenceToCoordinates()
3990 …PetscCall(DMPlexReferenceToCoordinates_Tensor(coordDM, cell, numPoints, refCoords, realCoords, coo… in DMPlexReferenceToCoordinates()
3993 …PetscCall(DMPlexReferenceToCoordinates_FE(coordDM, fe, cell, numPoints, refCoords, realCoords, coo… in DMPlexReferenceToCoordinates()