|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
Lower-level functions used by the main scattering routines. More...
Macros | |
| #define | __FUNCT__ "InterpolateFieldFromCornerToCenter_Vector" |
| #define | __FUNCT__ "InterpolateFieldFromCornerToCenter_Scalar" |
| #define | __FUNCT__ "TestCornerToCenterInterpolation" |
| #define | __FUNCT__ "InterpolateFieldFromCenterToCorner_Vector" |
| #define | __FUNCT__ "InterpolateFieldFromCenterToCorner_Scalar" |
| #define | __FUNCT__ "InterpolateEulerFieldFromCenterToSwarm" |
| #define | __FUNCT__ "InterpolateEulerFieldFromCornerToSwarm" |
| #define | __FUNCT__ "InterpolateEulerFieldToSwarm" |
| #define | __FUNCT__ "InterpolateAllFieldsToSwarm" |
| #define | __FUNCT__ "GetScatterTargetInfo" |
| #define | __FUNCT__ "GetPersistentLocalVector" |
| #define | __FUNCT__ "AccumulateParticleField" |
| #define | __FUNCT__ "NormalizeGridVectorByCount" |
| #define | __FUNCT__ "ScatterParticleFieldToEulerField_Internal" |
| #define | __FUNCT__ "ScatterParticleFieldToEulerField" |
| #define | __FUNCT__ "ScatterAllParticleFieldsToEulerFields" |
| #define | __FUNCT__ "InterpolateCornerToFaceCenter_Scalar" |
| #define | __FUNCT__ "InterpolateCornerToFaceCenter_Vector" |
Functions | |
| PetscErrorCode | AccumulateParticleField (DM swarm, const char *particleFieldName, DM gridSumDM, Vec gridSumVec) |
| Accumulates a particle field (scalar or vector) into a target grid sum vector. | |
| PetscErrorCode | NormalizeGridVectorByCount (DM countDM, Vec countVec, DM dataDM, Vec sumVec, Vec avgVec) |
| Normalizes a grid vector of sums by a grid vector of counts to produce an average. | |
| PetscErrorCode | GetScatterTargetInfo (UserCtx *user, const char *particleFieldName, DM *targetDM, PetscInt *expected_dof) |
| Determines the target Eulerian DM and expected DOF for scattering a given particle field. | |
| PetscErrorCode | GetPersistentLocalVector (UserCtx *user, const char *fieldName, Vec *localVec) |
Internal helper implementation: GetPersistentLocalVector(). | |
Lower-level functions used by the main scattering routines.
| #define __FUNCT__ "InterpolateFieldFromCornerToCenter_Vector" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "InterpolateFieldFromCornerToCenter_Scalar" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "TestCornerToCenterInterpolation" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "InterpolateFieldFromCenterToCorner_Vector" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "InterpolateFieldFromCenterToCorner_Scalar" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "InterpolateEulerFieldFromCenterToSwarm" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "InterpolateEulerFieldFromCornerToSwarm" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "InterpolateEulerFieldToSwarm" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "InterpolateAllFieldsToSwarm" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "GetScatterTargetInfo" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "GetPersistentLocalVector" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "AccumulateParticleField" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "NormalizeGridVectorByCount" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "ScatterParticleFieldToEulerField_Internal" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "ScatterParticleFieldToEulerField" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "ScatterAllParticleFieldsToEulerFields" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "InterpolateCornerToFaceCenter_Scalar" |
Definition at line 20 of file interpolation.c.
| #define __FUNCT__ "InterpolateCornerToFaceCenter_Vector" |
Definition at line 20 of file interpolation.c.
| PetscErrorCode AccumulateParticleField | ( | DM | swarm, |
| const char * | particleFieldName, | ||
| DM | gridSumDM, | ||
| Vec | gridSumVec | ||
| ) |
Accumulates a particle field (scalar or vector) into a target grid sum vector.
This function iterates through local particles, identifies their cell using the "DMSwarm_CellID" field, and adds the particle's field value (particleFieldName) to the corresponding cell location in the gridSumVec. It handles both scalar (DOF=1) and vector (DOF=3) fields automatically based on the DOF of gridSumDM.
IMPORTANT: The caller must ensure gridSumVec is zeroed before calling this function if a fresh sum calculation is desired.
| [in] | swarm | The DMSwarm containing particles. |
| [in] | particleFieldName | Name of the field on the particles (must match DOF). |
| [in] | gridSumDM | The DMDA associated with gridSumVec. Its DOF determines how many components are accumulated. |
| [in,out] | gridSumVec | The Vec (associated with gridSumDM) to accumulate sums into. |
Definition at line 1579 of file interpolation.c.
| PetscErrorCode NormalizeGridVectorByCount | ( | DM | countDM, |
| Vec | countVec, | ||
| DM | dataDM, | ||
| Vec | sumVec, | ||
| Vec | avgVec | ||
| ) |
Normalizes a grid vector of sums by a grid vector of counts to produce an average.
Calculates avgVec[i] = sumVec[i] / countVec[i] for each component of each OWNED cell where countVec[i] > 0. Sets avgVec[i] = 0 otherwise. Handles both scalar (DOF=1) and vector (DOF=3) data fields based on dataDM. Uses basic VecGetArray/VecGetArrayRead and manual index calculation.
| [in] | countDM | The DMDA associated with countVec (must have DOF=1). |
| [in] | countVec | The Vec containing particle counts per cell (read-only). |
| [in] | dataDM | The DMDA associated with sumVec and avgVec (must have DOF=1 or DOF=3). |
| [in] | sumVec | The Vec containing the accumulated sums per cell (read-only). |
| [in,out] | avgVec | The Vec where the calculated averages will be stored (overwritten). |
Definition at line 1693 of file interpolation.c.
| PetscErrorCode GetScatterTargetInfo | ( | UserCtx * | user, |
| const char * | particleFieldName, | ||
| DM * | targetDM, | ||
| PetscInt * | expected_dof | ||
| ) |
Determines the target Eulerian DM and expected DOF for scattering a given particle field.
Based on hardcoded rules mapping particle field names to user context DMs (da/fda). This function encapsulates the policy of where different fields should be scattered.
| [in] | user | Pointer to the UserCtx containing da and fda. |
| [in] | particleFieldName | Name of the particle field (e.g., "P", "Ucat"). |
| [out] | targetDM | Pointer to store the determined target DM (da or fda). |
| [out] | expected_dof | Pointer to store the expected DOF (1 or 3) for this field. |
Definition at line 1486 of file interpolation.c.
| PetscErrorCode GetPersistentLocalVector | ( | UserCtx * | user, |
| const char * | fieldName, | ||
| Vec * | localVec | ||
| ) |
Internal helper implementation: GetPersistentLocalVector().
Retrieves the persistent local vector (e.g., lPsi, lUcat) for a given field name.
Local to this translation unit.
Definition at line 1540 of file interpolation.c.