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::AmrGeometry< Dim > Struct Template Reference

World-space placement of a block-local octree: fine coordinate (0,..,0) sits at origin, and one level-0 fine cell is h0[d] wide on axis d. More...

#include <leaf_field.hpp>

Public Member Functions

void setIsotropic (Real h)
 Set all axes to one spacing (the cubic case), in place.
 
Real hMin () const
 
Real hMax () const
 
bool isotropic () const
 
Real cellVolume () const
 World volume of a level-0 fine cell.
 
Real leafSize (unsigned level, int d) const
 World width of a leaf at level on axis d (it covers 2^level fine cells).
 
Vec< Dim > leafSize (unsigned level) const
 World widths of a leaf at level, per axis.
 
template<class Coord >
Vec< Dim > lowerCorner (const std::array< Coord, Dim > &lo) const
 World coordinate of a leaf's lower corner, given its integer lower bound (fine units).
 
template<class Coord >
Vec< Dim > center (const std::array< std::array< Coord, Dim >, 2 > &b) const
 World coordinate of a leaf centre, from its integer bounds [lo,hi] (inclusive, fine units).
 

Static Public Member Functions

static AmrGeometry isotropicAt (const Vec< Dim > &o, Real h)
 Cubic-cell convenience: the pre-Phase-3 {origin, h} construction.
 

Public Attributes

Vec< Dim > origin {}
 
Vec< Dim > h0 = detail::filledVec<Dim>(1.0)
 

Detailed Description

template<int Dim>
struct peclet::amr::AmrGeometry< Dim >

World-space placement of a block-local octree: fine coordinate (0,..,0) sits at origin, and one level-0 fine cell is h0[d] wide on axis d.

**h0 is PER AXIS** (Phase 3 of suite/docs/PHYSICAL_UNITS_PLAN.md; the design is docs/amr_anisotropic.md). The octree refines by 2 on every axis, so a level-l leaf is h0[d] * 2^l wide on axis d and every level inherits the root aspect ratio — the Morton codes, bounds(), level(), the halo, the ORB and the 2:1 balance are integer fine-unit arithmetic and know nothing about it.

leafSize() and lowerCorner() are the two funnels every world-coordinate computation goes through; making h0 a Vec breaks every scalar caller at COMPILE time, which is the inventory mechanism the port relies on. Cubic geometry is AmrGeometry::isotropicAt(origin, h).

Definition at line 47 of file leaf_field.hpp.

Member Function Documentation

◆ isotropicAt()

template<int Dim>
static AmrGeometry peclet::amr::AmrGeometry< Dim >::isotropicAt ( const Vec< Dim > &  o,
Real  h 
)
inlinestatic

Cubic-cell convenience: the pre-Phase-3 {origin, h} construction.

Definition at line 52 of file leaf_field.hpp.

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

◆ setIsotropic()

template<int Dim>
void peclet::amr::AmrGeometry< Dim >::setIsotropic ( Real  h)
inline

Set all axes to one spacing (the cubic case), in place.

Definition at line 59 of file leaf_field.hpp.

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

◆ hMin()

template<int Dim>
Real peclet::amr::AmrGeometry< Dim >::hMin ( ) const
inline

◆ hMax()

template<int Dim>
Real peclet::amr::AmrGeometry< Dim >::hMax ( ) const
inline

◆ isotropic()

template<int Dim>
bool peclet::amr::AmrGeometry< Dim >::isotropic ( ) const
inline

Definition at line 73 of file leaf_field.hpp.

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

◆ cellVolume()

template<int Dim>
Real peclet::amr::AmrGeometry< Dim >::cellVolume ( ) const
inline

World volume of a level-0 fine cell.

Definition at line 80 of file leaf_field.hpp.

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

◆ leafSize() [1/2]

template<int Dim>
Real peclet::amr::AmrGeometry< Dim >::leafSize ( unsigned  level,
int  d 
) const
inline

World width of a leaf at level on axis d (it covers 2^level fine cells).

Definition at line 88 of file leaf_field.hpp.

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

◆ leafSize() [2/2]

template<int Dim>
Vec< Dim > peclet::amr::AmrGeometry< Dim >::leafSize ( unsigned  level) const
inline

World widths of a leaf at level, per axis.

Definition at line 92 of file leaf_field.hpp.

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

◆ lowerCorner()

template<int Dim>
template<class Coord >
Vec< Dim > peclet::amr::AmrGeometry< Dim >::lowerCorner ( const std::array< Coord, Dim > &  lo) const
inline

World coordinate of a leaf's lower corner, given its integer lower bound (fine units).

Definition at line 102 of file leaf_field.hpp.

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

◆ center()

template<int Dim>
template<class Coord >
Vec< Dim > peclet::amr::AmrGeometry< Dim >::center ( const std::array< std::array< Coord, Dim >, 2 > &  b) const
inline

World coordinate of a leaf centre, from its integer bounds [lo,hi] (inclusive, fine units).

Definition at line 111 of file leaf_field.hpp.

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

Member Data Documentation

◆ origin

◆ h0


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