OpenImpala
Image-based parallel transport property solver
Loading...
Searching...
No Matches
FloodFill.H File Reference

GPU-compatible parallel flood fill for 3D phase data on AMReX grids. More...

#include <AMReX_BoxArray.H>
#include <AMReX_DistributionMapping.H>
#include <AMReX_Geometry.H>
#include <AMReX_IntVect.H>
#include <AMReX_Vector.H>
#include <AMReX_iMultiFab.H>
Include dependency graph for FloodFill.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  OpenImpala

Functions

void OpenImpala::collectBoundarySeeds (const amrex::iMultiFab &phaseFab, int phaseID, int dir, const amrex::Geometry &geom, amrex::Vector< amrex::IntVect > &inletSeeds, amrex::Vector< amrex::IntVect > &outletSeeds)
 Collect boundary seeds on inlet/outlet faces of a phase.
void OpenImpala::parallelFloodFill (amrex::iMultiFab &reachabilityMask, const amrex::iMultiFab &phaseFab, int phaseID, const amrex::Vector< amrex::IntVect > &seedPoints, const amrex::Geometry &geom, int verbose=0, int label=FLOOD_ACTIVE)
 GPU-compatible parallel flood fill on an iMultiFab.

Variables

constexpr int OpenImpala::FLOOD_ACTIVE = 1
constexpr int OpenImpala::FLOOD_INACTIVE = 0
 Marker values used in reachability masks.

Detailed Description

GPU-compatible parallel flood fill for 3D phase data on AMReX grids.

Provides a shared flood fill implementation used by PercolationCheck, TortuosityHypre, TortuosityMLMG, and ConnectedComponents. The algorithm is a synchronous wavefront BFS: each iteration propagates the reachable set by one cell in each direction, with FillBoundary for inter-patch ghost exchange.

When AMReX is built with GPU support, the inner loop uses ParallelFor with AMREX_GPU_DEVICE lambdas and a device-side atomic flag for early termination. On CPU builds, the same code falls back to threaded execution via AMReX's ParallelFor + OpenMP backend.