|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
#include "walkingsearch.h"#include "logging.h"#include <petsc.h>#include <stdbool.h>#include <math.h>Go to the source code of this file.
Macros | |
| #define | MAX_TRAVERSAL 1000 |
| #define | DISTANCE_THRESHOLD 1e-11 |
| #define | REPEAT_COUNT_THRESHOLD 5 |
| #define | __FUNCT__ "GetCellCharacteristicSize" |
| #define | __FUNCT__ "ComputeSignedDistanceToPlane" |
| #define | __FUNCT__ "CalculateDistancesToCellFaces" |
| #define | __FUNCT__ "DeterminePointPosition" |
| #define | __FUNCT__ "GetCellVerticesFromGrid" |
| #define | __FUNCT__ "InitializeTraversalParameters" |
| #define | __FUNCT__ "CheckCellWithinLocalGrid" |
| #define | __FUNCT__ "RetrieveCurrentCell" |
| #define | __FUNCT__ "EvaluateParticlePosition" |
| #define | __FUNCT__ "UpdateCellIndicesBasedOnDistances" |
| #define | __FUNCT__ "FinalizeTraversal" |
| #define | __FUNCT__ "FindOwnerOfCell" |
| #define | __FUNCT__ "LocateParticleOrFindMigrationTarget" |
| #define | __FUNCT__ "ReportSearchOutcome" |
Functions | |
| PetscErrorCode | GetCellCharacteristicSize (const Cell *cell, PetscReal *cellSize) |
| Implementation of GetCellCharacteristicSize(). | |
| PetscErrorCode | ComputeSignedDistanceToPlane (const Cmpnts v1, const Cmpnts v2, const Cmpnts v3, const Cmpnts v4, const Cmpnts cell_centroid, const Cmpnts p_target, PetscReal *d_signed, const PetscReal threshold) |
Internal helper implementation: ComputeSignedDistanceToPlane(). | |
| PetscErrorCode | CalculateDistancesToCellFaces (const Cmpnts p, const Cell *cell, PetscReal *d, const PetscReal threshold) |
| Implementation of CalculateDistancesToCellFaces(). | |
| PetscErrorCode | DeterminePointPosition (PetscReal *d, PetscInt *result) |
| Implementation of DeterminePointPosition(). | |
| PetscErrorCode | GetCellVerticesFromGrid (Cmpnts ***coor, PetscInt idx, PetscInt idy, PetscInt idz, Cell *cell) |
| Implementation of GetCellVerticesFromGrid(). | |
| PetscErrorCode | InitializeTraversalParameters (UserCtx *user, Particle *particle, PetscInt *idx, PetscInt *idy, PetscInt *idz, PetscInt *traversal_steps) |
| Implementation of InitializeTraversalParameters(). | |
| PetscErrorCode | CheckCellWithinLocalGrid (UserCtx *user, PetscInt idx, PetscInt idy, PetscInt idz, PetscBool *is_within) |
| Implementation of CheckCellWithinLocalGrid(). | |
| PetscErrorCode | RetrieveCurrentCell (UserCtx *user, PetscInt idx, PetscInt idy, PetscInt idz, Cell *cell) |
| Implementation of RetrieveCurrentCell(). | |
| PetscErrorCode | EvaluateParticlePosition (const Cell *cell, PetscReal *d, const Cmpnts p, PetscInt *position, const PetscReal threshold) |
| Implementation of EvaluateParticlePosition(). | |
| PetscErrorCode | UpdateCellIndicesBasedOnDistances (PetscReal d[NUM_FACES], PetscInt *idx, PetscInt *idy, PetscInt *idz) |
Internal helper implementation: UpdateCellIndicesBasedOnDistances(). | |
| PetscErrorCode | FinalizeTraversal (UserCtx *user, Particle *particle, PetscInt traversal_steps, PetscBool cell_found, PetscInt idx, PetscInt idy, PetscInt idz) |
| Implementation of FinalizeTraversal(). | |
| PetscErrorCode | FindOwnerOfCell (UserCtx *user, PetscInt i, PetscInt j, PetscInt k, PetscMPIInt *owner_rank) |
Internal helper implementation: FindOwnerOfCell(). | |
| PetscErrorCode | LocateParticleOrFindMigrationTarget (UserCtx *user, Particle *particle, ParticleLocationStatus *status_out) |
| Implementation of LocateParticleOrFindMigrationTarget(). | |
| PetscErrorCode | ReportSearchOutcome (const Particle *particle, ParticleLocationStatus status, PetscInt traversal_steps) |
| Implementation of ReportSearchOutcome(). | |
| #define MAX_TRAVERSAL 1000 |
Definition at line 10 of file walkingsearch.c.
| #define DISTANCE_THRESHOLD 1e-11 |
Definition at line 11 of file walkingsearch.c.
| #define REPEAT_COUNT_THRESHOLD 5 |
Definition at line 12 of file walkingsearch.c.
| #define __FUNCT__ "GetCellCharacteristicSize" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "ComputeSignedDistanceToPlane" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "CalculateDistancesToCellFaces" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "DeterminePointPosition" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "GetCellVerticesFromGrid" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "InitializeTraversalParameters" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "CheckCellWithinLocalGrid" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "RetrieveCurrentCell" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "EvaluateParticlePosition" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "UpdateCellIndicesBasedOnDistances" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "FinalizeTraversal" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "FindOwnerOfCell" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "LocateParticleOrFindMigrationTarget" |
Definition at line 15 of file walkingsearch.c.
| #define __FUNCT__ "ReportSearchOutcome" |
Definition at line 15 of file walkingsearch.c.
| PetscErrorCode GetCellCharacteristicSize | ( | const Cell * | cell, |
| PetscReal * | cellSize | ||
| ) |
Implementation of GetCellCharacteristicSize().
Estimates a characteristic length of the cell for threshold scaling.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 22 of file walkingsearch.c.
| PetscErrorCode ComputeSignedDistanceToPlane | ( | const Cmpnts | v1, |
| const Cmpnts | v2, | ||
| const Cmpnts | v3, | ||
| const Cmpnts | v4, | ||
| const Cmpnts | cell_centroid, | ||
| const Cmpnts | p_target, | ||
| PetscReal * | d_signed, | ||
| const PetscReal | threshold | ||
| ) |
Internal helper implementation: ComputeSignedDistanceToPlane().
Computes the signed distance from a point to the plane approximating a quadrilateral face.
Local to this translation unit.
Definition at line 68 of file walkingsearch.c.
| PetscErrorCode CalculateDistancesToCellFaces | ( | const Cmpnts | p, |
| const Cell * | cell, | ||
| PetscReal * | d, | ||
| const PetscReal | threshold | ||
| ) |
Implementation of CalculateDistancesToCellFaces().
Computes the signed distances from a point to each face of a cubic cell.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 206 of file walkingsearch.c.
| PetscErrorCode DeterminePointPosition | ( | PetscReal * | d, |
| PetscInt * | result | ||
| ) |
Implementation of DeterminePointPosition().
Classifies a point based on precomputed face distances.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 338 of file walkingsearch.c.
| PetscErrorCode GetCellVerticesFromGrid | ( | Cmpnts *** | coor, |
| PetscInt | idx, | ||
| PetscInt | idy, | ||
| PetscInt | idz, | ||
| Cell * | cell | ||
| ) |
Implementation of GetCellVerticesFromGrid().
Retrieves the coordinates of the eight vertices of a cell based on grid indices.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 405 of file walkingsearch.c.
| PetscErrorCode InitializeTraversalParameters | ( | UserCtx * | user, |
| Particle * | particle, | ||
| PetscInt * | idx, | ||
| PetscInt * | idy, | ||
| PetscInt * | idz, | ||
| PetscInt * | traversal_steps | ||
| ) |
Implementation of InitializeTraversalParameters().
Initializes traversal parameters for locating a particle.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 446 of file walkingsearch.c.
| PetscErrorCode CheckCellWithinLocalGrid | ( | UserCtx * | user, |
| PetscInt | idx, | ||
| PetscInt | idy, | ||
| PetscInt | idz, | ||
| PetscBool * | is_within | ||
| ) |
Implementation of CheckCellWithinLocalGrid().
Checks if the current cell indices are within the local grid boundaries.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 589 of file walkingsearch.c.
| PetscErrorCode RetrieveCurrentCell | ( | UserCtx * | user, |
| PetscInt | idx, | ||
| PetscInt | idy, | ||
| PetscInt | idz, | ||
| Cell * | cell | ||
| ) |
Implementation of RetrieveCurrentCell().
Retrieves the coordinates of the eight vertices of the current cell.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 659 of file walkingsearch.c.
| PetscErrorCode EvaluateParticlePosition | ( | const Cell * | cell, |
| PetscReal * | d, | ||
| const Cmpnts | p, | ||
| PetscInt * | position, | ||
| const PetscReal | threshold | ||
| ) |
Implementation of EvaluateParticlePosition().
Determines the spatial relationship of a particle relative to a cubic cell.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 715 of file walkingsearch.c.
| PetscErrorCode UpdateCellIndicesBasedOnDistances | ( | PetscReal | d[NUM_FACES], |
| PetscInt * | idx, | ||
| PetscInt * | idy, | ||
| PetscInt * | idz | ||
| ) |
Internal helper implementation: UpdateCellIndicesBasedOnDistances().
Updates the cell indices based on the signed distances to each face.
Local to this translation unit.
Definition at line 774 of file walkingsearch.c.
| PetscErrorCode FinalizeTraversal | ( | UserCtx * | user, |
| Particle * | particle, | ||
| PetscInt | traversal_steps, | ||
| PetscBool | cell_found, | ||
| PetscInt | idx, | ||
| PetscInt | idy, | ||
| PetscInt | idz | ||
| ) |
Implementation of FinalizeTraversal().
Finalizes the traversal by reporting the results.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 865 of file walkingsearch.c.
| PetscErrorCode FindOwnerOfCell | ( | UserCtx * | user, |
| PetscInt | i, | ||
| PetscInt | j, | ||
| PetscInt | k, | ||
| PetscMPIInt * | owner_rank | ||
| ) |
Internal helper implementation: FindOwnerOfCell().
Finds the MPI rank that owns a given global cell index.
Local to this translation unit.
Definition at line 898 of file walkingsearch.c.
| PetscErrorCode LocateParticleOrFindMigrationTarget | ( | UserCtx * | user, |
| Particle * | particle, | ||
| ParticleLocationStatus * | status_out | ||
| ) |
Implementation of LocateParticleOrFindMigrationTarget().
Locates a particle's host cell or identifies its migration target using a robust walk search.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 957 of file walkingsearch.c.
| PetscErrorCode ReportSearchOutcome | ( | const Particle * | particle, |
| ParticleLocationStatus | status, | ||
| PetscInt | traversal_steps | ||
| ) |
Implementation of ReportSearchOutcome().
Logs the final outcome of the particle location search.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/walkingsearch.h.
Definition at line 1167 of file walkingsearch.c.