Block-Structured AMR Software Framework
amrex::STLtools Class Reference

#include <AMReX_EB_STL_utils.H>

Classes

struct  BVHNodeT
 
struct  Triangle
 

Public Types

using Node = BVHNodeT< m_bvh_max_size, m_bvh_max_splits >
 

Public Member Functions

void setBVHOptimization (bool flag)
 
void read_stl_file (std::string const &fname, Real scale, Array< Real, 3 > const &center, int reverse_normal)
 
void fill (MultiFab &mf, IntVect const &nghost, Geometry const &geom, Real outside_value=-1._rt, Real inside_value=1._rt) const
 
int getBoxType (Box const &box, Geometry const &geom, RunOn) const
 
void fillFab (BaseFab< Real > &levelset, const Geometry &geom, RunOn, Box const &bounding_box) const
 
void getIntercept (Array< Array4< Real >, AMREX_SPACEDIM > const &inter_arr, Array< Array4< EB2::Type_t const >, AMREX_SPACEDIM > const &type_arr, Array4< Real const > const &lst, Geometry const &geom, RunOn, Box const &bounding_box) const
 
void prepare (Gpu::PinnedVector< Triangle > a_tri_pts)
 

Static Public Member Functions

static constexpr bool isGPUable () noexcept
 
static void updateIntercept (Array< Array4< Real >, AMREX_SPACEDIM > const &inter_arr, Array< Array4< EB2::Type_t const >, AMREX_SPACEDIM > const &type_arr, Array4< Real const > const &lst, Geometry const &geom)
 

Static Public Attributes

static constexpr int m_bvh_max_size = 4
 
static constexpr int m_bvh_max_splits = 4
 
static constexpr int m_bvh_max_stack_size = 12
 
static constexpr int allregular = -1
 
static constexpr int mixedcells = 0
 
static constexpr int allcovered = 1
 

Private Member Functions

void read_ascii_stl_file (std::string const &fname, Real scale, Array< Real, 3 > const &center, int reverse_normal, Gpu::PinnedVector< Triangle > &a_tri_pts)
 
void read_binary_stl_file (std::string const &fname, Real scale, Array< Real, 3 > const &center, int reverse_normal, Gpu::PinnedVector< Triangle > &a_tri_pts)
 

Static Private Member Functions

static void build_bvh (Triangle *begin, Triangle *end, Gpu::PinnedVector< Node > &bvh_nodes)
 
static void bvh_size (int ntri, std::size_t &nnodes)
 

Private Attributes

bool m_bvh_optimization = true
 
Gpu::DeviceVector< Trianglem_tri_pts_d
 
Gpu::DeviceVector< XDim3m_tri_normals_d
 
Gpu::DeviceVector< Nodem_bvh_nodes
 
int m_num_tri =0
 
XDim3 m_ptmin
 
XDim3 m_ptmax
 
XDim3 m_ptref
 
bool m_boundry_is_outside
 

Member Typedef Documentation

◆ Node

Member Function Documentation

◆ build_bvh()

void amrex::STLtools::build_bvh ( Triangle begin,
Triangle end,
Gpu::PinnedVector< Node > &  bvh_nodes 
)
staticprivate

◆ bvh_size()

void amrex::STLtools::bvh_size ( int  ntri,
std::size_t &  nnodes 
)
staticprivate

◆ fill()

void amrex::STLtools::fill ( MultiFab mf,
IntVect const &  nghost,
Geometry const &  geom,
Real  outside_value = -1._rt,
Real  inside_value = 1._rt 
) const

◆ fillFab()

void amrex::STLtools::fillFab ( BaseFab< Real > &  levelset,
const Geometry geom,
RunOn  ,
Box const &  bounding_box 
) const

◆ getBoxType()

int amrex::STLtools::getBoxType ( Box const &  box,
Geometry const &  geom,
RunOn   
) const

◆ getIntercept()

void amrex::STLtools::getIntercept ( Array< Array4< Real >, AMREX_SPACEDIM > const &  inter_arr,
Array< Array4< EB2::Type_t const >, AMREX_SPACEDIM > const &  type_arr,
Array4< Real const > const &  lst,
Geometry const &  geom,
RunOn  ,
Box const &  bounding_box 
) const

◆ isGPUable()

static constexpr bool amrex::STLtools::isGPUable ( )
inlinestaticconstexprnoexcept

◆ prepare()

void amrex::STLtools::prepare ( Gpu::PinnedVector< Triangle a_tri_pts)

◆ read_ascii_stl_file()

void amrex::STLtools::read_ascii_stl_file ( std::string const &  fname,
Real  scale,
Array< Real, 3 > const &  center,
int  reverse_normal,
Gpu::PinnedVector< Triangle > &  a_tri_pts 
)
private

◆ read_binary_stl_file()

void amrex::STLtools::read_binary_stl_file ( std::string const &  fname,
Real  scale,
Array< Real, 3 > const &  center,
int  reverse_normal,
Gpu::PinnedVector< Triangle > &  a_tri_pts 
)
private

◆ read_stl_file()

void amrex::STLtools::read_stl_file ( std::string const &  fname,
Real  scale,
Array< Real, 3 > const &  center,
int  reverse_normal 
)

◆ setBVHOptimization()

void amrex::STLtools::setBVHOptimization ( bool  flag)
inline

◆ updateIntercept()

void amrex::STLtools::updateIntercept ( Array< Array4< Real >, AMREX_SPACEDIM > const &  inter_arr,
Array< Array4< EB2::Type_t const >, AMREX_SPACEDIM > const &  type_arr,
Array4< Real const > const &  lst,
Geometry const &  geom 
)
static

Member Data Documentation

◆ allcovered

constexpr int amrex::STLtools::allcovered = 1
staticconstexpr

◆ allregular

constexpr int amrex::STLtools::allregular = -1
staticconstexpr

◆ m_boundry_is_outside

bool amrex::STLtools::m_boundry_is_outside
private

◆ m_bvh_max_size

constexpr int amrex::STLtools::m_bvh_max_size = 4
staticconstexpr

◆ m_bvh_max_splits

constexpr int amrex::STLtools::m_bvh_max_splits = 4
staticconstexpr

◆ m_bvh_max_stack_size

constexpr int amrex::STLtools::m_bvh_max_stack_size = 12
staticconstexpr

◆ m_bvh_nodes

Gpu::DeviceVector<Node> amrex::STLtools::m_bvh_nodes
private

◆ m_bvh_optimization

bool amrex::STLtools::m_bvh_optimization = true
private

◆ m_num_tri

int amrex::STLtools::m_num_tri =0
private

◆ m_ptmax

XDim3 amrex::STLtools::m_ptmax
private

◆ m_ptmin

XDim3 amrex::STLtools::m_ptmin
private

◆ m_ptref

XDim3 amrex::STLtools::m_ptref
private

◆ m_tri_normals_d

Gpu::DeviceVector<XDim3> amrex::STLtools::m_tri_normals_d
private

◆ m_tri_pts_d

Gpu::DeviceVector<Triangle> amrex::STLtools::m_tri_pts_d
private

◆ mixedcells

constexpr int amrex::STLtools::mixedcells = 0
staticconstexpr

The documentation for this class was generated from the following files: