14#ifndef PICURV_STATISTICS_ACCUMULATOR_H
15#define PICURV_STATISTICS_ACCUMULATOR_H
60#define PICURV_STATISTICS_PAYLOAD_NAME_LENGTH 96
156#define PICURV_STATISTICS_VARIANCE_FLOOR 1.0e-12
178 const char *outputs, PetscInt *count);
207 PetscInt index, Vec scalar_target, Vec vector_target,
256 PetscReal *minimum, PetscReal *maximum);
327 const PetscBool average_direction[3],
Vec weight
Per-point valid weight.
PetscInt components
Degrees of freedom the vector carries.
PetscInt components
One or three.
PetscErrorCode PicurvProductComponentCount(PetscInt dof, PetscInt *count)
Reports how many symmetric product components a field's second moment needs.
#define PICURV_STATISTICS_PAYLOAD_NAME_LENGTH
Maximum stored length of a payload name, including the terminator.
Vec occupied_weight_sq
Occupied-state squared weight; NULL likewise.
Vec weight_sq
Per-point squared-weight sum.
PetscErrorCode PicurvWindowStorageReduce(UserCtx *user, const PicurvWindowDefinition *definition, const PicurvWindowStorage *storage, const PetscBool average_direction[3], PicurvWindowStorage *reduced)
Merges a window's pointwise state over homogeneous directions.
PetscInt field_count
Fields accumulated.
PetscInt covariance_count
Covariance pairs accumulated.
PetscErrorCode PicurvWindowDerive(UserCtx *user, const PicurvWindowDefinition *definition, const PicurvWindowStorage *storage, const char *outputs, PetscInt index, Vec scalar_target, Vec vector_target, PicurvDerivedField *field)
Derives one output field from centered accumulator state.
Vec occupied_count
Occupied-state count; NULL without a particle-sampled field.
Vec * mean
One per field, matching that field's layout.
PetscBool point_averaged
Reduced over homogeneous directions as the equal-weight mean of point values, not from the pooled sam...
Vec occupied_weight
Occupied-state weight; NULL without a particle-sampled field.
Vec vec
Borrowed accumulator vector; never owned by the caller.
PetscErrorCode PicurvWindowDerivedCount(const PicurvWindowDefinition *definition, const PicurvWindowStorage *storage, const char *outputs, PetscInt *count)
Reports how many derived fields a requested output set produces.
PetscErrorCode PicurvWindowStorageCreate(UserCtx *user, const PicurvWindowDefinition *definition, PicurvWindowStorage *storage)
Allocates the accumulator state one window owns on one block.
PetscErrorCode PicurvCovarianceComponentCount(PetscInt dof_a, PetscInt dof_b, PetscInt *count)
Reports how many components a covariance between two fields needs.
PetscErrorCode PicurvWindowStorageFromParticles(UserCtx *user, const PicurvWindowDefinition *definition, PicurvWindowStorage *storage)
Fills a window's storage from the particles sampling each cell at one instant.
PetscErrorCode PicurvWindowStoragePayload(UserCtx *user, const PicurvWindowDefinition *definition, const PicurvWindowStorage *storage, PetscInt index, PicurvStatisticsPayload *payload)
Resolves one enumerated payload of a window's storage.
Vec * m2
One per field; NULL when no second moment was requested.
const char * role
Inventory role: occupancy, mean, second_moment, co_moment.
PetscErrorCode PicurvWindowValidFractionRange(UserCtx *user, const PicurvWindowDefinition *definition, const PicurvWindowStorage *storage, PetscInt sample_count, PetscReal *minimum, PetscReal *maximum)
Reports the range of per-point valid fraction across a window's domain.
PetscBool occupied
Measured over the occupied states, so undefined where they are absent.
Vec * occupied_mean
Per field: its mean over the occupied states, for an ordinary field paired with a particle-sampled on...
PetscErrorCode PicurvStatisticsComponentDM(UserCtx *user, PetscInt components, DM *dm)
Resolves the DM carrying a given number of accumulator components.
PetscErrorCode PicurvWindowSpatialMean(UserCtx *user, const PicurvWindowDefinition *definition, const PicurvWindowStorage *storage, Vec field, PetscReal *mean)
Reports the spatial mean of a derived field over the points a window sampled.
Vec count
Per-point accepted sample count.
PetscErrorCode PicurvWindowAccumulate(UserCtx *user, const PicurvWindowDefinition *definition, PicurvWindowStorage *storage, PetscReal weight)
Applies one accepted completed state to a window's accumulators.
PetscErrorCode PicurvWindowStorageDestroy(PicurvWindowStorage *storage)
Releases accumulator state previously created for one window.
const char * layout
Catalog layout name for the inventory entry.
PetscErrorCode PicurvWindowStoragePayloadCount(const PicurvWindowStorage *storage, PetscInt *count)
Reports how many checkpointable vectors one window's storage holds.
Vec * cm
One per covariance pair.
PetscBool physical_units
Holds physical units, as an ensemble of a dimensionalized load does, so derivation applies no scale; ...
One derived output field, resolved by enumeration index.
One checkpointable accumulator vector, resolved by enumeration index.
Independent accumulator state for one window on one block.
Window lifecycle, scheduling, and weighting for the field-statistics pipeline.
The scientifically immutable definition of one window.
Main header file for a complex fluid dynamics solver.
User-defined context containing data specific to a single computational grid level.