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::ScalarTransport< Dim, Bits > Class Template Reference

#include <scalar_transport.hpp>

Public Types

using Octree = BlockOctree<Dim, Bits>
using M = typename Octree::M
using Code = typename Octree::Code
using Coord = typename Octree::Coord

Public Member Functions

 ScalarTransport ()=default
 ScalarTransport (const Octree &t, const AmrGeometry< Dim > &geo)
void init (const Octree &t, const AmrGeometry< Dim > &geo)
Index numLeaves () const
Real cellWidth (Index i, int axis) const
 Phase 3: per-axis cell width; the scalar form is the cubic one (docs/amr_anisotropic.md).
Real cellWidth (Index i) const
Real cellVolume (Index i) const
double totalMass (const std::vector< double > &c) const
 Total scalar content sum_i V_i c_i (conserved by a divergence-free update).
template<class VelFn>
void step (const std::vector< double > &c, std::vector< double > &cOut, double dt, double D, VelFn &&vel) const
 One explicit Euler step: cOut = c + dt*(-div(u c) + D lap(c)).
template<class Fn>
void forEachFace (Index i, Fn &&fn) const
 Visit each (sub)face of leaf i.

Detailed Description

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
class peclet::amr::ScalarTransport< Dim, Bits >

Definition at line 33 of file scalar_transport.hpp.

Member Typedef Documentation

◆ Octree

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::amr::ScalarTransport< Dim, Bits >::Octree = BlockOctree<Dim, Bits>

Definition at line 35 of file scalar_transport.hpp.

◆ M

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::amr::ScalarTransport< Dim, Bits >::M = typename Octree::M

Definition at line 36 of file scalar_transport.hpp.

◆ Code

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::amr::ScalarTransport< Dim, Bits >::Code = typename Octree::Code

Definition at line 37 of file scalar_transport.hpp.

◆ Coord

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::amr::ScalarTransport< Dim, Bits >::Coord = typename Octree::Coord

Definition at line 38 of file scalar_transport.hpp.

Constructor & Destructor Documentation

◆ ScalarTransport() [1/2]

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
peclet::amr::ScalarTransport< Dim, Bits >::ScalarTransport ( )
default

◆ ScalarTransport() [2/2]

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
peclet::amr::ScalarTransport< Dim, Bits >::ScalarTransport ( const Octree & t,
const AmrGeometry< Dim > & geo )
inline

Definition at line 41 of file scalar_transport.hpp.

References init().

Member Function Documentation

◆ init()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::amr::ScalarTransport< Dim, Bits >::init ( const Octree & t,
const AmrGeometry< Dim > & geo )
inline

◆ numLeaves()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
Index peclet::amr::ScalarTransport< Dim, Bits >::numLeaves ( ) const
inline

Definition at line 50 of file scalar_transport.hpp.

Referenced by step(), and totalMass().

◆ cellWidth() [1/2]

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
Real peclet::amr::ScalarTransport< Dim, Bits >::cellWidth ( Index i,
int axis ) const
inline

Phase 3: per-axis cell width; the scalar form is the cubic one (docs/amr_anisotropic.md).

Definition at line 52 of file scalar_transport.hpp.

◆ cellWidth() [2/2]

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
Real peclet::amr::ScalarTransport< Dim, Bits >::cellWidth ( Index i) const
inline

Definition at line 55 of file scalar_transport.hpp.

References cellWidth().

Referenced by cellWidth().

◆ cellVolume()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
Real peclet::amr::ScalarTransport< Dim, Bits >::cellVolume ( Index i) const
inline

Definition at line 56 of file scalar_transport.hpp.

Referenced by step(), and totalMass().

◆ totalMass()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
double peclet::amr::ScalarTransport< Dim, Bits >::totalMass ( const std::vector< double > & c) const
inline

Total scalar content sum_i V_i c_i (conserved by a divergence-free update).

Definition at line 65 of file scalar_transport.hpp.

References cellVolume(), and numLeaves().

◆ step()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
template<class VelFn>
void peclet::amr::ScalarTransport< Dim, Bits >::step ( const std::vector< double > & c,
std::vector< double > & cOut,
double dt,
double D,
VelFn && vel ) const
inline

One explicit Euler step: cOut = c + dt*(-div(u c) + D lap(c)).

vel(fc,axis) returns the axis-component of velocity at world face centre fc.

Definition at line 75 of file scalar_transport.hpp.

References cellVolume(), forEachFace(), and numLeaves().

◆ forEachFace()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
template<class Fn>
void peclet::amr::ScalarTransport< Dim, Bits >::forEachFace ( Index i,
Fn && fn ) const
inline

Visit each (sub)face of leaf i.

fn(neighbour, axis, outwardSign, areaPhys, faceCentreWorld, centreDistPhys). Periodic; 2:1 interfaces enumerated.

Definition at line 96 of file scalar_transport.hpp.

Referenced by step().


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