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::VelocityMG< Bits > Class Template Reference

#include <velocity_mg.hpp>

Public Types

using Octree = BlockOctree< 3, Bits >
 
using M = typename Octree::M
 
using Code = typename Octree::Code
 
using Poisson = AmrPoisson< 3, Bits >
 

Public Member Functions

void build (const Octree &finest, double h0, double idiag, double mu, const MomentumOp &fineOp, const std::vector< double > &kappa, const std::vector< char > &fluid, const std::vector< char > &cut, Index minCoarse=256)
 Build the rediscretized hierarchy.
 
void build (const Octree &finest, const Vec< 3 > &h0, double idiag, double mu, const MomentumOp &fineOp, const std::vector< double > &kappa, const std::vector< char > &fluid, const std::vector< char > &cut, Index minCoarse=256)
 Phase 3: the finest spacing per axis; every coarse level inherits the aspect ratio (AM1).
 
std::size_t numLevels () const
 
Index numLeaves (std::size_t L=0) const
 
View< double > x (std::size_t L=0)
 
View< double > b (std::size_t L=0)
 
void setFineOp (const MomentumOp &fineOp)
 Re-point level 0 at the (possibly FOU-updated) fine operator before a solve.
 
void setGaussSeidel (bool on)
 Opt-in: use multicolour Gauss–Seidel as the smoother (per-level colouring) instead of Jacobi — the strong fine smoother that "owns the cut band" (flow uses RB-GS), markedly improving the staircase at high resolution.
 
void vcycle (int pre=2, int post=2, int bottom=30, double omega=0.7, std::size_t L=0)
 One V-cycle (correction scheme) solving the fine operator.
 

Detailed Description

template<unsigned Bits = 21u>
class peclet::amr::VelocityMG< Bits >

Definition at line 39 of file velocity_mg.hpp.

Member Typedef Documentation

◆ Octree

template<unsigned Bits = 21u>
using peclet::amr::VelocityMG< Bits >::Octree = BlockOctree<3, Bits>

Definition at line 41 of file velocity_mg.hpp.

◆ M

Definition at line 42 of file velocity_mg.hpp.

◆ Code

Definition at line 43 of file velocity_mg.hpp.

◆ Poisson

template<unsigned Bits = 21u>
using peclet::amr::VelocityMG< Bits >::Poisson = AmrPoisson<3, Bits>

Definition at line 44 of file velocity_mg.hpp.

Member Function Documentation

◆ build() [1/2]

template<unsigned Bits = 21u>
void peclet::amr::VelocityMG< Bits >::build ( const Octree &  finest,
double  h0,
double  idiag,
double  mu,
const MomentumOp &  fineOp,
const std::vector< double > &  kappa,
const std::vector< char > &  fluid,
const std::vector< char > &  cut,
Index  minCoarse = 256 
)
inline

Build the rediscretized hierarchy.

fineOp is the sharp cut-cell operator (level 0); kappa / fluid are the per-fine-cell fluid fraction + flag (AmrCutCell::kappa / isFluid). idiag = ρ/dt, mu = μ. The fine octree is coarsened uniformly (one local octree per level), as in AmrMultigrid. The fine operator is referenced (not copied); rebuild it (e.g. with the FOU) before each solve and the V-cycle picks it up. minCoarse clamps the coarsening depth (flow's pore-scale cap): levels are dropped once a level would have fewer than minCoarse cells, so the coarsest grid still resolves the immersed feature. Coarsening below the feature scale makes a small object vanish from the staircase classification, leaving an inconsistent coarse operator that diverges (deep coarsening only sets the rate, not the answer — the fine smoother + exclude carry it).

Definition at line 56 of file velocity_mg.hpp.

References peclet::amr::VelocityMG< Bits >::build(), and peclet::amr::transferFieldGradients().

Referenced by peclet::amr::VelocityMG< Bits >::build().

◆ build() [2/2]

template<unsigned Bits = 21u>
void peclet::amr::VelocityMG< Bits >::build ( const Octree &  finest,
const Vec< 3 > &  h0,
double  idiag,
double  mu,
const MomentumOp &  fineOp,
const std::vector< double > &  kappa,
const std::vector< char > &  fluid,
const std::vector< char > &  cut,
Index  minCoarse = 256 
)
inline

Phase 3: the finest spacing per axis; every coarse level inherits the aspect ratio (AM1).

Definition at line 62 of file velocity_mg.hpp.

References peclet::amr::transferFieldGradients().

◆ numLevels()

template<unsigned Bits = 21u>
std::size_t peclet::amr::VelocityMG< Bits >::numLevels ( ) const
inline

Definition at line 135 of file velocity_mg.hpp.

◆ numLeaves()

template<unsigned Bits = 21u>
Index peclet::amr::VelocityMG< Bits >::numLeaves ( std::size_t  L = 0) const
inline

Definition at line 136 of file velocity_mg.hpp.

References peclet::amr::transferFieldGradients().

◆ x()

template<unsigned Bits = 21u>
View< double > peclet::amr::VelocityMG< Bits >::x ( std::size_t  L = 0)
inline

Definition at line 137 of file velocity_mg.hpp.

References peclet::amr::transferFieldGradients().

◆ b()

template<unsigned Bits = 21u>
View< double > peclet::amr::VelocityMG< Bits >::b ( std::size_t  L = 0)
inline

Definition at line 138 of file velocity_mg.hpp.

References peclet::amr::transferFieldGradients().

◆ setFineOp()

template<unsigned Bits = 21u>
void peclet::amr::VelocityMG< Bits >::setFineOp ( const MomentumOp &  fineOp)
inline

Re-point level 0 at the (possibly FOU-updated) fine operator before a solve.

Definition at line 140 of file velocity_mg.hpp.

References peclet::amr::transferFieldGradients().

◆ setGaussSeidel()

template<unsigned Bits = 21u>
void peclet::amr::VelocityMG< Bits >::setGaussSeidel ( bool  on)
inline

Opt-in: use multicolour Gauss–Seidel as the smoother (per-level colouring) instead of Jacobi — the strong fine smoother that "owns the cut band" (flow uses RB-GS), markedly improving the staircase at high resolution.

Default off (Jacobi).

Definition at line 144 of file velocity_mg.hpp.

◆ vcycle()

template<unsigned Bits = 21u>
void peclet::amr::VelocityMG< Bits >::vcycle ( int  pre = 2,
int  post = 2,
int  bottom = 30,
double  omega = 0.7,
std::size_t  L = 0 
)
inline

One V-cycle (correction scheme) solving the fine operator.

Average restriction, masked piecewise-constant prolongation, clean-fluid residual exclude; Jacobi or multicolour-GS smoother.

Definition at line 149 of file velocity_mg.hpp.

References peclet::amr::prolongAddMasked(), peclet::amr::restrictField(), peclet::amr::transferFieldGradients(), peclet::amr::VelocityMG< Bits >::vcycle(), and peclet::amr::zeroMasked().

Referenced by peclet::amr::VelocityMG< Bits >::vcycle().


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