Authoritative identities and storage metadata for persistent Eulerian fields. More...
Go to the source code of this file.
Data Structures | |
| struct | FieldDimension |
| Physical dimension as exponents of the reference length, velocity, and density. More... | |
| struct | FieldDescriptor |
| Immutable metadata for one field identity. More... | |
| struct | FieldView |
| Non-owning runtime objects resolved for one field and UserCtx. More... | |
Macros | |
| #define | FIELD_DIM_DIMENSIONLESS {FIELD_DIMENSION_FIXED, 0, 0, 0} |
| #define | FIELD_DIM_LENGTH {FIELD_DIMENSION_FIXED, 1, 0, 0} |
| #define | FIELD_DIM_AREA {FIELD_DIMENSION_FIXED, 2, 0, 0} |
| #define | FIELD_DIM_INVERSE_VOLUME {FIELD_DIMENSION_FIXED, -3, 0, 0} |
| #define | FIELD_DIM_TIME {FIELD_DIMENSION_FIXED, 1, -1, 0} |
| #define | FIELD_DIM_VELOCITY {FIELD_DIMENSION_FIXED, 0, 1, 0} |
| #define | FIELD_DIM_VOLUME_FLUX {FIELD_DIMENSION_FIXED, 2, 1, 0} |
| #define | FIELD_DIM_DIFFUSIVITY {FIELD_DIMENSION_FIXED, 1, 1, 0} |
| #define | FIELD_DIM_PRESSURE {FIELD_DIMENSION_FIXED, 0, 2, 1} |
| #define | FIELD_DIM_VELOCITY_SQUARED {FIELD_DIMENSION_FIXED, 0, 2, 0} |
| #define | FIELD_DIM_INVERSE_TIME_SQUARED {FIELD_DIMENSION_FIXED, -2, 2, 0} |
| #define | FIELD_DIM_NOT_A_QUANTITY {FIELD_DIMENSION_NOT_A_QUANTITY, 0, 0, 0} |
| #define | FIELD_DIM_FROM_SOURCE {FIELD_DIMENSION_FROM_SOURCE, 0, 0, 0} |
Functions | |
| PetscErrorCode | FieldGetDescriptor (FieldId field_id, const FieldDescriptor **descriptor) |
| Return immutable metadata for a valid field identifier. | |
| PetscErrorCode | FieldIdFromName (const char *field_name, FieldId *field_id) |
| Resolve a user-facing field name once into its typed identity. | |
| PetscErrorCode | FieldTryIdFromName (const char *field_name, FieldId *field_id, PetscBool *found) |
| Look a name up without treating an unknown name as an error. | |
| PetscErrorCode | FieldDimensionReferenceScale (const ScalingCtx *scaling, FieldDimension dimension, PetscReal *scale) |
| Return the factor that turns a solver value of one dimension into physical units. | |
| PetscErrorCode | FieldDimensionLabel (FieldDimension dimension, char *label, size_t length) |
Write a printable form of a dimension, such as L^2 U or dimensionless. | |
| const char * | FieldCanonicalName (FieldId field_id) |
| Return the canonical printable name for an ID. | |
| const char * | FieldLayoutName (FieldLayout layout) |
| Return a stable printable label for a field layout. | |
| PetscErrorCode | FieldGetView (UserCtx *user, FieldId field_id, FieldView *view) |
| Resolve the existing DM and global/local vectors for one field. | |
Authoritative identities and storage metadata for persistent Eulerian fields.
Field identifiers describe conceptual fields at compile time. They do not own, allocate, or modify PETSc objects. A FieldView resolves one identifier against an existing UserCtx after the normal setup lifecycle has created its DMs and vectors.
Definition in file field_catalog.h.
| struct FieldDimension |
Physical dimension as exponents of the reference length, velocity, and density.
A solver value of dimension (a, b, c) becomes physical when multiplied by L_ref^a U_ref^b rho_ref^c. The launcher records input dimensions with the same triple (picurv_cli/core.py, INPUT_QUANTITIES), so input and output conversion use one vocabulary. See docs/pages/19_Nondimensionalization.md.
Definition at line 149 of file field_catalog.h.
| Data Fields | ||
|---|---|---|
| FieldDimensionKind | kind | |
| signed char | length | |
| signed char | velocity | |
| signed char | density | |
| struct FieldDescriptor |
Immutable metadata for one field identity.
Definition at line 173 of file field_catalog.h.
| Data Fields | ||
|---|---|---|
| FieldId | id | |
| const char * | canonical_name | |
| const char * | alias_1 | |
| const char * | alias_2 | |
| PetscInt | dof | |
| FieldDMKind | dm_kind | |
| FieldLayout | layout | |
| FieldSyncClass | sync_class | |
| unsigned int | availability | |
| unsigned int | capabilities | |
| size_t | global_vec_offset | |
| size_t | local_vec_offset | |
| FieldDimension | dimension | |
| struct FieldView |
Non-owning runtime objects resolved for one field and UserCtx.
Definition at line 190 of file field_catalog.h.
| Data Fields | ||
|---|---|---|
| const FieldDescriptor * | descriptor | |
| DM | dm | |
| Vec | global_vec | |
| Vec | local_vec | |
| #define FIELD_DIM_DIMENSIONLESS {FIELD_DIMENSION_FIXED, 0, 0, 0} |
Definition at line 158 of file field_catalog.h.
| #define FIELD_DIM_LENGTH {FIELD_DIMENSION_FIXED, 1, 0, 0} |
Definition at line 159 of file field_catalog.h.
| #define FIELD_DIM_AREA {FIELD_DIMENSION_FIXED, 2, 0, 0} |
Definition at line 160 of file field_catalog.h.
| #define FIELD_DIM_INVERSE_VOLUME {FIELD_DIMENSION_FIXED, -3, 0, 0} |
Definition at line 161 of file field_catalog.h.
| #define FIELD_DIM_TIME {FIELD_DIMENSION_FIXED, 1, -1, 0} |
Definition at line 162 of file field_catalog.h.
| #define FIELD_DIM_VELOCITY {FIELD_DIMENSION_FIXED, 0, 1, 0} |
Definition at line 163 of file field_catalog.h.
| #define FIELD_DIM_VOLUME_FLUX {FIELD_DIMENSION_FIXED, 2, 1, 0} |
Definition at line 164 of file field_catalog.h.
| #define FIELD_DIM_DIFFUSIVITY {FIELD_DIMENSION_FIXED, 1, 1, 0} |
Definition at line 165 of file field_catalog.h.
| #define FIELD_DIM_PRESSURE {FIELD_DIMENSION_FIXED, 0, 2, 1} |
Definition at line 166 of file field_catalog.h.
| #define FIELD_DIM_VELOCITY_SQUARED {FIELD_DIMENSION_FIXED, 0, 2, 0} |
Definition at line 167 of file field_catalog.h.
| #define FIELD_DIM_INVERSE_TIME_SQUARED {FIELD_DIMENSION_FIXED, -2, 2, 0} |
Definition at line 168 of file field_catalog.h.
| #define FIELD_DIM_NOT_A_QUANTITY {FIELD_DIMENSION_NOT_A_QUANTITY, 0, 0, 0} |
Definition at line 169 of file field_catalog.h.
| #define FIELD_DIM_FROM_SOURCE {FIELD_DIMENSION_FROM_SOURCE, 0, 0, 0} |
Definition at line 170 of file field_catalog.h.
| enum FieldId |
Compile-time identity for a catalogued Eulerian field.
Definition at line 23 of file field_catalog.h.
| enum FieldLayout |
Logical storage topology of a field.
| Enumerator | |
|---|---|
| FIELD_LAYOUT_NODE_CENTERED | |
| FIELD_LAYOUT_CELL_CENTERED | |
| FIELD_LAYOUT_I_FACE | |
| FIELD_LAYOUT_J_FACE | |
| FIELD_LAYOUT_K_FACE | |
| FIELD_LAYOUT_COMPONENT_STAGGERED | |
Definition at line 85 of file field_catalog.h.
| enum FieldDMKind |
UserCtx DM family used to store a field.
| Enumerator | |
|---|---|
| FIELD_DM_DA | |
| FIELD_DM_FDA | |
Definition at line 95 of file field_catalog.h.
| enum FieldSyncClass |
Extra repair required after the normal PETSc global-to-local scatter.
| Enumerator | |
|---|---|
| FIELD_SYNC_STANDARD | |
| FIELD_SYNC_I_FACE | |
| FIELD_SYNC_J_FACE | |
| FIELD_SYNC_K_FACE | |
| FIELD_SYNC_COMPONENT_STAGGERED | |
Definition at line 101 of file field_catalog.h.
| enum FieldAvailability |
Conditions controlling when a field can have runtime storage.
Definition at line 110 of file field_catalog.h.
| enum FieldCapabilities |
Operations supported by a catalog entry.
Definition at line 121 of file field_catalog.h.
| enum FieldDimensionKind |
How a field's physical dimension is known.
Definition at line 135 of file field_catalog.h.
| PetscErrorCode FieldGetDescriptor | ( | FieldId | field_id, |
| const FieldDescriptor ** | descriptor | ||
| ) |
Return immutable metadata for a valid field identifier.
| [in] | field_id | Compile-time field identity. |
| [out] | descriptor | Catalog entry owned by the field-catalog module. |
Return immutable metadata for a valid field identifier.
Validates the enum range and the table's ID/index invariant before exposing the catalog-owned descriptor.
Definition at line 285 of file field_catalog.c.
| PetscErrorCode FieldIdFromName | ( | const char * | field_name, |
| FieldId * | field_id | ||
| ) |
Resolve a user-facing field name once into its typed identity.
| [in] | field_name | Canonical name or registered alias. |
| [out] | field_id | Resolved field identity. |
Resolve a user-facing field name once into its typed identity.
Name comparison is intentionally confined to ingress; numerical consumers receive the resolved FieldId.
Definition at line 307 of file field_catalog.c.
| PetscErrorCode FieldTryIdFromName | ( | const char * | field_name, |
| FieldId * | field_id, | ||
| PetscBool * | found | ||
| ) |
Look a name up without treating an unknown name as an error.
For callers that consult more than one catalog, such as a name that may be an Eulerian or a particle field.
| [in] | field_name | Canonical name or registered alias. |
| [out] | field_id | Resolved identity, or FIELD_ID_INVALID when not found. |
| [out] | found | Whether the name is registered. |
Look a name up without treating an unknown name as an error.
Definition at line 324 of file field_catalog.c.
| PetscErrorCode FieldDimensionReferenceScale | ( | const ScalingCtx * | scaling, |
| FieldDimension | dimension, | ||
| PetscReal * | scale | ||
| ) |
Return the factor that turns a solver value of one dimension into physical units.
| [in] | scaling | Reference scales of the run. |
| [in] | dimension | Dimension to scale. |
| [out] | scale | L_ref^a U_ref^b rho_ref^c for a fixed dimension (a, b, c). |
PETSC_ERR_ARG_WRONGSTATE for a dimension that is not fixed, since bookkeeping and staging storage have no scale of their own.Return the factor that turns a solver value of one dimension into physical units.
Definition at line 356 of file field_catalog.c.
| PetscErrorCode FieldDimensionLabel | ( | FieldDimension | dimension, |
| char * | label, | ||
| size_t | length | ||
| ) |
Write a printable form of a dimension, such as L^2 U or dimensionless.
| [in] | dimension | Dimension to describe. |
| [out] | label | Destination buffer. |
| [in] | length | Buffer length. |
Write a printable form of a dimension, such as L^2 U or dimensionless.
Definition at line 376 of file field_catalog.c.
| const char * FieldCanonicalName | ( | FieldId | field_id | ) |
Return the canonical printable name for an ID.
| [in] | field_id | Field identity. |
Return the canonical printable name for an ID.
Invalid enum values return a non-null diagnostic sentinel string.
Definition at line 417 of file field_catalog.c.
| const char * FieldLayoutName | ( | FieldLayout | layout | ) |
Return a stable printable label for a field layout.
| [in] | layout | Layout enum to describe. |
Invalid-Layout for an invalid enum.Return a stable printable label for a field layout.
Definition at line 430 of file field_catalog.c.
Resolve the existing DM and global/local vectors for one field.
This function never creates storage. Optional fields whose setup conditions were not enabled retain valid descriptors but return PETSC_ERR_ARG_WRONGSTATE because their runtime vectors are absent.
| [in] | user | Existing per-grid context. |
| [in] | field_id | Field identity to resolve. |
| [out] | view | Non-owning runtime view. |
Resolve the existing DM and global/local vectors for one field.
Resolves DM and Vec handles without allocating, referencing, or destroying PETSc storage.
Definition at line 453 of file field_catalog.c.