core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::amr::AmrMultigrid< Dim, Bits > Class Template Reference

Geometric multigrid for AmrPoisson over a uniformly-coarsened octree hierarchy. More...

#include <poisson.hpp>

Public Types

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

Public Member Functions

void build (const Octree &finest, Real h0)
 Build the hierarchy from a finest octree by uniform coarsening until a single leaf remains (or no full sibling group can be merged).
 
std::size_t numLevels () const
 
const AmrPoisson< Dim, Bits > & op (std::size_t L=0) const
 
void setPeriodic (bool p)
 Apply a boundary condition to every level (periodic default, or non-periodic homogeneous Dirichlet).
 
void setImmersedWall (bool w)
 Enable the immersed no-slip (Dirichlet) wall on every level — the velocity operator.
 
void vcycle (std::size_t L, std::vector< double > &u, const std::vector< double > &rhs, int pre=2, int post=2)
 One V-cycle on level L solving L u = rhs (correction scheme).
 
double solveQuad (std::vector< double > &u, const std::vector< double > &rhs, int outer=30, int cyclesPerOuter=1)
 Solve the quadratic C/F operator L_quad u = rhs by deferred correction: the standard-operator V-cycle solves L_std u = rhs - (L_quad - L_std) u, with the cheap-to-evaluate quadratic correction lagged.
 
template<class OpenFn >
void setOpenness (OpenFn &&openFn)
 Set cut-cell face openness on the finest level from a geometry callable openFn(faceCentreWorld, axis) -> [0,1], then coarsen it to every coarser level by area-averaging the fine sub-faces (flow's coarsenOpenAvg).
 

Detailed Description

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

Geometric multigrid for AmrPoisson over a uniformly-coarsened octree hierarchy.

Definition at line 511 of file poisson.hpp.

Member Typedef Documentation

◆ Octree

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

Definition at line 513 of file poisson.hpp.

◆ M

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

Definition at line 514 of file poisson.hpp.

◆ Code

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

Definition at line 515 of file poisson.hpp.

Member Function Documentation

◆ build()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::AmrMultigrid< Dim, Bits >::build ( const Octree finest,
Real  h0 
)
inline

Build the hierarchy from a finest octree by uniform coarsening until a single leaf remains (or no full sibling group can be merged).

Definition at line 519 of file poisson.hpp.

◆ numLevels()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
std::size_t peclet::core::amr::AmrMultigrid< Dim, Bits >::numLevels ( ) const
inline

Definition at line 549 of file poisson.hpp.

◆ op()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
const AmrPoisson< Dim, Bits > & peclet::core::amr::AmrMultigrid< Dim, Bits >::op ( std::size_t  L = 0) const
inline

Definition at line 550 of file poisson.hpp.

◆ setPeriodic()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::AmrMultigrid< Dim, Bits >::setPeriodic ( bool  p)
inline

Apply a boundary condition to every level (periodic default, or non-periodic homogeneous Dirichlet).

Call after build().

Definition at line 554 of file poisson.hpp.

◆ setImmersedWall()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::AmrMultigrid< Dim, Bits >::setImmersedWall ( bool  w)
inline

Enable the immersed no-slip (Dirichlet) wall on every level — the velocity operator.

Call after setOpenness() (the wall is derived per level from that level's coarsened aperture, so it is consistent down the hierarchy). Call after build().

Definition at line 562 of file poisson.hpp.

◆ vcycle()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::AmrMultigrid< Dim, Bits >::vcycle ( std::size_t  L,
std::vector< double > &  u,
const std::vector< double > &  rhs,
int  pre = 2,
int  post = 2 
)
inline

One V-cycle on level L solving L u = rhs (correction scheme).

Definition at line 568 of file poisson.hpp.

References peclet::core::amr::AmrMultigrid< Dim, Bits >::vcycle().

Referenced by peclet::core::amr::AmrMultigrid< Dim, Bits >::solveQuad(), and peclet::core::amr::AmrMultigrid< Dim, Bits >::vcycle().

◆ solveQuad()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
double peclet::core::amr::AmrMultigrid< Dim, Bits >::solveQuad ( std::vector< double > &  u,
const std::vector< double > &  rhs,
int  outer = 30,
int  cyclesPerOuter = 1 
)
inline

Solve the quadratic C/F operator L_quad u = rhs by deferred correction: the standard-operator V-cycle solves L_std u = rhs - (L_quad - L_std) u, with the cheap-to-evaluate quadratic correction lagged.

Returns the final L_quad residual norm. cyclesPerOuter V-cycles per correction update.

Definition at line 613 of file poisson.hpp.

References peclet::core::amr::AmrMultigrid< Dim, Bits >::vcycle().

◆ setOpenness()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
template<class OpenFn >
void peclet::core::amr::AmrMultigrid< Dim, Bits >::setOpenness ( OpenFn &&  openFn)
inline

Set cut-cell face openness on the finest level from a geometry callable openFn(faceCentreWorld, axis) -> [0,1], then coarsen it to every coarser level by area-averaging the fine sub-faces (flow's coarsenOpenAvg).

The per-level operators are thereby rediscretized with consistent openness, and the openness-weighted quadratic C/F flux applies on every level. Call after build().

Definition at line 638 of file poisson.hpp.


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