|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
Spatial target resolution for the field-statistics pipeline. More...
Go to the source code of this file.
Data Structures | |
| struct | SpatialTargetPlan |
| Resolved iteration domain for one field on one block. More... | |
Macros | |
| #define | PICURV_STATISTICS_FLUID_THRESHOLD 0.1 |
| Threshold below which a cell counts as fluid for the default mask. | |
Enumerations | |
| enum | PicurvTargetKind { PICURV_TARGET_POINTWISE = 0 } |
| Spatial mapping kind. More... | |
| enum | PicurvStatisticsMask { PICURV_STATISTICS_MASK_FLUID = 0 } |
| Point-eligibility mask. More... | |
Functions | |
| PetscErrorCode | PicurvLayoutDimensionIsNodeLike (FieldLayout layout, PetscInt dim, PetscBool *node_like) |
| Reports whether a layout is node-like in one dimension. | |
| PetscErrorCode | SpatialTargetPlanCreate (UserCtx *user, FieldId field_id, PicurvStatisticsMask mask, SpatialTargetPlan *plan) |
| Resolves the iteration domain for one field on one block. | |
| PetscErrorCode | SpatialTargetPlanLocalPointCount (const SpatialTargetPlan *plan, PetscInt *count) |
| Counts the points this rank contributes. | |
| PetscErrorCode | SpatialTargetPlanGlobalPointCount (const SpatialTargetPlan *plan, MPI_Comm comm, PetscInt *count) |
| Counts the points contributed across a communicator. | |
| PetscBool | SpatialTargetPlanMaskAllows (const SpatialTargetPlan *plan, PetscReal nvert_value) |
| Reports whether a point passes the plan's mask. | |
Spatial target resolution for the field-statistics pipeline.
Implements the pointwise identity mapping required by Field Statistics Phase 2 Implementation Specification section 6. The abstraction exists now with only that one mapping so later spatial bins, profiles, regions, and surfaces extend it rather than retrofit it.
The central responsibility is producing an iteration domain that excludes two distinct categories which Field Identity and Layout Catalog section 4 warns must not be conflated:
Nothing here resolves field identity or layout metadata itself; that comes from the typed catalog through FieldGetDescriptor.
Definition in file statistics_target.h.
| struct SpatialTargetPlan |
Resolved iteration domain for one field on one block.
Bounds are half-open [start, end) in DMDA index order (i, j, k) and are already intersected with this rank's owned range, so iterating them touches neither halo storage nor layout boundary/dummy/duplicate-periodic indices. An empty domain on a rank is represented by end[d] <= start[d].
Definition at line 49 of file statistics_target.h.
| Data Fields | ||
|---|---|---|
| PicurvTargetKind | kind | Spatial mapping; always pointwise in Phase 2. |
| PicurvStatisticsMask | mask | Point-eligibility mask. |
| const FieldDescriptor * | descriptor | Catalog metadata for the targeted field. |
| PetscInt | start[3] | Inclusive start per dimension (i, j, k). |
| PetscInt | end[3] | Exclusive end per dimension (i, j, k). |
| #define PICURV_STATISTICS_FLUID_THRESHOLD 0.1 |
Threshold below which a cell counts as fluid for the default mask.
Definition at line 29 of file statistics_target.h.
| enum PicurvTargetKind |
Spatial mapping kind.
Phase 2 implements only the pointwise identity.
| Enumerator | |
|---|---|
| PICURV_TARGET_POINTWISE | |
Definition at line 32 of file statistics_target.h.
| enum PicurvStatisticsMask |
Point-eligibility mask.
Phase 2 implements only the fluid mask.
| Enumerator | |
|---|---|
| PICURV_STATISTICS_MASK_FLUID | |
Definition at line 37 of file statistics_target.h.
| PetscErrorCode PicurvLayoutDimensionIsNodeLike | ( | FieldLayout | layout, |
| PetscInt | dim, | ||
| PetscBool * | node_like | ||
| ) |
Reports whether a layout is node-like in one dimension.
Node-like dimensions carry one more physical entry than cell-like dimensions, because they sit on grid lines rather than between them. I_FACE is node-like in i and cell-like in j and k, and correspondingly for the other face families.
| [in] | layout | Catalog layout. |
| [in] | dim | Dimension index: 0 for i, 1 for j, 2 for k. |
| [out] | node_like | Resolved classification. |
PETSC_ERR_ARG_OUTOFRANGE for an invalid dimension, or PETSC_ERR_ARG_WRONGSTATE for a component-staggered layout, whose components do not share one classification.Reports whether a layout is node-like in one dimension.
Definition at line 15 of file statistics_target.c.
| PetscErrorCode SpatialTargetPlanCreate | ( | UserCtx * | user, |
| FieldId | field_id, | ||
| PicurvStatisticsMask | mask, | ||
| SpatialTargetPlan * | plan | ||
| ) |
Resolves the iteration domain for one field on one block.
Rejects component-staggered fields, whose x, y, and z components live on different face families and therefore cannot share a single pointwise domain. Phase 2 statistics request only cell-centered fields, but the plan resolves node and face layouts correctly so later phases inherit a verified contract.
| [in] | user | Block context supplying the DMDA layout and periodicity. |
| [in] | field_id | Catalogued field to target. |
| [in] | mask | Point-eligibility mask. |
| [out] | plan | Resolved plan. |
Resolves the iteration domain for one field on one block.
Definition at line 76 of file statistics_target.c.
| PetscErrorCode SpatialTargetPlanLocalPointCount | ( | const SpatialTargetPlan * | plan, |
| PetscInt * | count | ||
| ) |
Counts the points this rank contributes.
| [in] | plan | Resolved plan. |
| [out] | count | Local point count; zero for an empty domain. |
PETSC_ERR_ARG_NULL for a null argument.Counts the points this rank contributes.
Definition at line 140 of file statistics_target.c.
| PetscErrorCode SpatialTargetPlanGlobalPointCount | ( | const SpatialTargetPlan * | plan, |
| MPI_Comm | comm, | ||
| PetscInt * | count | ||
| ) |
Counts the points contributed across a communicator.
The result is decomposition independent: it depends only on the layout, global dimensions, and periodicity, never on how ranks divide the domain.
| [in] | plan | Resolved plan. |
| [in] | comm | Communicator to reduce over. |
| [out] | count | Global point count. |
PETSC_ERR_ARG_NULL for a null argument.Counts the points contributed across a communicator.
Definition at line 160 of file statistics_target.c.
| PetscBool SpatialTargetPlanMaskAllows | ( | const SpatialTargetPlan * | plan, |
| PetscReal | nvert_value | ||
| ) |
Reports whether a point passes the plan's mask.
Because Nvert changes when immersed bodies move, the mask is treated as potentially moving: callers accumulate a per-point valid count and weight rather than assuming a point contributes to every accepted state.
| [in] | plan | Resolved plan. |
| [in] | nvert_value | Node-blanking value at the point. |
PETSC_TRUE when the point is eligible.Reports whether a point passes the plan's mask.
Definition at line 176 of file statistics_target.c.