peclet-amr 0.2.0
Block-local-Morton AMR octree + collocated cut-cell Navier–Stokes solver (header-only C++20, Kokkos + MPI)
Loading...
Searching...
No Matches
peclet::amr::pybind::Octree Class Reference
Inheritance diagram for peclet::amr::pybind::Octree:

Public Member Functions

 Octree (std::array< long, 3 > root, unsigned lmax, std::array< double, 3 > origin, std::array< double, 3 > spacing)
 
void release () noexcept override
 
Index num_leaves () const
 
unsigned lmax () const
 
std::array< double, 3 > origin () const
 
std::array< long, 3 > cells () const
 The FINEST-level cell counts the block resolves: root cells * 2**lmax per axis.
 
std::array< double, 3 > extent () const
 The block's physical side lengths, cells * spacing.
 
std::array< double, 3 > spacing () const
 
bool is_balanced () const
 
nb::ndarray< nb::numpy, double > centers () const
 
nb::ndarray< nb::numpy, double > sizes (int axis) const
 
nb::ndarray< nb::numpy, std::int32_t > levels () const
 
nb::ndarray< nb::numpy, std::uint64_t > codes () const
 
Index find (std::array< double, 3 > x) const
 
Index refine_to_sphere (std::array< double, 3 > center, double radius, unsigned target_level, double band, bool balance)
 
Index refine_to_sdf (std::function< double(double, double, double)> sdf, unsigned target_level, double band, bool balance)
 
Index refine_to_sdf_graded (std::function< double(double, double, double)> sdf, std::function< unsigned(double, double, double)> target_level, double band, bool balance)
 
Index refine_to_gap_floor (std::function< double(double, double, double)> sdf, std::function< double(double, double, double)> gap, unsigned coarsest_level, double n, double band, bool balance)
 
bool refine_leaf (Index i)
 
Index balance ()
 
const BO & octreeRef () const
 
const amr::AmrGeometry< 3 > & geoRef () const
 
nb::ndarray< nb::numpy, double > lohner_indicator (DArray field, double eps)
 
nb::ndarray< nb::numpy, double > adapt (DArray field, double refine_thresh, double coarsen_thresh, unsigned finest_level, double eps, bool linear)
 
void write_vtu (const std::string &path, const std::string &name, DArray field)
 

Detailed Description

Definition at line 246 of file amr_bindings.cpp.

Constructor & Destructor Documentation

◆ Octree()

peclet::amr::pybind::Octree::Octree ( std::array< long, 3 >  root,
unsigned  lmax,
std::array< double, 3 >  origin,
std::array< double, 3 >  spacing 
)
inline

Member Function Documentation

◆ release()

void peclet::amr::pybind::Octree::release ( )
inlineoverridenoexcept

Definition at line 254 of file amr_bindings.cpp.

◆ num_leaves()

Index peclet::amr::pybind::Octree::num_leaves ( ) const
inline

◆ lmax()

unsigned peclet::amr::pybind::Octree::lmax ( ) const
inline

Definition at line 258 of file amr_bindings.cpp.

References peclet::amr::BlockOctree< Dim, Bits >::lmax().

Referenced by Octree().

◆ origin()

std::array< double, 3 > peclet::amr::pybind::Octree::origin ( ) const
inline

Definition at line 259 of file amr_bindings.cpp.

References peclet::amr::AmrGeometry< Dim >::origin.

Referenced by Octree().

◆ cells()

std::array< long, 3 > peclet::amr::pybind::Octree::cells ( ) const
inline

The FINEST-level cell counts the block resolves: root cells * 2**lmax per axis.

Definition at line 261 of file amr_bindings.cpp.

References peclet::amr::BlockOctree< Dim, Bits >::brick(), peclet::amr::BlockOctree< Dim, Bits >::lmax(), and peclet::amr::transferFieldGradients().

Referenced by extent().

◆ extent()

std::array< double, 3 > peclet::amr::pybind::Octree::extent ( ) const
inline

The block's physical side lengths, cells * spacing.

Definition at line 267 of file amr_bindings.cpp.

References cells(), peclet::amr::AmrGeometry< Dim >::h0, and peclet::amr::transferFieldGradients().

◆ spacing()

std::array< double, 3 > peclet::amr::pybind::Octree::spacing ( ) const
inline

Definition at line 271 of file amr_bindings.cpp.

References peclet::amr::AmrGeometry< Dim >::h0.

Referenced by Octree().

◆ is_balanced()

bool peclet::amr::pybind::Octree::is_balanced ( ) const
inline

◆ centers()

nb::ndarray< nb::numpy, double > peclet::amr::pybind::Octree::centers ( ) const
inline

Definition at line 274 of file amr_bindings.cpp.

References peclet::amr::pybind::leafCenters().

◆ sizes()

nb::ndarray< nb::numpy, double > peclet::amr::pybind::Octree::sizes ( int  axis) const
inline

Definition at line 275 of file amr_bindings.cpp.

References peclet::amr::pybind::leafSizes().

◆ levels()

nb::ndarray< nb::numpy, std::int32_t > peclet::amr::pybind::Octree::levels ( ) const
inline

Definition at line 276 of file amr_bindings.cpp.

References peclet::amr::pybind::leafLevels().

◆ codes()

nb::ndarray< nb::numpy, std::uint64_t > peclet::amr::pybind::Octree::codes ( ) const
inline

Definition at line 277 of file amr_bindings.cpp.

References peclet::amr::pybind::leafCodes().

◆ find()

Index peclet::amr::pybind::Octree::find ( std::array< double, 3 >  x) const
inline

◆ refine_to_sphere()

Index peclet::amr::pybind::Octree::refine_to_sphere ( std::array< double, 3 >  center,
double  radius,
unsigned  target_level,
double  band,
bool  balance 
)
inline

◆ refine_to_sdf()

Index peclet::amr::pybind::Octree::refine_to_sdf ( std::function< double(double, double, double)>  sdf,
unsigned  target_level,
double  band,
bool  balance 
)
inline

◆ refine_to_sdf_graded()

Index peclet::amr::pybind::Octree::refine_to_sdf_graded ( std::function< double(double, double, double)>  sdf,
std::function< unsigned(double, double, double)>  target_level,
double  band,
bool  balance 
)
inline

◆ refine_to_gap_floor()

Index peclet::amr::pybind::Octree::refine_to_gap_floor ( std::function< double(double, double, double)>  sdf,
std::function< double(double, double, double)>  gap,
unsigned  coarsest_level,
double  n,
double  band,
bool  balance 
)
inline

◆ refine_leaf()

bool peclet::amr::pybind::Octree::refine_leaf ( Index  i)
inline

◆ balance()

Index peclet::amr::pybind::Octree::balance ( )
inline

◆ octreeRef()

const BO & peclet::amr::pybind::Octree::octreeRef ( ) const
inline

Definition at line 338 of file amr_bindings.cpp.

◆ geoRef()

const amr::AmrGeometry< 3 > & peclet::amr::pybind::Octree::geoRef ( ) const
inline

Definition at line 339 of file amr_bindings.cpp.

◆ lohner_indicator()

nb::ndarray< nb::numpy, double > peclet::amr::pybind::Octree::lohner_indicator ( DArray  field,
double  eps 
)
inline

◆ adapt()

nb::ndarray< nb::numpy, double > peclet::amr::pybind::Octree::adapt ( DArray  field,
double  refine_thresh,
double  coarsen_thresh,
unsigned  finest_level,
double  eps,
bool  linear 
)
inline

◆ write_vtu()

void peclet::amr::pybind::Octree::write_vtu ( const std::string &  path,
const std::string &  name,
DArray  field 
)
inline

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