Lines Matching refs:geom
19 …tscQuadrature quad, PetscInt numCells, PetscInt dimEmbed, PetscFEGeomMode mode, PetscFEGeom **geom) in PetscFEGeomCreate() argument
41 *geom = g; in PetscFEGeomCreate()
55 PetscErrorCode PetscFEGeomDestroy(PetscFEGeom **geom) in PetscFEGeomDestroy() argument
58 if (!*geom) PetscFunctionReturn(PETSC_SUCCESS); in PetscFEGeomDestroy()
59 PetscCall(PetscFree3((*geom)->v, (*geom)->J, (*geom)->detJ)); in PetscFEGeomDestroy()
60 PetscCall(PetscFree((*geom)->invJ)); in PetscFEGeomDestroy()
61 PetscCall(PetscFree2((*geom)->face, (*geom)->n)); in PetscFEGeomDestroy()
62 …etscCall(PetscFree6((*geom)->suppJ[0], (*geom)->suppJ[1], (*geom)->suppInvJ[0], (*geom)->suppInvJ[… in PetscFEGeomDestroy()
63 PetscCall(PetscFree(*geom)); in PetscFEGeomDestroy()
85 PetscErrorCode PetscFEGeomGetChunk(PetscFEGeom *geom, PetscInt cStart, PetscInt cEnd, PetscFEGeom *… in PetscFEGeomGetChunk() argument
91 PetscAssertPointer(geom, 1); in PetscFEGeomGetChunk()
94 Nq = geom->numPoints; in PetscFEGeomGetChunk()
95 dE = geom->dimEmbed; in PetscFEGeomGetChunk()
96 (*chunkGeom)->mode = geom->mode; in PetscFEGeomGetChunk()
97 (*chunkGeom)->dim = geom->dim; in PetscFEGeomGetChunk()
98 (*chunkGeom)->dimEmbed = geom->dimEmbed; in PetscFEGeomGetChunk()
99 (*chunkGeom)->numPoints = geom->numPoints; in PetscFEGeomGetChunk()
101 (*chunkGeom)->xi = geom->xi; in PetscFEGeomGetChunk()
102 (*chunkGeom)->v = PetscSafePointerPlusOffset(geom->v, Nq * dE * cStart); in PetscFEGeomGetChunk()
103 (*chunkGeom)->J = PetscSafePointerPlusOffset(geom->J, Nq * dE * dE * cStart); in PetscFEGeomGetChunk()
104 (*chunkGeom)->invJ = PetscSafePointerPlusOffset(geom->invJ, Nq * dE * dE * cStart); in PetscFEGeomGetChunk()
105 (*chunkGeom)->detJ = PetscSafePointerPlusOffset(geom->detJ, Nq * cStart); in PetscFEGeomGetChunk()
106 (*chunkGeom)->n = PetscSafePointerPlusOffset(geom->n, Nq * dE * cStart); in PetscFEGeomGetChunk()
107 (*chunkGeom)->face = PetscSafePointerPlusOffset(geom->face, cStart); in PetscFEGeomGetChunk()
108 (*chunkGeom)->suppJ[0] = PetscSafePointerPlusOffset(geom->suppJ[0], Nq * dE * dE * cStart); in PetscFEGeomGetChunk()
109 (*chunkGeom)->suppJ[1] = PetscSafePointerPlusOffset(geom->suppJ[1], Nq * dE * dE * cStart); in PetscFEGeomGetChunk()
110 (*chunkGeom)->suppInvJ[0] = PetscSafePointerPlusOffset(geom->suppInvJ[0], Nq * dE * dE * cStart); in PetscFEGeomGetChunk()
111 (*chunkGeom)->suppInvJ[1] = PetscSafePointerPlusOffset(geom->suppInvJ[1], Nq * dE * dE * cStart); in PetscFEGeomGetChunk()
112 (*chunkGeom)->suppDetJ[0] = PetscSafePointerPlusOffset(geom->suppDetJ[0], Nq * cStart); in PetscFEGeomGetChunk()
113 (*chunkGeom)->suppDetJ[1] = PetscSafePointerPlusOffset(geom->suppDetJ[1], Nq * cStart); in PetscFEGeomGetChunk()
114 (*chunkGeom)->isAffine = geom->isAffine; in PetscFEGeomGetChunk()
131 PetscErrorCode PetscFEGeomRestoreChunk(PetscFEGeom *geom, PetscInt cStart, PetscInt cEnd, PetscFEGe… in PetscFEGeomRestoreChunk() argument
160 PetscErrorCode PetscFEGeomGetPoint(PetscFEGeom *geom, PetscInt c, PetscInt p, const PetscReal pcoor… in PetscFEGeomGetPoint() argument
162 const PetscInt dim = geom->dim; in PetscFEGeomGetPoint()
163 const PetscInt dE = geom->dimEmbed; in PetscFEGeomGetPoint()
164 const PetscInt Np = geom->numPoints; in PetscFEGeomGetPoint()
167 pgeom->mode = geom->mode; in PetscFEGeomGetPoint()
171 if (geom->isAffine) { in PetscFEGeomGetPoint()
173 pgeom->xi = geom->xi; in PetscFEGeomGetPoint()
174 pgeom->J = &geom->J[c * Np * dE * dE]; in PetscFEGeomGetPoint()
175 pgeom->invJ = &geom->invJ[c * Np * dE * dE]; in PetscFEGeomGetPoint()
176 pgeom->detJ = &geom->detJ[c * Np]; in PetscFEGeomGetPoint()
177 pgeom->n = PetscSafePointerPlusOffset(geom->n, c * Np * dE); in PetscFEGeomGetPoint()
179 …if (pcoords) CoordinatesRefToReal(dE, dim, pgeom->xi, &geom->v[c * Np * dE], pgeom->J, pcoords, pg… in PetscFEGeomGetPoint()
181 pgeom->v = &geom->v[(c * Np + p) * dE]; in PetscFEGeomGetPoint()
182 pgeom->J = &geom->J[(c * Np + p) * dE * dE]; in PetscFEGeomGetPoint()
183 pgeom->invJ = &geom->invJ[(c * Np + p) * dE * dE]; in PetscFEGeomGetPoint()
184 pgeom->detJ = &geom->detJ[c * Np + p]; in PetscFEGeomGetPoint()
185 pgeom->n = PetscSafePointerPlusOffset(geom->n, (c * Np + p) * dE); in PetscFEGeomGetPoint()
212 PetscErrorCode PetscFEGeomGetCellPoint(PetscFEGeom *geom, PetscInt c, PetscInt p, PetscFEGeom *pgeo… in PetscFEGeomGetCellPoint() argument
214 const PetscBool bd = geom->mode == PETSC_FEGEOM_BOUNDARY ? PETSC_TRUE : PETSC_FALSE; in PetscFEGeomGetCellPoint()
215 const PetscInt dim = bd ? geom->dimEmbed : geom->dim; in PetscFEGeomGetCellPoint()
216 const PetscInt dE = geom->dimEmbed; in PetscFEGeomGetCellPoint()
217 const PetscInt Np = geom->numPoints; in PetscFEGeomGetCellPoint()
220 pgeom->mode = geom->mode; in PetscFEGeomGetCellPoint()
224 if (geom->isAffine) { in PetscFEGeomGetCellPoint()
227 pgeom->J = &geom->suppJ[0][c * Np * dE * dE]; in PetscFEGeomGetCellPoint()
228 pgeom->invJ = &geom->suppInvJ[0][c * Np * dE * dE]; in PetscFEGeomGetCellPoint()
229 pgeom->detJ = &geom->suppDetJ[0][c * Np]; in PetscFEGeomGetCellPoint()
231 pgeom->J = &geom->J[c * Np * dE * dE]; in PetscFEGeomGetCellPoint()
232 pgeom->invJ = &geom->invJ[c * Np * dE * dE]; in PetscFEGeomGetCellPoint()
233 pgeom->detJ = &geom->detJ[c * Np]; in PetscFEGeomGetCellPoint()
238 pgeom->J = &geom->suppJ[0][(c * Np + p) * dE * dE]; in PetscFEGeomGetCellPoint()
239 pgeom->invJ = &geom->suppInvJ[0][(c * Np + p) * dE * dE]; in PetscFEGeomGetCellPoint()
240 pgeom->detJ = &geom->suppDetJ[0][c * Np + p]; in PetscFEGeomGetCellPoint()
242 pgeom->J = &geom->J[(c * Np + p) * dE * dE]; in PetscFEGeomGetCellPoint()
243 pgeom->invJ = &geom->invJ[(c * Np + p) * dE * dE]; in PetscFEGeomGetCellPoint()
244 pgeom->detJ = &geom->detJ[c * Np + p]; in PetscFEGeomGetCellPoint()
260 PetscErrorCode PetscFEGeomComplete(PetscFEGeom *geom) in PetscFEGeomComplete() argument
265 N = geom->numPoints * geom->numCells; in PetscFEGeomComplete()
266 dE = geom->dimEmbed; in PetscFEGeomComplete()
270 DMPlex_Det3D_Internal(&geom->detJ[i], &geom->J[dE * dE * i]); in PetscFEGeomComplete()
271 …if (geom->invJ) DMPlex_Invert3D_Internal(&geom->invJ[dE * dE * i], &geom->J[dE * dE * i], geom->de… in PetscFEGeomComplete()
276 DMPlex_Det2D_Internal(&geom->detJ[i], &geom->J[dE * dE * i]); in PetscFEGeomComplete()
277 …if (geom->invJ) DMPlex_Invert2D_Internal(&geom->invJ[dE * dE * i], &geom->J[dE * dE * i], geom->de… in PetscFEGeomComplete()
282 geom->detJ[i] = PetscAbsReal(geom->J[i]); in PetscFEGeomComplete()
283 if (geom->invJ) geom->invJ[i] = 1. / geom->J[i]; in PetscFEGeomComplete()
287 if (geom->n) { in PetscFEGeomComplete()
289 …for (j = 0; j < dE; j++) geom->n[dE * i + j] = geom->J[dE * dE * i + dE * j + dE - 1] * ((dE == 2)… in PetscFEGeomComplete()