Configured initial values of particle-carried fields. More...
Go to the source code of this file.
Data Structures | |
| struct | ParticleFieldBinding |
| One configured field: its identity and one expression per component. More... | |
| struct | ParticleFieldPlan |
Macros | |
| #define | PARTICLE_VARIABLE_PID ((PetscInt)PICURV_SOURCE_VAR_CELL_COUNT) |
| #define | PARTICLE_VARIABLE_COUNT (PARTICLE_VARIABLE_PID + 1) |
| #define | PARTICLE_FIELD_MAX_COMPONENTS 3 |
| #define | PARTICLE_FIELD_EXPRESSION_LENGTH 4096 |
| #define | PARTICLE_FIELD_HISTOGRAM_BINS 10 |
Functions | |
| PetscErrorCode | ParticleFieldPlanCreate (const char *prefix, ParticleFieldPlan **plan) |
| Implementation of ParticleFieldPlanCreate(). | |
| static PetscErrorCode | PlanReadsGridLines (const ParticleFieldPlan *plan, PetscBool *reads) |
| Whether any configured expression reads a grid line's fraction or length. | |
| PetscErrorCode | ParticleFieldPlanApply (UserCtx *user, ParticleFieldPlan *plan, const ParticleFieldEvent *event, PetscInt first, PetscInt end) |
| Implementation of ParticleFieldPlanApply(). | |
| PetscErrorCode | ParticleFieldPlanSummarize (UserCtx *user, const ParticleFieldPlan *plan) |
| Implementation of ParticleFieldPlanSummarize(). | |
| PetscErrorCode | ParticleFieldPlanDestroy (ParticleFieldPlan **plan) |
| Implementation of ParticleFieldPlanDestroy(). | |
Variables | |
| static const char *const | kParticleVariables [] = {"x", "y", "z", "t", "xi", "eta", "zeta", "L_xi", "L_eta", "L_zeta", "pid"} |
Names a particle expression may use: those of every source (PicurvSourceVariable), then pid. | |
Configured initial values of particle-carried fields.
Each field's expressions are compiled once by the shared engine (expression.c) and evaluated per particle. Draws are keyed on the particle's identity, so a value does not depend on rank count, particle order, or how often it is evaluated.
Definition in file ParticleInitialConditions.c.
| struct ParticleFieldBinding |
One configured field: its identity and one expression per component.
Definition at line 30 of file ParticleInitialConditions.c.
| Data Fields | ||
|---|---|---|
| ParticleFieldId | field | |
| PetscInt | components | |
| PicurvExpression * | component[3] | |
| struct ParticleFieldPlan |
Definition at line 36 of file ParticleInitialConditions.c.
| Data Fields | ||
|---|---|---|
| PetscInt | count | |
| ParticleFieldBinding * | bindings | |
| Vec | local_fraction | Grid-line fractions, computed once when an expression first reads them. |
| Vec | local_length | Grid-line lengths, likewise. |
| #define PARTICLE_VARIABLE_PID ((PetscInt)PICURV_SOURCE_VAR_CELL_COUNT) |
Definition at line 23 of file ParticleInitialConditions.c.
| #define PARTICLE_VARIABLE_COUNT (PARTICLE_VARIABLE_PID + 1) |
Definition at line 24 of file ParticleInitialConditions.c.
| #define PARTICLE_FIELD_MAX_COMPONENTS 3 |
Definition at line 25 of file ParticleInitialConditions.c.
| #define PARTICLE_FIELD_EXPRESSION_LENGTH 4096 |
Definition at line 26 of file ParticleInitialConditions.c.
| #define PARTICLE_FIELD_HISTOGRAM_BINS 10 |
Definition at line 27 of file ParticleInitialConditions.c.
| PetscErrorCode ParticleFieldPlanCreate | ( | const char * | prefix, |
| ParticleFieldPlan ** | plan | ||
| ) |
Implementation of ParticleFieldPlanCreate().
Read a plan from the options database.
Definition at line 47 of file ParticleInitialConditions.c.
|
static |
Whether any configured expression reads a grid line's fraction or length.
Definition at line 104 of file ParticleInitialConditions.c.
| PetscErrorCode ParticleFieldPlanApply | ( | UserCtx * | user, |
| ParticleFieldPlan * | plan, | ||
| const ParticleFieldEvent * | event, | ||
| PetscInt | first, | ||
| PetscInt | end | ||
| ) |
Implementation of ParticleFieldPlanApply().
Write the plan's values into swarm entries [first, end) of this rank.
Definition at line 124 of file ParticleInitialConditions.c.
| PetscErrorCode ParticleFieldPlanSummarize | ( | UserCtx * | user, |
| const ParticleFieldPlan * | plan | ||
| ) |
Implementation of ParticleFieldPlanSummarize().
Log and record the realized initial values of every planned field.
Definition at line 240 of file ParticleInitialConditions.c.
| PetscErrorCode ParticleFieldPlanDestroy | ( | ParticleFieldPlan ** | plan | ) |
Implementation of ParticleFieldPlanDestroy().
Free a plan and its compiled expressions.
Definition at line 324 of file ParticleInitialConditions.c.
|
static |
Names a particle expression may use: those of every source (PicurvSourceVariable), then pid.
Definition at line 22 of file ParticleInitialConditions.c.