flow
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
pnm Namespace Reference

Classes

struct  I3
 
struct  Pore
 
struct  PoreNetwork
 The full pore network from one extraction: pores, the per-voxel segmentation (flat), and the label-adjacency connections. More...
 

Typedefs

using Exec = Kokkos::DefaultExecutionSpace
 
using Mem = Exec::memory_space
 

Functions

template<class T >
void uploadVec (const std::vector< T > &h, const Kokkos::View< T *, Mem > &d)
 Bulk host->device upload of a whole std::vector via one deep_copy over an unmanaged host view — replaces the per-element create_mirror_view + fill loop (F3).
 
template<class V >
std::vector< typename V::value_type > downloadN (const V &d, std::size_t count)
 Download the first count elements of a device view into a fresh std::vector via one deep_copy — replaces the create_mirror_view (whole view) + element loop (S2/G1), and only moves what is used.
 
int get_idx (int x, int y, int z, I3 res)
 
std::vector< PoreextractPoresView (const Kokkos::View< float *, Mem > &sdf, std::array< int, 3 > resolution, std::array< float, 3 > origin, std::array< float, 3 > spacing)
 
std::vector< Poreextract_pores_k (const std::vector< float > &sdf_h, std::array< int, 3 > resolution, std::array< float, 3 > origin, std::array< float, 3 > spacing)
 
Kokkos::View< int *, MemsegmentVolumeView (const Kokkos::View< float *, Mem > &sdf, std::array< int, 3 > resolution, std::array< float, 3 > spacing)
 
std::vector< int > segment_volume_k (const std::vector< float > &sdf_h, std::array< int, 3 > resolution, std::array< float, 3 > spacing)
 
std::vector< std::pair< int, int > > extractTopologyView (const Kokkos::View< int *, Mem > &seg, std::array< int, 3 > resolution)
 
std::vector< std::pair< int, int > > extract_topology_k (const std::vector< int > &seg_h, std::array< int, 3 > resolution)
 
PoreNetwork extract_pore_network_k (const std::vector< float > &sdf_h, std::array< int, 3 > resolution, std::array< float, 3 > origin, std::array< float, 3 > spacing)
 

Typedef Documentation

◆ Exec

using pnm::Exec = typedef Kokkos::DefaultExecutionSpace

Definition at line 31 of file pore_extraction.hpp.

◆ Mem

using pnm::Mem = typedef Exec::memory_space

Definition at line 32 of file pore_extraction.hpp.

Function Documentation

◆ uploadVec()

template<class T >
void pnm::uploadVec ( const std::vector< T > &  h,
const Kokkos::View< T *, Mem > &  d 
)
inline

Bulk host->device upload of a whole std::vector via one deep_copy over an unmanaged host view — replaces the per-element create_mirror_view + fill loop (F3).

d must already be sized to h.

Definition at line 38 of file pore_extraction.hpp.

Referenced by extract_pore_network_k(), extract_pores_k(), extract_topology_k(), and segment_volume_k().

◆ downloadN()

template<class V >
std::vector< typename V::value_type > pnm::downloadN ( const V &  d,
std::size_t  count 
)
inline

Download the first count elements of a device view into a fresh std::vector via one deep_copy — replaces the create_mirror_view (whole view) + element loop (S2/G1), and only moves what is used.

Definition at line 50 of file pore_extraction.hpp.

Referenced by extract_pore_network_k(), extractPoresView(), extractTopologyView(), and segment_volume_k().

◆ get_idx()

int pnm::get_idx ( int  x,
int  y,
int  z,
I3  res 
)

Definition at line 59 of file pore_extraction.hpp.

References pnm::I3::x, pnm::I3::y, and pnm::I3::z.

Referenced by extractPoresView(), extractTopologyView(), and segmentVolumeView().

◆ extractPoresView()

std::vector< Pore > pnm::extractPoresView ( const Kokkos::View< float *, Mem > &  sdf,
std::array< int, 3 >  resolution,
std::array< float, 3 >  origin,
std::array< float, 3 >  spacing 
)
inline

Definition at line 69 of file pore_extraction.hpp.

References downloadN(), and get_idx().

Referenced by extract_pore_network_k(), and extract_pores_k().

◆ extract_pores_k()

std::vector< Pore > pnm::extract_pores_k ( const std::vector< float > &  sdf_h,
std::array< int, 3 >  resolution,
std::array< float, 3 >  origin,
std::array< float, 3 >  spacing 
)
inline

Definition at line 143 of file pore_extraction.hpp.

References extractPoresView(), and uploadVec().

Referenced by NB_MODULE().

◆ segmentVolumeView()

Kokkos::View< int *, Mem > pnm::segmentVolumeView ( const Kokkos::View< float *, Mem > &  sdf,
std::array< int, 3 >  resolution,
std::array< float, 3 >  spacing 
)
inline

Definition at line 155 of file pore_extraction.hpp.

References get_idx().

Referenced by extract_pore_network_k(), and segment_volume_k().

◆ segment_volume_k()

std::vector< int > pnm::segment_volume_k ( const std::vector< float > &  sdf_h,
std::array< int, 3 >  resolution,
std::array< float, 3 >  spacing 
)
inline

Definition at line 378 of file pore_extraction.hpp.

References downloadN(), segmentVolumeView(), and uploadVec().

Referenced by NB_MODULE().

◆ extractTopologyView()

std::vector< std::pair< int, int > > pnm::extractTopologyView ( const Kokkos::View< int *, Mem > &  seg,
std::array< int, 3 >  resolution 
)
inline

Definition at line 390 of file pore_extraction.hpp.

References downloadN(), and get_idx().

Referenced by extract_pore_network_k(), and extract_topology_k().

◆ extract_topology_k()

std::vector< std::pair< int, int > > pnm::extract_topology_k ( const std::vector< int > &  seg_h,
std::array< int, 3 >  resolution 
)
inline

Definition at line 443 of file pore_extraction.hpp.

References extractTopologyView(), and uploadVec().

Referenced by NB_MODULE().

◆ extract_pore_network_k()

PoreNetwork pnm::extract_pore_network_k ( const std::vector< float > &  sdf_h,
std::array< int, 3 >  resolution,
std::array< float, 3 >  origin,
std::array< float, 3 >  spacing 
)
inline