|
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__ "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, ParticleFieldId particle_field_id, 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. | |
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__ "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, |
| ParticleFieldId | particle_field_id, | ||
| 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] | particle_field_id | Typed identity of the particle field (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 1478 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 1600 of file interpolation.c.