Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::EB2 Namespace Reference

Namespaces

namespace  Type
 Type flags representing regular/covered/etc.
 

Classes

class  AllRegularIF
 Trivial implicit function that always returns the "fluid" sign. More...
 
class  BoxIF
 Signed implicit function for an axis-aligned box. More...
 
struct  Cell
 Per-cell geometric information stored in EB graphs. More...
 
class  ChkptFile
 Helper that serializes EB geometry to disk for restartability. More...
 
class  ChkptFileLevel
 EB level specialized for reading checkpoint EB data. More...
 
class  ComplementIF
 Implicit function wrapper that swaps interior/exterior. More...
 
class  CylinderIF
 Signed implicit function for cylinders along a coordinate axis. More...
 
class  DevicePtrIF
 Wrapper that forwards operator() calls to an implicit function pointer. More...
 
class  DifferenceIF
 Implicit function that keeps points inside F but outside G. More...
 
struct  Edge
 Edge connecting a graph vertex to a face and downstream vertex id. More...
 
class  EllipsoidIF
 Signed implicit function for ellipsoids centered at a_center. More...
 
class  ExtrusionIF
 Extrude a 2-D implicit function uniformly along a coordinate direction. More...
 
struct  Face
 Metadata associated with an EB face. More...
 
class  GeometryShop
 Samples an implicit function on boxes and fills EB data. More...
 
class  GFab
 Object that stores level-set, face/edge types, and EB graph per box. More...
 
class  GShopLevel
 
class  IndexSpace
 
class  IndexSpaceChkptFile
 IndexSpace that reads EB levels from a checkpoint file on disk. More...
 
class  IndexSpaceImp
 
class  IndexSpaceSTL
 IndexSpace that samples implicit geometry from STL meshes. More...
 
class  IntersectionIF
 Implicit function that evaluates the intersection of multiple objects. More...
 
struct  IsGPUable
 Type trait that reports whether a functor derives from GPUable. More...
 
struct  IsGPUable< ComplementIF< F >, std::enable_if_t< IsGPUable< F >::value > >
 
struct  IsGPUable< D, std::enable_if_t< std::is_base_of_v< GPUable, D > > >
 
struct  IsGPUable< DifferenceIF< F, G >, std::enable_if_t< IsGPUable< F >::value &&IsGPUable< G >::value > >
 
struct  IsGPUable< ExtrusionIF< F >, std::enable_if_t< IsGPUable< F >::value > >
 
struct  IsGPUable< IntersectionIF< F >, std::enable_if_t< IsGPUable< F >::value > >
 
struct  IsGPUable< IntersectionIF< Head, Tail... >, std::enable_if_t< IsGPUable< Head >::value > >
 
struct  IsGPUable< LatheIF< F >, std::enable_if_t< IsGPUable< F >::value > >
 
struct  IsGPUable< RotationIF< F >, std::enable_if_t< IsGPUable< F >::value > >
 
struct  IsGPUable< ScaleIF< F >, std::enable_if_t< IsGPUable< F >::value > >
 
struct  IsGPUable< TranslationIF< F >, std::enable_if_t< IsGPUable< F >::value > >
 
struct  IsGPUable< UnionIF< F >, std::enable_if_t< IsGPUable< F >::value > >
 
struct  IsGPUable< UnionIF< Head, Tail... >, std::enable_if_t< IsGPUable< Head >::value > >
 
class  LatheIF
 Lathe an implicit curve around the z axis to build a surface of revolution. More...
 
class  Level
 
class  MultiGFab
 LayoutData wrapper that allocates a GFab per FAB/Box. More...
 
struct  Neighbor
 Packed neighbor structure that tracks the neighbor type in every direction. More...
 
class  ParserIF
 Implicit surface defined by an amrex::Parser expression. More...
 
class  PlaneIF
 
class  PolyIF
 GPU-ready polynomial implicit function with a fixed number of terms. More...
 
class  PolynomialIF
 Host-only dynamically-sized polynomial implicit function. More...
 
class  PolyTerm
 Represents one monomial in a polynomial implicit function. More...
 
class  RotationIF
 Rotate an implicit surface around one of the coordinate axes. More...
 
class  ScaleIF
 Scale an implicit function by arbitrary per-axis factors. More...
 
class  SphereIF
 
class  SplineIF
 Implicit function that measures distance to a poly-spline curve in 2-D. More...
 
class  STLLevel
 EB2 level that samples geometry from STL files. More...
 
class  TorusIF
 
class  TranslationIF
 Translate an implicit surface by subtracting an offset vector. More...
 
class  UnionIF
 Implicit function representing the union of several objects. More...
 
struct  Vertex
 Vertex capturing one irregular cell plus its neighbor connectivity. More...
 

Typedefs

using VertexID = std::pair< IntVect, int >
 
using Type_t = uint32_t
 
using Graph = std::unordered_map< IntVect, Vector< Vertex >, IntVect::hasher >
 EB graph type: map from cell index to all EB vertices stored there.
 

Functions

void Initialize ()
 Initialize EB2’s global state (call before constructing geometries by amrex::Initialize).
 
void Finalize ()
 Tear down EB2 global resources (called automatically at shutdown).
 
bool ExtendDomainFace ()
 
int NumCoarsenOpt ()
 
const IndexSpaceTopIndexSpaceIfPresent () noexcept
 Return the top IndexSpace if one has been built (nullptr otherwise).
 
void Build (const Geometry &geom, int required_coarsening_level, int max_coarsening_level, int ngrow=4, bool build_coarse_level_by_coarsening=true, bool extend_domain_face=ExtendDomainFace(), int num_coarsen_opt=NumCoarsenOpt(), bool support_mvmc=false)
 Build EB geometry using the runtime-configured EB2 geometry type.
 
void addFineLevels (int num_new_fine_levels)
 Add num_new_fine_levels to the EB hierarchy.
 
void addRegularCoarseLevels (int num_new_coarse_levels)
 Add num_new_coarse_levels regular levels below the current coarsest level.
 
void BuildFromChkptFile (std::string const &fname, const Geometry &geom, int required_coarsening_level, int max_coarsening_level, int ngrow=4, bool build_coarse_level_by_coarsening=true, bool extend_domain_face=ExtendDomainFace())
 Rebuild an IndexSpace from a checkpoint file.
 
int maxCoarseningLevel (const Geometry &geom)
 Return the maximum coarsening level supported for given geom.
 
int maxCoarseningLevel (IndexSpace const *ebis, const Geometry &geom)
 Same as above but for a specific IndexSpace pointer ebis.
 
void BuildMultiValuedMultiCut (const Geometry &geom, int required_coarsening_level, int max_coarsening_level, int ngrow=4, bool build_coarse_level_by_coarsening=true, bool extend_domain_face=ExtendDomainFace(), int num_coarsen_opt=NumCoarsenOpt())
 Build EB geometry dedicated to multi-valued multi-cut support.
 
const IndexSpaceTopIndexSpace () noexcept
 Return the top IndexSpace if one has been built (nullptr otherwise).
 
template<typename G >
void Build (const G &gshop, const Geometry &geom, int required_coarsening_level, int max_coarsening_level, int ngrow=4, bool build_coarse_level_by_coarsening=true, bool extend_domain_face=ExtendDomainFace(), int num_coarsen_opt=NumCoarsenOpt())
 Build EB geometry from a GeometryShop gshop and a single AMR Geometry.
 
template<typename G >
void Build (const G &gshop, Vector< Geometry > geom, int ngrow=4, bool extend_domain_face=ExtendDomainFace(), int num_coarsen_opt=NumCoarsenOpt())
 Build EB geometry from a GeometryShop and a vector of Geometries (one per level).
 
template<class F , std::enable_if_t< IsGPUable< F >::value > * FOO = nullptr>
__host__ __device__ Real IF_f (F const &f, GpuArray< Real, 3 > const &p) noexcept
 
template<class F >
__host__ __device__ Real BrentRootFinder (GpuArray< Real, 3 > const &lo, GpuArray< Real, 3 > const &hi, int rangedir, F const &f)
 
template<class F >
GeometryShop< std::decay_t< F > > makeShop (F &&f)
 Helper that constructs a GeometryShop owning the supplied implicit function.
 
template<class F , class R >
GeometryShop< std::decay_t< F >, std::decay_t< R > > makeShop (F &&f, R &&r)
 Helper that constructs a GeometryShop for an implicit function plus an extra resource handle.
 
template<class F >
constexpr ComplementIF< std::decay_t< F > > makeComplement (F &&f)
 Helper that constructs a complement operator.
 
template<class F , class G >
constexpr DifferenceIF< std::decay_t< F >, std::decay_t< G > > makeDifference (F &&f, G &&g)
 Helper that constructs a difference operator.
 
template<class F >
constexpr ExtrusionIF< std::decay_t< F > > extrude (F &&f, int direction)
 
template<class... Fs>
constexpr IntersectionIF< std::decay_t< Fs > ... > makeIntersection (Fs &&... fs)
 
template<class F >
constexpr LatheIF< std::decay_t< F > > lathe (F &&f)
 
template<class F >
constexpr RotationIF< std::decay_t< F > > rotate (F &&f, const Real angle, const int dir)
 
template<class F >
constexpr ScaleIF< std::decay_t< F > > scale (F &&f, const RealArray &scalefactor)
 
template<class F >
constexpr TranslationIF< std::decay_t< F > > translate (F &&f, const RealArray &offset)
 
template<class... Fs>
constexpr UnionIF< std::decay_t< Fs > ... > makeUnion (Fs &&... fs)
 

Typedef Documentation

◆ Graph

using amrex::EB2::Graph = typedef std::unordered_map<IntVect, Vector<Vertex>, IntVect::hasher>

EB graph type: map from cell index to all EB vertices stored there.

◆ Type_t

using amrex::EB2::Type_t = typedef uint32_t

◆ VertexID

using amrex::EB2::VertexID = typedef std::pair<IntVect,int>

Function Documentation

◆ addFineLevels()

void amrex::EB2::addFineLevels ( int  num_new_fine_levels)

Add num_new_fine_levels to the EB hierarchy.

◆ addRegularCoarseLevels()

void amrex::EB2::addRegularCoarseLevels ( int  num_new_coarse_levels)

Add num_new_coarse_levels regular levels below the current coarsest level.

◆ BrentRootFinder()

template<class F >
__host__ __device__ Real amrex::EB2::BrentRootFinder ( GpuArray< Real, 3 > const &  lo,
GpuArray< Real, 3 > const &  hi,
int  rangedir,
F const &  f 
)

◆ Build() [1/3]

template<typename G >
void amrex::EB2::Build ( const G &  gshop,
const Geometry geom,
int  required_coarsening_level,
int  max_coarsening_level,
int  ngrow = 4,
bool  build_coarse_level_by_coarsening = true,
bool  extend_domain_face = ExtendDomainFace(),
int  num_coarsen_opt = NumCoarsenOpt() 
)

Build EB geometry from a GeometryShop gshop and a single AMR Geometry.

Template Parameters
GGeometryShop type (see EB2::GeometryShop helpers).
Parameters
gshopConstruct describing the implicit surface.
geomFinest-level Geometry.
required_coarsening_levelNumber of coarse levels required by the application.
max_coarsening_levelUpper bound on the number of coarsenings we attempt when generating the EB hierarchy (the builder simply stops earlier if the EB cannot be coarsened that far; it is not treated as an error).
ngrowNumber of EB grow cells to build (default 4).
build_coarse_level_by_coarseningWhen true, coarsen from finer levels; otherwise rebuild.
extend_domain_faceWhether to extrapolate the EB description from the domain face to the outside of the domain (defaults to EB2::ExtendDomainFace / runtime param eb2.extend_domain_face).
num_coarsen_optNumber of coarse probes to try (defaults to EB2::NumCoarsenOpt / runtime eb2.num_coarsen_opt) before rebuilding at full resolution.

◆ Build() [2/3]

template<typename G >
void amrex::EB2::Build ( const G &  gshop,
Vector< Geometry geom,
int  ngrow = 4,
bool  extend_domain_face = ExtendDomainFace(),
int  num_coarsen_opt = NumCoarsenOpt() 
)

Build EB geometry from a GeometryShop and a vector of Geometries (one per level).

Template Parameters
GGeometryShop type.
Parameters
gshopConstruct describing the implicit surface.
geomVector of Geometries from finest to coarsest (will be sorted by refinement).
ngrowNumber of EB grow cells to build (default 4).
extend_domain_faceWhether to extrapolate the EB description beyond the domain by extending from the domain face.
num_coarsen_optNumber of coarse probes to try (defaults to EB2::NumCoarsenOpt / runtime eb2.num_coarsen_opt) before rebuilding at full resolution.

◆ Build() [3/3]

void amrex::EB2::Build ( const Geometry geom,
int  required_coarsening_level,
int  max_coarsening_level,
int  ngrow = 4,
bool  build_coarse_level_by_coarsening = true,
bool  extend_domain_face = ExtendDomainFace(),
int  num_coarsen_opt = NumCoarsenOpt(),
bool  support_mvmc = false 
)

Build EB geometry using the runtime-configured EB2 geometry type.

This overload does not take an explicit GeometryShop; instead it inspects the eb2 ParmParse namespace (notably eb2.geom_type along with its shape-specific parameters) and instantiates the matching implicit function. Supported values currently include all_regular, box, cylinder, plane, sphere, torus, parser, and stl.

Parameters
geomFinest-level Geometry.
required_coarsening_levelNumber of coarse levels required by the application.
max_coarsening_levelUpper bound on the number of coarsenings we attempt; it is safe if fewer levels are actually realizable.
ngrowNumber of EB grow cells to build (default 4).
build_coarse_level_by_coarseningWhen true, coarsen from finer levels; otherwise rebuild.
extend_domain_faceWhether to extrapolate the EB description beyond the domain by extending from the domain face.
num_coarsen_optNumber of coarse probes to try (defaults to EB2::NumCoarsenOpt / runtime eb2.num_coarsen_opt) before rebuilding at full resolution.
support_mvmcWhether to build multi-valued multi-cut support. (Only honored when eb2.geom_type is stl; other geometries ignore it and emit a warning. Even for STL, this is not supported yet.)

◆ BuildFromChkptFile()

void amrex::EB2::BuildFromChkptFile ( std::string const &  fname,
const Geometry geom,
int  required_coarsening_level,
int  max_coarsening_level,
int  ngrow = 4,
bool  build_coarse_level_by_coarsening = true,
bool  extend_domain_face = ExtendDomainFace() 
)

Rebuild an IndexSpace from a checkpoint file.

Parameters
fnamePath to the checkpoint file.
geomGeometry describing the finest level.
required_coarsening_levelNumber of coarse levels required.
max_coarsening_levelUpper bound on the number of coarsenings to try when reconstructing from disk (no error if the stored data yields fewer).
ngrowNumber of grow cells.
build_coarse_level_by_coarseningWhether to coarsen or rebuild coarse levels.
extend_domain_faceWhether to extrapolate the EB description beyond the domain by extending from the domain face.

◆ BuildMultiValuedMultiCut()

void amrex::EB2::BuildMultiValuedMultiCut ( const Geometry geom,
int  required_coarsening_level,
int  max_coarsening_level,
int  ngrow = 4,
bool  build_coarse_level_by_coarsening = true,
bool  extend_domain_face = ExtendDomainFace(),
int  num_coarsen_opt = NumCoarsenOpt() 
)

Build EB geometry dedicated to multi-valued multi-cut support.

Parameters mirror Build() but always enables multi-valued structures.

Warning
This pathway is experimental and not supported yet.

◆ ExtendDomainFace()

bool amrex::EB2::ExtendDomainFace ( )

Return whether EB2 builders should extend the domain face when outlining geometry. The flag seeds the default extend_domain_face argument in EB2::Build. It returns true unless overridden at runtime via the eb2.extend_domain_face parameter, letting users control whether embedded boundaries outside the domain are extrapolated from the domain face (i.e., extended beyond the physical boundary).

◆ extrude()

template<class F >
constexpr ExtrusionIF< std::decay_t< F > > amrex::EB2::extrude ( F &&  f,
int  direction 
)
constexpr

◆ Finalize()

void amrex::EB2::Finalize ( )

Tear down EB2 global resources (called automatically at shutdown).

◆ IF_f()

template<class F , std::enable_if_t< IsGPUable< F >::value > * FOO = nullptr>
__host__ __device__ Real amrex::EB2::IF_f ( F const &  f,
GpuArray< Real, 3 > const &  p 
)
noexcept

◆ Initialize()

void amrex::EB2::Initialize ( )

Initialize EB2’s global state (call before constructing geometries by amrex::Initialize).

◆ lathe()

template<class F >
constexpr LatheIF< std::decay_t< F > > amrex::EB2::lathe ( F &&  f)
constexpr

◆ makeComplement()

template<class F >
constexpr ComplementIF< std::decay_t< F > > amrex::EB2::makeComplement ( F &&  f)
constexpr

Helper that constructs a complement operator.

◆ makeDifference()

template<class F , class G >
constexpr DifferenceIF< std::decay_t< F >, std::decay_t< G > > amrex::EB2::makeDifference ( F &&  f,
G &&  g 
)
constexpr

Helper that constructs a difference operator.

◆ makeIntersection()

template<class... Fs>
constexpr IntersectionIF< std::decay_t< Fs > ... > amrex::EB2::makeIntersection ( Fs &&...  fs)
constexpr

◆ makeShop() [1/2]

template<class F >
GeometryShop< std::decay_t< F > > amrex::EB2::makeShop ( F &&  f)

Helper that constructs a GeometryShop owning the supplied implicit function.

Parameters
fImplicit function callable.

◆ makeShop() [2/2]

template<class F , class R >
GeometryShop< std::decay_t< F >, std::decay_t< R > > amrex::EB2::makeShop ( F &&  f,
R &&  r 
)

Helper that constructs a GeometryShop for an implicit function plus an extra resource handle.

Parameters
fImplicit function callable.
rExtra resource (e.g., Parser data) kept alive for f.

◆ makeUnion()

template<class... Fs>
constexpr UnionIF< std::decay_t< Fs > ... > amrex::EB2::makeUnion ( Fs &&...  fs)
constexpr

◆ maxCoarseningLevel() [1/2]

int amrex::EB2::maxCoarseningLevel ( const Geometry geom)

Return the maximum coarsening level supported for given geom.

◆ maxCoarseningLevel() [2/2]

int amrex::EB2::maxCoarseningLevel ( IndexSpace const *  ebis,
const Geometry geom 
)

Same as above but for a specific IndexSpace pointer ebis.

◆ NumCoarsenOpt()

int amrex::EB2::NumCoarsenOpt ( )

Default number of coarsening options to probe when building the EB hierarchy. The value seeds the default num_coarsen_opt argument in EB2::Build and defaults to 0 (no extra coarse probes) unless overridden via the runtime parameter eb2.num_coarsen_opt. It specifies how many successive coarse representations we may inspect to avoid missing fine EB structures inside a sub-box when searching for embedded boundaries. As soon as EB is detected the hierarchy is rebuilt at full resolution, so varying this value only affects the probability of missing features during the coarse scan—not the final EB geometry if nothing is missed.

◆ rotate()

template<class F >
constexpr RotationIF< std::decay_t< F > > amrex::EB2::rotate ( F &&  f,
const Real  angle,
const int  dir 
)
constexpr

◆ scale()

template<class F >
constexpr ScaleIF< std::decay_t< F > > amrex::EB2::scale ( F &&  f,
const RealArray scalefactor 
)
constexpr

◆ TopIndexSpace()

const IndexSpace * amrex::EB2::TopIndexSpace ( )
inlinenoexcept

Return the top IndexSpace if one has been built (nullptr otherwise).

◆ TopIndexSpaceIfPresent()

const IndexSpace * amrex::EB2::TopIndexSpaceIfPresent ( )
noexcept

Return the top IndexSpace if one has been built (nullptr otherwise).

◆ translate()

template<class F >
constexpr TranslationIF< std::decay_t< F > > amrex::EB2::translate ( F &&  f,
const RealArray offset 
)
constexpr