Go to the source code of this file.
Macros | |
| #define | BBOX_TOLERANCE 1e-6 |
| #define | PICURV_FINE_NODE(c) ((c) == 0 ? 0 : (refinements ? (((c) - 1) << refinements) + 1 : (c))) |
Functions | |
| static PetscErrorCode | ParseAndSetGridInputs (UserCtx *user) |
| Parse grid-generation options and store the resulting geometry settings in the context. | |
| PetscErrorCode | DefineAllGridDimensions (SimCtx *simCtx) |
| Implementation of DefineAllGridDimensions(). | |
| PetscErrorCode | CreateCompatibleBlockDM (DM source, PetscInt dof, DM *result) |
| Implementation of CreateCompatibleBlockDM(). | |
| PetscErrorCode | BalanceCoarsestOwnership (PetscInt coarse_nodes, PetscInt fine_cells, PetscInt refinements, PetscInt ranks, PetscInt *l) |
| Implementation of BalanceCoarsestOwnership(). | |
| static PetscErrorCode | InitializeSingleGridDM (UserCtx *user, UserCtx *coarse_user) |
| Create and configure one PETSc DMDA for a multigrid level. | |
| PetscErrorCode | InitializeAllGridDMs (SimCtx *simCtx) |
| Implementation of InitializeAllGridDMs(). | |
| static PetscErrorCode | SetFinestLevelCoordinates (UserCtx *user) |
| Attach the generated physical coordinates to the finest-level DMDA. | |
| static PetscErrorCode | GenerateAndSetCoordinates (UserCtx *user) |
| Generate analytic grid coordinates and install them on the finest grid level. | |
| static PetscErrorCode | ReadAndSetCoordinates (UserCtx *user, FILE *fd) |
| Load grid coordinates from the input file and install them on the finest level. | |
| static PetscErrorCode | RestrictCoordinates (UserCtx *coarse_user, UserCtx *fine_user) |
| Restrict finest-grid coordinates onto each coarser multigrid level. | |
| PetscErrorCode | AssignAllGridCoordinates (SimCtx *simCtx) |
| Implementation of AssignAllGridCoordinates(). | |
| static PetscReal | CoordinateComponent (Cmpnts value, PetscInt component) |
| Returns one Cartesian component from a coordinate/vector value. | |
| PetscErrorCode | ValidatePeriodicGeometry (UserCtx *user) |
| Implementation of ValidatePeriodicGeometry(). | |
| static PetscReal | ComputeStretchedCoord (PetscInt i, PetscInt N, PetscReal L, PetscReal r) |
| Map a uniform logical coordinate to its configured stretched physical coordinate. | |
| PetscErrorCode | ComputeLocalBoundingBox (UserCtx *user, BoundingBox *localBBox) |
| Implementation of ComputeLocalBoundingBox(). | |
| PetscErrorCode | GatherAllBoundingBoxes (UserCtx *user, BoundingBox **allBBoxes) |
| Implementation of GatherAllBoundingBoxes(). | |
| PetscErrorCode | BroadcastAllBoundingBoxes (UserCtx *user, BoundingBox **bboxlist) |
| Implementation of BroadcastAllBoundingBoxes(). | |
| PetscErrorCode | CalculateInletProperties (UserCtx *user) |
| Implementation of CalculateInletProperties(). | |
| PetscErrorCode | CalculateOutletProperties (UserCtx *user) |
| Implementation of CalculateOutletProperties(). | |
| PetscErrorCode | CalculateFaceCenterAndArea (UserCtx *user, BCFace face_id, Cmpnts *face_center, PetscReal *face_area) |
| Implementation of CalculateFaceCenterAndArea(). | |
| #define PICURV_FINE_NODE | ( | c | ) | ((c) == 0 ? 0 : (refinements ? (((c) - 1) << refinements) + 1 : (c))) |
|
static |
Parse grid-generation options and store the resulting geometry settings in the context.
Definition at line 12 of file grid.c.
| PetscErrorCode DefineAllGridDimensions | ( | SimCtx * | simCtx | ) |
Implementation of DefineAllGridDimensions().
Orchestrates the parsing and setting of grid dimensions for all blocks.
Definition at line 38 of file grid.c.
| PetscErrorCode CreateCompatibleBlockDM | ( | DM | source, |
| PetscInt | dof, | ||
| DM * | result | ||
| ) |
Implementation of CreateCompatibleBlockDM().
Creates a DMDA sharing a block's decomposition at a different degree of freedom.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/grid.h.
Definition at line 81 of file grid.c.
| PetscErrorCode BalanceCoarsestOwnership | ( | PetscInt | coarse_nodes, |
| PetscInt | fine_cells, | ||
| PetscInt | refinements, | ||
| PetscInt | ranks, | ||
| PetscInt * | l | ||
| ) |
Implementation of BalanceCoarsestOwnership().
Split one axis of the coarsest level so the finest level's owned cells balance.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/grid.h.
Definition at line 121 of file grid.c.
Create and configure one PETSc DMDA for a multigrid level.
Definition at line 158 of file grid.c.
| PetscErrorCode InitializeAllGridDMs | ( | SimCtx * | simCtx | ) |
Implementation of InitializeAllGridDMs().
Orchestrates the creation of DMDA objects for every block and multigrid level.
Definition at line 309 of file grid.c.
|
static |
Attach the generated physical coordinates to the finest-level DMDA.
Definition at line 585 of file grid.c.
|
static |
Generate analytic grid coordinates and install them on the finest grid level.
DEBUG: This verifies the presence of a last "unphysical" layer of coordinates.
Definition at line 653 of file grid.c.
|
static |
Load grid coordinates from the input file and install them on the finest level.
Definition at line 720 of file grid.c.
Restrict finest-grid coordinates onto each coarser multigrid level.
Definition at line 796 of file grid.c.
| PetscErrorCode AssignAllGridCoordinates | ( | SimCtx * | simCtx | ) |
Implementation of AssignAllGridCoordinates().
Orchestrates the assignment of physical coordinates to all DMDA objects.
Definition at line 389 of file grid.c.
|
inlinestatic |
| PetscErrorCode ValidatePeriodicGeometry | ( | UserCtx * | user | ) |
Implementation of ValidatePeriodicGeometry().
Validates that configured geometric periodic seams match by translation.
Full API contract is documented with the header declaration in include/grid.h.
Definition at line 450 of file grid.c.
|
inlinestatic |
Map a uniform logical coordinate to its configured stretched physical coordinate.
Definition at line 639 of file grid.c.
| PetscErrorCode ComputeLocalBoundingBox | ( | UserCtx * | user, |
| BoundingBox * | localBBox | ||
| ) |
Implementation of ComputeLocalBoundingBox().
Computes the local bounding box of the grid on the current process.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/grid.h.
Definition at line 869 of file grid.c.
| PetscErrorCode GatherAllBoundingBoxes | ( | UserCtx * | user, |
| BoundingBox ** | allBBoxes | ||
| ) |
Implementation of GatherAllBoundingBoxes().
Gathers local bounding boxes from all MPI processes to rank 0.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/grid.h.
Definition at line 1011 of file grid.c.
| PetscErrorCode BroadcastAllBoundingBoxes | ( | UserCtx * | user, |
| BoundingBox ** | bboxlist | ||
| ) |
Implementation of BroadcastAllBoundingBoxes().
Broadcasts the bounding box information collected on rank 0 to all other ranks.
Definition at line 1071 of file grid.c.
| PetscErrorCode CalculateInletProperties | ( | UserCtx * | user | ) |
Implementation of CalculateInletProperties().
Calculates the center and area of the primary INLET face.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/grid.h.
Definition at line 1119 of file grid.c.
| PetscErrorCode CalculateOutletProperties | ( | UserCtx * | user | ) |
Implementation of CalculateOutletProperties().
Calculates the center and area of the primary OUTLET face.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/grid.h.
Definition at line 1170 of file grid.c.
| PetscErrorCode CalculateFaceCenterAndArea | ( | UserCtx * | user, |
| BCFace | face_id, | ||
| Cmpnts * | face_center, | ||
| PetscReal * | face_area | ||
| ) |
Implementation of CalculateFaceCenterAndArea().
Calculates the geometric center and total area of a specified boundary face.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/grid.h.
< Local sum of (x,y,z) coordinates
< Local sum of face area magnitudes
< Local count of nodes
< Global sum of coordinates
< Global sum of areas
< Global count of nodes
< i-range: [xs, xe)
< j-range: [ys, ye)
< k-range: [zs, ze)
< Physical domain size in i (exclude dummy)
< Physical domain size in j (exclude dummy)
< Physical domain size in k (exclude dummy)
< Start at 1 if on -Xi boundary
< End at mx-1 if on +Xi boundary
< Start at 1 if on -Eta boundary
< End at my-1 if on +Eta boundary
< Start at 1 if on -Zeta boundary
< End at mz-1 if on +Zeta boundary
< Exclude dummy at i=mx-1 (e.g., i=25)
< Exclude dummy at j=my-1 (e.g., j=25)
< Exclude dummy at k=mz-1 (e.g., k=97)
< Local ghosted coordinate vector
< Nodal coordinates [k][j][i]
< Face metric tensors [k][j][i]
< Cell blanking field [k][j][i] (shifted +1)
Definition at line 1211 of file grid.c.