Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::EB2::GeometryShop< F, R > Class Template Reference

Samples an implicit function on boxes and fills EB data. More...

#include <AMReX_EB2_GeometryShop.H>

Public Types

using FunctionType = F
 

Public Member Functions

 GeometryShop (F f)
 Construct a GeometryShop that owns an implicit function f.
 
 GeometryShop (F f, R r)
 Construct a GeometryShop with an implicit function and resource handle.
 
F const & GetImpFunc () const &
 Immutable access to the underlying implicit function.
 
F && GetImpFunc () &&
 
int getBoxType_Cpu (const Box &bx, Geometry const &geom) const noexcept
 
template<class U = F, std::enable_if_t< IsGPUable< U >::value > * FOO = nullptr>
int getBoxType (const Box &bx, const Geometry &geom, RunOn run_on) const noexcept
 Classify bx as regular, covered, or mixed (GPU-capable case).
 
template<class U = F, std::enable_if_t<!IsGPUable< U >::value > * BAR = nullptr>
int getBoxType (const Box &bx, const Geometry &geom, RunOn) const noexcept
 CPU-only fallback for getBoxType().
 
template<class U = F, std::enable_if_t< IsGPUable< U >::value > * FOO = nullptr>
void fillFab (BaseFab< Real > &levelset, const Geometry &geom, RunOn run_on, Box const &bounding_box) const noexcept
 Fill a level-set FAB by sampling the implicit function on each point in the FAB.
 
template<class U = F, std::enable_if_t<!IsGPUable< U >::value > * BAR = nullptr>
void fillFab (BaseFab< Real > &levelset, const Geometry &geom, RunOn, Box const &bounding_box) const noexcept
 CPU-only overload of fillFab().
 
void fillFab_Cpu (BaseFab< Real > &levelset, const Geometry &geom, Box const &bounding_box) const noexcept
 
template<class U = F, std::enable_if_t< IsGPUable< U >::value > * FOO = nullptr>
void getIntercept (Array< Array4< Real >, 3 > const &inter_arr, Array< Array4< Type_t const >, 3 > const &type_arr, Array4< Real const > const &, Geometry const &geom, RunOn run_on, Box const &bounding_box) const noexcept
 Compute EB intercepts for irregular edges (GPU-capable case).
 
template<class U = F, std::enable_if_t<!IsGPUable< U >::value > * BAR = nullptr>
void getIntercept (Array< Array4< Real >, 3 > const &inter_arr, Array< Array4< Type_t const >, 3 > const &type_arr, Array4< Real const > const &, Geometry const &geom, RunOn, Box const &bounding_box) const noexcept
 CPU-only overload of getIntercept().
 
void getIntercept_Cpu (Array4< Real > const &inter, Array4< Type_t const > const &type, Geometry const &geom, Box const &bounding_box, const int idim) const noexcept
 
void updateIntercept (Array< Array4< Real >, 3 > const &inter_arr, Array< Array4< Type_t const >, 3 > const &type_arr, Array4< Real const > const &lst, Geometry const &geom) const noexcept
 Update intercepts when level-set data has been adjusted (e.g., fixing small cells).
 

Static Public Member Functions

template<class U = F, std::enable_if_t< IsGPUable< U >::value > * FOO = nullptr>
static constexpr bool isGPUable () noexcept
 
template<class U = F, std::enable_if_t<!IsGPUable< U >::value > * BAR = nullptr>
static constexpr bool isGPUable () noexcept
 

Static Public Attributes

static constexpr int in_fluid = -1
 
static constexpr int on_boundary = 0
 
static constexpr int in_body = 1
 
static constexpr int allregular = -1
 
static constexpr int mixedcells = 0
 
static constexpr int allcovered = 1
 

Detailed Description

template<class F, class R = int>
class amrex::EB2::GeometryShop< F, R >

Samples an implicit function on boxes and fills EB data.

Template Parameters
FFunctor providing the implicit function value.
ROptional resource handle kept alive as long as the shop exists.

Member Typedef Documentation

◆ FunctionType

template<class F , class R = int>
using amrex::EB2::GeometryShop< F, R >::FunctionType = F

Constructor & Destructor Documentation

◆ GeometryShop() [1/2]

template<class F , class R = int>
amrex::EB2::GeometryShop< F, R >::GeometryShop ( F  f)
inlineexplicit

Construct a GeometryShop that owns an implicit function f.

Parameters
fImplicit function whose sign distinguishes inside/outside.

◆ GeometryShop() [2/2]

template<class F , class R = int>
amrex::EB2::GeometryShop< F, R >::GeometryShop ( F  f,
r 
)
inline

Construct a GeometryShop with an implicit function and resource handle.

Parameters
fImplicit function being sampled.
rAuxiliary resource (e.g., Parser data) kept alive while f is in use.

Member Function Documentation

◆ fillFab() [1/2]

template<class F , class R = int>
template<class U = F, std::enable_if_t< IsGPUable< U >::value > * FOO = nullptr>
void amrex::EB2::GeometryShop< F, R >::fillFab ( BaseFab< Real > &  levelset,
const Geometry geom,
RunOn  run_on,
Box const &  bounding_box 
) const
inlinenoexcept

Fill a level-set FAB by sampling the implicit function on each point in the FAB.

Parameters
levelsetDestination BaseFab.
geomGeometry providing location metadata.
run_onExecution target.
bounding_boxBounding box limiting the sampling region.

◆ fillFab() [2/2]

template<class F , class R = int>
template<class U = F, std::enable_if_t<!IsGPUable< U >::value > * BAR = nullptr>
void amrex::EB2::GeometryShop< F, R >::fillFab ( BaseFab< Real > &  levelset,
const Geometry geom,
RunOn  ,
Box const &  bounding_box 
) const
inlinenoexcept

CPU-only overload of fillFab().

◆ fillFab_Cpu()

template<class F , class R = int>
void amrex::EB2::GeometryShop< F, R >::fillFab_Cpu ( BaseFab< Real > &  levelset,
const Geometry geom,
Box const &  bounding_box 
) const
inlinenoexcept

◆ getBoxType() [1/2]

template<class F , class R = int>
template<class U = F, std::enable_if_t< IsGPUable< U >::value > * FOO = nullptr>
int amrex::EB2::GeometryShop< F, R >::getBoxType ( const Box bx,
const Geometry geom,
RunOn  run_on 
) const
inlinenoexcept

Classify bx as regular, covered, or mixed (GPU-capable case).

Parameters
bxBox to inspect.
geomGeometry providing physical coordinates.
run_onWhether to run on CPU or GPU.

◆ getBoxType() [2/2]

template<class F , class R = int>
template<class U = F, std::enable_if_t<!IsGPUable< U >::value > * BAR = nullptr>
int amrex::EB2::GeometryShop< F, R >::getBoxType ( const Box bx,
const Geometry geom,
RunOn   
) const
inlinenoexcept

CPU-only fallback for getBoxType().

◆ getBoxType_Cpu()

template<class F , class R = int>
int amrex::EB2::GeometryShop< F, R >::getBoxType_Cpu ( const Box bx,
Geometry const &  geom 
) const
inlinenoexcept

◆ GetImpFunc() [1/2]

template<class F , class R = int>
F && amrex::EB2::GeometryShop< F, R >::GetImpFunc ( ) &&
inline

◆ GetImpFunc() [2/2]

template<class F , class R = int>
F const & amrex::EB2::GeometryShop< F, R >::GetImpFunc ( ) const &
inline

Immutable access to the underlying implicit function.

◆ getIntercept() [1/2]

template<class F , class R = int>
template<class U = F, std::enable_if_t< IsGPUable< U >::value > * FOO = nullptr>
void amrex::EB2::GeometryShop< F, R >::getIntercept ( Array< Array4< Real >, 3 > const &  inter_arr,
Array< Array4< Type_t const >, 3 > const &  type_arr,
Array4< Real const > const &  ,
Geometry const &  geom,
RunOn  run_on,
Box const &  bounding_box 
) const
inlinenoexcept

Compute EB intercepts for irregular edges (GPU-capable case).

Parameters
inter_arrArray of intercept FABs per direction.
type_arrEdge-type arrays marking regular/covered/irregular edges.
geomGeometry providing metrics.
run_onExecution target.
bounding_boxBounding box limiting evaluation.

◆ getIntercept() [2/2]

template<class F , class R = int>
template<class U = F, std::enable_if_t<!IsGPUable< U >::value > * BAR = nullptr>
void amrex::EB2::GeometryShop< F, R >::getIntercept ( Array< Array4< Real >, 3 > const &  inter_arr,
Array< Array4< Type_t const >, 3 > const &  type_arr,
Array4< Real const > const &  ,
Geometry const &  geom,
RunOn  ,
Box const &  bounding_box 
) const
inlinenoexcept

CPU-only overload of getIntercept().

◆ getIntercept_Cpu()

template<class F , class R = int>
void amrex::EB2::GeometryShop< F, R >::getIntercept_Cpu ( Array4< Real > const &  inter,
Array4< Type_t const > const &  type,
Geometry const &  geom,
Box const &  bounding_box,
const int  idim 
) const
inlinenoexcept

◆ isGPUable() [1/2]

template<class F , class R = int>
template<class U = F, std::enable_if_t< IsGPUable< U >::value > * FOO = nullptr>
static constexpr bool amrex::EB2::GeometryShop< F, R >::isGPUable ( )
inlinestaticconstexprnoexcept

◆ isGPUable() [2/2]

template<class F , class R = int>
template<class U = F, std::enable_if_t<!IsGPUable< U >::value > * BAR = nullptr>
static constexpr bool amrex::EB2::GeometryShop< F, R >::isGPUable ( )
inlinestaticconstexprnoexcept

◆ updateIntercept()

template<class F , class R = int>
void amrex::EB2::GeometryShop< F, R >::updateIntercept ( Array< Array4< Real >, 3 > const &  inter_arr,
Array< Array4< Type_t const >, 3 > const &  type_arr,
Array4< Real const > const &  lst,
Geometry const &  geom 
) const
inlinenoexcept

Update intercepts when level-set data has been adjusted (e.g., fixing small cells).

Parameters
inter_arrArray of intercept FABs per direction.
type_arrEdge-type arrays marking regular/covered/irregular edges.
lstLevel-set data used to determine zero crossings.
geomGeometry providing metrics.

Member Data Documentation

◆ allcovered

template<class F , class R = int>
constexpr int amrex::EB2::GeometryShop< F, R >::allcovered = 1
staticconstexpr

◆ allregular

template<class F , class R = int>
constexpr int amrex::EB2::GeometryShop< F, R >::allregular = -1
staticconstexpr

◆ in_body

template<class F , class R = int>
constexpr int amrex::EB2::GeometryShop< F, R >::in_body = 1
staticconstexpr

◆ in_fluid

template<class F , class R = int>
constexpr int amrex::EB2::GeometryShop< F, R >::in_fluid = -1
staticconstexpr

◆ mixedcells

template<class F , class R = int>
constexpr int amrex::EB2::GeometryShop< F, R >::mixedcells = 0
staticconstexpr

◆ on_boundary

template<class F , class R = int>
constexpr int amrex::EB2::GeometryShop< F, R >::on_boundary = 0
staticconstexpr

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