Lines Matching +full:- +full:d
6 DMGetPeriodicity - Get the description of mesh periodicity
11 . dm - The `DM` object
14 + maxCell - Over distances greater than this, we can assume a point has crossed over to another she…
15 . Lstart - If we assume the mesh is a torus, this is the start of each coordinate, or `NULL` for 0…
16 - L - If we assume the mesh is a torus, this is the length of each coordinate, otherwise it i…
26 if (maxCell) *maxCell = dm->maxCell; in DMGetPeriodicity()
27 if (Lstart) *Lstart = dm->Lstart; in DMGetPeriodicity()
28 if (L) *L = dm->L; in DMGetPeriodicity()
33 DMSetPeriodicity - Set the description of mesh periodicity
38 + dm - The `DM` object
39 . maxCell - Over distances greater than this, we can assume a point has crossed over to another she…
40 . Lstart - If we assume the mesh is a torus, this is the start of each coordinate, or `NULL` for 0…
41 - L - If we assume the mesh is a torus, this is the length of each coordinate, otherwise it i…
49 PetscInt dim, d; in DMSetPeriodicity() local
58 if (!dm->maxCell) PetscCall(PetscMalloc1(dim, &dm->maxCell)); in DMSetPeriodicity()
59 for (d = 0; d < dim; ++d) dm->maxCell[d] = maxCell[d]; in DMSetPeriodicity()
61 PetscCall(PetscFree(dm->maxCell)); in DMSetPeriodicity()
62 dm->maxCell = NULL; in DMSetPeriodicity()
65 if (!dm->Lstart) PetscCall(PetscMalloc1(dim, &dm->Lstart)); in DMSetPeriodicity()
66 for (d = 0; d < dim; ++d) dm->Lstart[d] = Lstart[d]; in DMSetPeriodicity()
68 PetscCall(PetscFree(dm->Lstart)); in DMSetPeriodicity()
69 dm->Lstart = NULL; in DMSetPeriodicity()
72 if (!dm->L) PetscCall(PetscMalloc1(dim, &dm->L)); in DMSetPeriodicity()
73 for (d = 0; d < dim; ++d) dm->L[d] = L[d]; in DMSetPeriodicity()
75 PetscCall(PetscFree(dm->L)); in DMSetPeriodicity()
76 dm->L = NULL; in DMSetPeriodicity()
78 …PetscCheck((dm->maxCell && dm->L) || (!dm->maxCell && !dm->L), PetscObjectComm((PetscObject)dm), P… in DMSetPeriodicity()
83 …DMLocalizeCoordinate - If a mesh is periodic (a torus with lengths L_i, some of which can be infin…
86 + dm - The `DM`
87 . in - The input coordinate point (dim numbers)
88 - endpoint - Include the endpoint L_i
91 . out - The localized coordinate point (dim numbers)
99 PetscInt dim, d; in DMLocalizeCoordinate() local
103 if (!dm->maxCell) { in DMLocalizeCoordinate()
104 for (d = 0; d < dim; ++d) out[d] = in[d]; in DMLocalizeCoordinate()
107 for (d = 0; d < dim; ++d) { in DMLocalizeCoordinate()
108 …l(PetscRealPart(in[d]) / dm->L[d] - PetscFloorReal(PetscRealPart(in[d]) / dm->L[d])) < PETSC_SMALL… in DMLocalizeCoordinate()
109 out[d] = in[d] - dm->L[d] * (PetscFloorReal(PetscRealPart(in[d]) / dm->L[d]) - 1); in DMLocalizeCoordinate()
111 out[d] = in[d] - dm->L[d] * PetscFloorReal(PetscRealPart(in[d]) / dm->L[d]); in DMLocalizeCoordinate()
115 …for (d = 0; d < dim; ++d) out[d] = in[d] - dm->L[d] * PetscFloorReal(PetscRealPart(in[d]) / dm->L[… in DMLocalizeCoordinate()
122 …DMLocalizeCoordinate_Internal - If a mesh is periodic, and the input point is far from the anchor,…
125 + dm - The `DM`
126 . dim - The spatial dimension
127 . anchor - The anchor point, the input point can be no more than maxCell away from it
128 - in - The input coordinate point (dim numbers)
131 . out - The localized coordinate point (dim numbers)
142 PetscInt d; in DMLocalizeCoordinate_Internal() local
145 if (!dm->maxCell) { in DMLocalizeCoordinate_Internal()
146 for (d = 0; d < dim; ++d) out[d] = in[d]; in DMLocalizeCoordinate_Internal()
148 for (d = 0; d < dim; ++d) { in DMLocalizeCoordinate_Internal()
149 if ((dm->L[d] > 0.0) && (PetscAbsScalar(anchor[d] - in[d]) > dm->maxCell[d])) { in DMLocalizeCoordinate_Internal()
150 … out[d] = PetscRealPart(anchor[d]) > PetscRealPart(in[d]) ? dm->L[d] + in[d] : in[d] - dm->L[d]; in DMLocalizeCoordinate_Internal()
152 out[d] = in[d]; in DMLocalizeCoordinate_Internal()
161 PetscInt d; in DMLocalizeCoordinateReal_Internal() local
164 if (!dm->maxCell) { in DMLocalizeCoordinateReal_Internal()
165 for (d = 0; d < dim; ++d) out[d] = in[d]; in DMLocalizeCoordinateReal_Internal()
167 for (d = 0; d < dim; ++d) { in DMLocalizeCoordinateReal_Internal()
168 if ((dm->L[d] > 0.0) && (PetscAbsReal(anchor[d] - in[d]) > dm->maxCell[d])) { in DMLocalizeCoordinateReal_Internal()
169 out[d] = anchor[d] > in[d] ? dm->L[d] + in[d] : in[d] - dm->L[d]; in DMLocalizeCoordinateReal_Internal()
171 out[d] = in[d]; in DMLocalizeCoordinateReal_Internal()
179 …DMLocalizeAddCoordinate_Internal - If a mesh is periodic, and the input point is far from the anch…
182 + dm - The `DM`
183 . dim - The spatial dimension
184 . anchor - The anchor point, the input point can be no more than maxCell away from it
185 . in - The input coordinate delta (dim numbers)
186 - out - The input coordinate point (dim numbers)
189 . out - The localized coordinate in + out
200 PetscInt d; in DMLocalizeAddCoordinate_Internal() local
203 if (!dm->maxCell) { in DMLocalizeAddCoordinate_Internal()
204 for (d = 0; d < dim; ++d) out[d] += in[d]; in DMLocalizeAddCoordinate_Internal()
206 for (d = 0; d < dim; ++d) { in DMLocalizeAddCoordinate_Internal()
207 const PetscReal maxC = dm->maxCell[d]; in DMLocalizeAddCoordinate_Internal()
209 if ((dm->L[d] > 0.0) && (PetscAbsScalar(anchor[d] - in[d]) > maxC)) { in DMLocalizeAddCoordinate_Internal()
210 … PetscScalar newCoord = PetscRealPart(anchor[d]) > PetscRealPart(in[d]) ? dm->L[d] + in[d] : in[d]… in DMLocalizeAddCoordinate_Internal()
212 if (PetscAbsScalar(newCoord - anchor[d]) > maxC) in DMLocalizeAddCoordinate_Internal()
213 …etscInt_FMT "-Coordinate %g more than %g away from anchor %g", d, (double)PetscRealPart(in[d]), (d… in DMLocalizeAddCoordinate_Internal()
214 out[d] += newCoord; in DMLocalizeAddCoordinate_Internal()
216 out[d] += in[d]; in DMLocalizeAddCoordinate_Internal()
224 …DMGetCoordinatesLocalizedLocal - Check if the `DM` coordinates have been localized for cells on th…
229 . dm - The `DM`
232 . areLocalized - `PETSC_TRUE` if localized
243 *areLocalized = dm->coordinates[1].dim < 0 ? PETSC_FALSE : PETSC_TRUE; in DMGetCoordinatesLocalizedLocal()
248 DMGetCoordinatesLocalized - Check if the `DM` coordinates have been localized for cells
253 . dm - The `DM`
256 . areLocalized - `PETSC_TRUE` if localized
275 …DMGetSparseLocalize - Check if the `DM` coordinates should be localized only for cells near the pe…
280 . dm - The `DM`
283 . sparse - `PETSC_TRUE` if only cells near the periodic boundary are localized
294 *sparse = dm->sparseLocalize; in DMGetSparseLocalize()
299 …DMSetSparseLocalize - Set the flag indicating that `DM` coordinates should be localized only for c…
304 + dm - The `DM`
305 - sparse - `PETSC_TRUE` if only cells near the periodic boundary are localized
316 dm->sparseLocalize = sparse; in DMSetSparseLocalize()
321 …DMLocalizeCoordinates - If a mesh is periodic, create local coordinates for cells having periodic …
326 . dm - The `DM`
391 PetscInt dof, d, p; in DMLocalizeCoordinates() local
397 for (d = 0; d < Nc; ++d) anchor[d] = cellCoords[d]; in DMLocalizeCoordinates()
400 for (d = 0; d < Nc; ++d) in DMLocalizeCoordinates()
401 if (cellCoords[p * Nc + d] != localized[d]) break; in DMLocalizeCoordinates()
402 if (d < Nc) break; in DMLocalizeCoordinates()
428 PetscInt p = 0, q, dof, cdof, d, offDG; in DMLocalizeCoordinates() local
437 for (d = 0; d < Nc; ++d) anchor[d] = cellCoords[q * Nc + d]; in DMLocalizeCoordinates()
441 for (d = 0; d < Nc; ++d) in DMLocalizeCoordinates()
442 …d] > 0. && ((PetscRealPart(coordsDG[offDG + p * Nc + d]) < (Lstart ? Lstart[d] : 0.)) || (PetscRea… in DMLocalizeCoordinates()
443 if (d < Nc) break; in DMLocalizeCoordinates()