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 247 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

Definition at line 249 of file amr_bindings.cpp.

References lmax(), origin(), and spacing().

Member Function Documentation

◆ release()

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

Definition at line 255 of file amr_bindings.cpp.

◆ num_leaves()

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

Definition at line 258 of file amr_bindings.cpp.

◆ lmax()

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

Definition at line 259 of file amr_bindings.cpp.

Referenced by Octree().

◆ origin()

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

Definition at line 260 of file amr_bindings.cpp.

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 262 of file amr_bindings.cpp.

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 268 of file amr_bindings.cpp.

References cells().

◆ spacing()

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

Definition at line 272 of file amr_bindings.cpp.

Referenced by Octree().

◆ is_balanced()

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

Definition at line 273 of file amr_bindings.cpp.

Referenced by NB_MODULE().

◆ centers()

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

Definition at line 275 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 276 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 277 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 278 of file amr_bindings.cpp.

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

◆ find()

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

Definition at line 282 of file amr_bindings.cpp.

◆ 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

Definition at line 295 of file amr_bindings.cpp.

References balance(), and peclet::amr::refineToSdf().

◆ 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

Definition at line 305 of file amr_bindings.cpp.

References balance(), and peclet::amr::refineToSdf().

◆ 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

Definition at line 314 of file amr_bindings.cpp.

References balance(), and peclet::amr::refineToSdfGraded().

◆ 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

Definition at line 324 of file amr_bindings.cpp.

References balance(), peclet::amr::gapFloorTarget(), and peclet::amr::refineToSdfGraded().

Referenced by NB_MODULE().

◆ refine_leaf()

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

Definition at line 335 of file amr_bindings.cpp.

◆ balance()

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

◆ octreeRef()

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

◆ geoRef()

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

◆ 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

Definition at line 367 of file amr_bindings.cpp.

References peclet::amr::pybind::asField(), and peclet::amr::writeVtu().


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