Go to the source code of this file.
Macros | |
| #define | PICURV_AT(i, j, k) X[MetricCellFacePlanesIndex(info, (i), (j), (k))] |
Functions | |
| PetscErrorCode | MetricGetCellVertices (UserCtx *user, const Cmpnts ***X, PetscInt i, PetscInt j, PetscInt k, Cmpnts V[8]) |
| Implementation of MetricGetCellVertices(). | |
| PetscBool | MetricFacePlane (const Cmpnts v1, const Cmpnts v2, const Cmpnts v3, const Cmpnts v4, const Cmpnts cell_centroid, FacePlane *plane, PetscBool *degenerate) |
| Implementation of MetricFacePlane(). | |
| static Cmpnts | MetricHexCentroid (const Cell *cell) |
| Centroid of a hexahedral cell: the mean of its eight vertices. | |
| void | MetricBuildCellFacePlanes (const Cell *cell, CellFacePlanes *planes) |
| Implementation of MetricBuildCellFacePlanes(). | |
| static PetscErrorCode | FacePlaneFieldSlots (UserCtx *user, FieldId id, DM *dm, Vec **global, Vec **local) |
Where a face-plane field's vectors live in user, and its DM. | |
| static void | MetricGatherHexVertices (const Cmpnts *X, const DMDALocalInfo *info, PetscInt i, PetscInt j, PetscInt k, Cell *hex) |
| The eight vertices of the cell whose origin node is (i, j, k), in RetrieveCurrentCell() order, from a flat ghosted local array indexed as MetricCellFacePlanesIndex(). | |
| static void | MetricFacePlaneLocals (const UserCtx *user, PetscBool dual, Vec normals[3], Vec centroids[3]) |
| The local vectors of the primal or the dual planes, as MetricGetFacePlaneArrays() reads them. | |
| PetscErrorCode | MetricComputeFacePlanes (UserCtx *user) |
| Implementation of MetricComputeFacePlanes(). | |
| PetscErrorCode | MetricDestroyFacePlanes (UserCtx *user) |
| Implementation of MetricDestroyFacePlanes(). | |
| PetscErrorCode | MetricGetFacePlaneArrays (UserCtx *user, PetscBool dual, FacePlaneArrays *arrays) |
| Implementation of MetricGetFacePlaneArrays(). | |
| PetscErrorCode | MetricRestoreFacePlaneArrays (UserCtx *user, FacePlaneArrays *arrays) |
| Implementation of MetricRestoreFacePlaneArrays(). | |
| void | MetricGatherCellFacePlanes (const FacePlaneArrays *arrays, const DMDALocalInfo *info, PetscInt i, PetscInt j, PetscInt k, CellFacePlanes *planes) |
| Implementation of MetricGatherCellFacePlanes(). | |
| static void | TrilinearBlend (const Cmpnts V[8], PetscReal xi, PetscReal eta, PetscReal zta, Cmpnts *Xp) |
| Blend eight corner values at the supplied trilinear reference coordinates. | |
| PetscErrorCode | MetricLogicalToPhysical (UserCtx *user, const Cmpnts ***X, PetscInt i, PetscInt j, PetscInt k, PetscReal xi, PetscReal eta, PetscReal zta, Cmpnts *Xp) |
| Implementation of MetricLogicalToPhysical(). | |
| PetscErrorCode | MetricJacobian (UserCtx *user, const Cmpnts ***X, PetscInt i, PetscInt j, PetscInt k, PetscReal xi, PetscReal eta, PetscReal zta, PetscReal J[3][3], PetscReal *detJ) |
| Implementation of MetricJacobian(). | |
| PetscErrorCode | MetricVelocityContravariant (const PetscReal J[3][3], PetscReal detJ, const PetscReal u[3], PetscReal uc[3]) |
| Implementation of MetricVelocityContravariant(). | |
| PetscErrorCode | InvertCovariantMetricTensor (double covariantTensor[3][3], double contravariantTensor[3][3]) |
| Implementation of InvertCovariantMetricTensor(). | |
| PetscErrorCode | CalculateFaceNormalAndArea (Cmpnts csi, Cmpnts eta, Cmpnts zet, double ni[3], double nj[3], double nk[3], double *Ai, double *Aj, double *Ak) |
| Implementation of CalculateFaceNormalAndArea(). | |
| PetscErrorCode | ComputeCellCharacteristicLengthScale (PetscReal ajc, Cmpnts csi, Cmpnts eta, Cmpnts zet, double *dx, double *dy, double *dz) |
| Implementation of ComputeCellCharacteristicLengthScale(). | |
| PetscErrorCode | ComputeCellDirectionalExtents (PetscReal ajc, Cmpnts csi, Cmpnts eta, Cmpnts zet, double *l_xi, double *l_eta, double *l_zeta) |
| Implementation of ComputeCellDirectionalExtents(). | |
| PetscErrorCode | ComputeCellEdgeVectors (PetscReal ajc, Cmpnts csi, Cmpnts eta, Cmpnts zet, Cmpnts edges[3]) |
| Implementation of ComputeCellEdgeVectors(). | |
| PetscErrorCode | CheckAndFixGridOrientation (UserCtx *user) |
| Implementation of CheckAndFixGridOrientation(). | |
| PetscErrorCode | ApplyPeriodicCorrectionsToCellCenters (UserCtx *user) |
| Implementation of ApplyPeriodicCorrectionsToCellCenters(). | |
| PetscErrorCode | ApplyPeriodicCorrectionsToIFaceCenter (UserCtx *user) |
| Implementation of ApplyPeriodicCorrectionsToIFaceCenter(). | |
| PetscErrorCode | ApplyPeriodicCorrectionsToJFaceCenter (UserCtx *user) |
| Implementation of ApplyPeriodicCorrectionsToJFaceCenter(). | |
| PetscErrorCode | ApplyPeriodicCorrectionsToKFaceCenter (UserCtx *user) |
| Implementation of ApplyPeriodicCorrectionsToKFaceCenter(). | |
| PetscErrorCode | ComputeFaceMetrics (UserCtx *user) |
| Implementation of ComputeFaceMetrics(). | |
| PetscErrorCode | ComputeCellCenteredJacobianInverse (UserCtx *user) |
| Implementation of ComputeCellCenteredJacobianInverse(). | |
| PetscErrorCode | ComputeCellCenters (UserCtx *user) |
| Implementation of ComputeCellCenters(). | |
| PetscErrorCode | ComputeGridLineFractions (UserCtx *user, Vec fraction, Vec length) |
| Implementation of ComputeGridLineFractions(). | |
| PetscErrorCode | ComputeIFaceMetrics (UserCtx *user) |
| Implementation of ComputeIFaceMetrics(). | |
| PetscErrorCode | ComputeJFaceMetrics (UserCtx *user) |
| Implementation of ComputeJFaceMetrics(). | |
| PetscErrorCode | ComputeKFaceMetrics (UserCtx *user) |
| Implementation of ComputeKFaceMetrics(). | |
| static PetscInt | Gidx (PetscInt i, PetscInt j, PetscInt k, UserCtx *user) |
| Convert logical cell indices into the flattened global cell identifier. | |
| PetscErrorCode | ComputeMetricsDivergence (UserCtx *user) |
| Implementation of ComputeMetricsDivergence(). | |
| PetscErrorCode | ComputeMetricNorms (UserCtx *user) |
| Implementation of ComputeMetricNorms(). | |
| PetscErrorCode | CalculateAllGridMetrics (SimCtx *simCtx) |
| Implementation of CalculateAllGridMetrics(). | |
Variables | |
| static const FieldId | kFacePlaneFields [] |
| The catalogued fields MetricComputeFacePlanes() owns. | |
| static const FieldId | kFacePlaneVectorFields [2][2][3] |
| The plane fields by family: [dual][normal = 0, centroid = 1][axis]. | |
| static const PetscInt | kPrimalFaceShift [3][3] = {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}} |
| Offset from a face's lower-corner origin to where its family stores it (see Metric.h). | |
| #define PICURV_AT | ( | i, | |
| j, | |||
| k | |||
| ) | X[MetricCellFacePlanesIndex(info, (i), (j), (k))] |
| PetscErrorCode MetricGetCellVertices | ( | UserCtx * | user, |
| const Cmpnts *** | X, | ||
| PetscInt | i, | ||
| PetscInt | j, | ||
| PetscInt | k, | ||
| Cmpnts | V[8] | ||
| ) |
Implementation of MetricGetCellVertices().
Collects the eight node coordinates of one logical hexahedral cell.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 24 of file Metric.c.
| PetscBool MetricFacePlane | ( | const Cmpnts | v1, |
| const Cmpnts | v2, | ||
| const Cmpnts | v3, | ||
| const Cmpnts | v4, | ||
| const Cmpnts | cell_centroid, | ||
| FacePlane * | plane, | ||
| PetscBool * | degenerate | ||
| ) |
Implementation of MetricFacePlane().
Builds one face plane: the unit outward normal of (v2 - v1) x (v4 - v1) and the vertex mean.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 47 of file Metric.c.
Centroid of a hexahedral cell: the mean of its eight vertices.
| [in] | cell | The cell. |
Definition at line 87 of file Metric.c.
| void MetricBuildCellFacePlanes | ( | const Cell * | cell, |
| CellFacePlanes * | planes | ||
| ) |
Implementation of MetricBuildCellFacePlanes().
Builds the six face planes of a hexahedron, as the particle search tests them.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 108 of file Metric.c.
|
static |
Where a face-plane field's vectors live in user, and its DM.
FieldGetView() needs the vectors to exist; this reaches them before they are created and after they are destroyed.
| [in] | user | Block context. |
| [in] | id | One of kFacePlaneFields. |
| [out] | dm | The field's DM. |
| [out] | global | The UserCtx member holding its global vector. |
| [out] | local | The UserCtx member holding its local vector. |
Definition at line 159 of file Metric.c.
|
inlinestatic |
The eight vertices of the cell whose origin node is (i, j, k), in RetrieveCurrentCell() order, from a flat ghosted local array indexed as MetricCellFacePlanesIndex().
Definition at line 177 of file Metric.c.
|
inlinestatic |
The local vectors of the primal or the dual planes, as MetricGetFacePlaneArrays() reads them.
Definition at line 191 of file Metric.c.
| PetscErrorCode MetricComputeFacePlanes | ( | UserCtx * | user | ) |
Implementation of MetricComputeFacePlanes().
Builds the block's particle face planes once, as catalogued per-face fields.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 208 of file Metric.c.
| PetscErrorCode MetricDestroyFacePlanes | ( | UserCtx * | user | ) |
Implementation of MetricDestroyFacePlanes().
Frees the face-plane fields MetricComputeFacePlanes() built, if any.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 355 of file Metric.c.
| PetscErrorCode MetricGetFacePlaneArrays | ( | UserCtx * | user, |
| PetscBool | dual, | ||
| FacePlaneArrays * | arrays | ||
| ) |
Implementation of MetricGetFacePlaneArrays().
Opens a family's face-plane arrays for reading; MetricComputeFacePlanes() must have run.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 376 of file Metric.c.
| PetscErrorCode MetricRestoreFacePlaneArrays | ( | UserCtx * | user, |
| FacePlaneArrays * | arrays | ||
| ) |
Implementation of MetricRestoreFacePlaneArrays().
Closes arrays opened by MetricGetFacePlaneArrays().
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 401 of file Metric.c.
| void MetricGatherCellFacePlanes | ( | const FacePlaneArrays * | arrays, |
| const DMDALocalInfo * | info, | ||
| PetscInt | i, | ||
| PetscInt | j, | ||
| PetscInt | k, | ||
| CellFacePlanes * | planes | ||
| ) |
Implementation of MetricGatherCellFacePlanes().
Assembles one cell's six outward face planes from the shared per-face planes.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 421 of file Metric.c.
|
inlinestatic |
Blend eight corner values at the supplied trilinear reference coordinates.
Definition at line 451 of file Metric.c.
| PetscErrorCode MetricLogicalToPhysical | ( | UserCtx * | user, |
| const Cmpnts *** | X, | ||
| PetscInt | i, | ||
| PetscInt | j, | ||
| PetscInt | k, | ||
| PetscReal | xi, | ||
| PetscReal | eta, | ||
| PetscReal | zta, | ||
| Cmpnts * | Xp | ||
| ) |
Implementation of MetricLogicalToPhysical().
Maps a logical point inside one hexahedral cell to physical space.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 475 of file Metric.c.
| PetscErrorCode MetricJacobian | ( | UserCtx * | user, |
| const Cmpnts *** | X, | ||
| PetscInt | i, | ||
| PetscInt | j, | ||
| PetscInt | k, | ||
| PetscReal | xi, | ||
| PetscReal | eta, | ||
| PetscReal | zta, | ||
| PetscReal | J[3][3], | ||
| PetscReal * | detJ | ||
| ) |
Implementation of MetricJacobian().
Evaluates the trilinear mapping Jacobian and its determinant in one cell.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 502 of file Metric.c.
| PetscErrorCode MetricVelocityContravariant | ( | const PetscReal | J[3][3], |
| PetscReal | detJ, | ||
| const PetscReal | u[3], | ||
| PetscReal | uc[3] | ||
| ) |
Implementation of MetricVelocityContravariant().
Converts a Cartesian velocity vector to contravariant logical components.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 560 of file Metric.c.
| PetscErrorCode InvertCovariantMetricTensor | ( | double | covariantTensor[3][3], |
| double | contravariantTensor[3][3] | ||
| ) |
Implementation of InvertCovariantMetricTensor().
Inverts the 3x3 matrix of face-area vectors to obtain the covariant directions.
Definition at line 595 of file Metric.c.
| PetscErrorCode CalculateFaceNormalAndArea | ( | Cmpnts | csi, |
| Cmpnts | eta, | ||
| Cmpnts | zet, | ||
| double | ni[3], | ||
| double | nj[3], | ||
| double | nk[3], | ||
| double * | Ai, | ||
| double * | Aj, | ||
| double * | Ak | ||
| ) |
Implementation of CalculateFaceNormalAndArea().
Computes the unit normal vectors and areas of the three faces of a computational cell.
Definition at line 644 of file Metric.c.
| PetscErrorCode ComputeCellCharacteristicLengthScale | ( | PetscReal | ajc, |
| Cmpnts | csi, | ||
| Cmpnts | eta, | ||
| Cmpnts | zet, | ||
| double * | dx, | ||
| double * | dy, | ||
| double * | dz | ||
| ) |
Implementation of ComputeCellCharacteristicLengthScale().
Computes characteristic length scales (dx, dy, dz) for a curvilinear cell.
Definition at line 688 of file Metric.c.
| PetscErrorCode ComputeCellDirectionalExtents | ( | PetscReal | ajc, |
| Cmpnts | csi, | ||
| Cmpnts | eta, | ||
| Cmpnts | zet, | ||
| double * | l_xi, | ||
| double * | l_eta, | ||
| double * | l_zeta | ||
| ) |
Implementation of ComputeCellDirectionalExtents().
Computes a cell's extent along each of its own grid directions.
Full API contract is documented with the header declaration in include/Metric.h.
Definition at line 717 of file Metric.c.
| PetscErrorCode ComputeCellEdgeVectors | ( | PetscReal | ajc, |
| Cmpnts | csi, | ||
| Cmpnts | eta, | ||
| Cmpnts | zet, | ||
| Cmpnts | edges[3] | ||
| ) |
Implementation of ComputeCellEdgeVectors().
Computes a cell's edge vectors along its three grid directions.
Full API contract is documented with the header declaration in include/Metric.h.
Definition at line 749 of file Metric.c.
| PetscErrorCode CheckAndFixGridOrientation | ( | UserCtx * | user | ) |
Implementation of CheckAndFixGridOrientation().
Verify and, when consistently inverted, repair the right-handed metric basis (Csi, Eta, Zet) and a positive Jacobian (Aj) over the whole domain.
Definition at line 778 of file Metric.c.
| PetscErrorCode ApplyPeriodicCorrectionsToCellCenters | ( | UserCtx * | user | ) |
Implementation of ApplyPeriodicCorrectionsToCellCenters().
Builds translated periodic images for the dummy cell centers of periodic axes.
Definition at line 831 of file Metric.c.
| PetscErrorCode ApplyPeriodicCorrectionsToIFaceCenter | ( | UserCtx * | user | ) |
Implementation of ApplyPeriodicCorrectionsToIFaceCenter().
Builds translated periodic images for i-face centers (Centx).
Definition at line 890 of file Metric.c.
| PetscErrorCode ApplyPeriodicCorrectionsToJFaceCenter | ( | UserCtx * | user | ) |
Implementation of ApplyPeriodicCorrectionsToJFaceCenter().
Builds translated periodic images for j-face centers (Centy).
Definition at line 906 of file Metric.c.
| PetscErrorCode ApplyPeriodicCorrectionsToKFaceCenter | ( | UserCtx * | user | ) |
Implementation of ApplyPeriodicCorrectionsToKFaceCenter().
Builds translated periodic images for k-face centers (Centz).
Definition at line 922 of file Metric.c.
| PetscErrorCode ComputeFaceMetrics | ( | UserCtx * | user | ) |
Implementation of ComputeFaceMetrics().
Computes the primary face metric components (Csi, Eta, Zet), including boundary extrapolation, and stores them in the corresponding global Vec members of the UserCtx structure (user->Csi, user->Eta, user->Zet).
Definition at line 937 of file Metric.c.
| PetscErrorCode ComputeCellCenteredJacobianInverse | ( | UserCtx * | user | ) |
Implementation of ComputeCellCenteredJacobianInverse().
Calculates the cell-centered inverse Jacobian determinant (1/J) for INTERIOR cells and stores it in user->Aj.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/Metric.h.
Definition at line 1147 of file Metric.c.
| PetscErrorCode ComputeCellCenters | ( | UserCtx * | user | ) |
Implementation of ComputeCellCenters().
Computes the physical location of each cell's center from the nodal coordinates.
Definition at line 1291 of file Metric.c.
| PetscErrorCode ComputeGridLineFractions | ( | UserCtx * | user, |
| Vec | fraction, | ||
| Vec | length | ||
| ) |
Implementation of ComputeGridLineFractions().
Arc-length position of every owned cell centre along its three grid lines.
Full API contract is documented with the header declaration in include/Metric.h.
Definition at line 1362 of file Metric.c.
| PetscErrorCode ComputeIFaceMetrics | ( | UserCtx * | user | ) |
Implementation of ComputeIFaceMetrics().
Computes metrics centered on constant-i faces (i-faces).
Definition at line 1439 of file Metric.c.
| PetscErrorCode ComputeJFaceMetrics | ( | UserCtx * | user | ) |
Implementation of ComputeJFaceMetrics().
Computes metrics centered on constant-j faces (j-faces).
Definition at line 1646 of file Metric.c.
| PetscErrorCode ComputeKFaceMetrics | ( | UserCtx * | user | ) |
Implementation of ComputeKFaceMetrics().
Computes metrics centered on constant-k faces (k-faces).
Definition at line 1837 of file Metric.c.
|
static |
Convert logical cell indices into the flattened global cell identifier.
Definition at line 2027 of file Metric.c.
| PetscErrorCode ComputeMetricsDivergence | ( | UserCtx * | user | ) |
Implementation of ComputeMetricsDivergence().
Performs a diagnostic check on the divergence of the face area metric vectors.
Definition at line 2047 of file Metric.c.
| PetscErrorCode ComputeMetricNorms | ( | UserCtx * | user | ) |
Implementation of ComputeMetricNorms().
Computes the max-min values of the grid metrics.
Definition at line 2137 of file Metric.c.
| PetscErrorCode CalculateAllGridMetrics | ( | SimCtx * | simCtx | ) |
Implementation of CalculateAllGridMetrics().
Orchestrates the calculation of all grid metrics.
Definition at line 2267 of file Metric.c.
|
static |
The catalogued fields MetricComputeFacePlanes() owns.
|
static |