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

#include <distributed_fv.hpp>

Public Types

using DO = DistributedOctree< Dim, Bits >
 
using M = typename DO::M
 
using Code = typename DO::Code
 
using Coord = typename DO::Coord
 

Public Member Functions

void init (DO &d)
 Build the consistent face stencil, openness-free (w_f = A_f/d_f).
 
template<class OpenFn >
void init (DO &d, OpenFn &&openFn)
 Build with cut-cell openness: w_f = α_f · A_f/d_f, where α_f = openFn(face centroid, axis) ∈ [0,1] (1 fluid, 0 solid) evaluated at the finer side's (sub-)face centroid in world coords.
 
Index numLeaves () const
 
void apply (const std::vector< double > &u, std::vector< double > &Lu) const
 Lu = L u (consistent conservative FV Laplacian, negative-definite).
 
double residual (const std::vector< double > &u, const std::vector< double > &rhs, std::vector< double > &res) const
 res = rhs − L u; returns the global L2 norm (volume-weighted).
 
double residualNorm (const std::vector< double > &u, const std::vector< double > &rhs) const
 
void jacobi (std::vector< double > &u, const std::vector< double > &rhs, int sweeps, double omega=0.8) const
 sweeps weighted-Jacobi relaxations of L u = rhs (point solve u_i ← (Σ w u_nb − V_i rhs_i)/Σ w).
 

Detailed Description

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

Definition at line 45 of file distributed_fv.hpp.

Member Typedef Documentation

◆ DO

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::core::amr::DistributedFvOperator< Dim, Bits >::DO = DistributedOctree<Dim, Bits>

Definition at line 47 of file distributed_fv.hpp.

◆ M

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

Definition at line 48 of file distributed_fv.hpp.

◆ Code

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

Definition at line 49 of file distributed_fv.hpp.

◆ Coord

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

Definition at line 50 of file distributed_fv.hpp.

Member Function Documentation

◆ init() [1/2]

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::DistributedFvOperator< Dim, Bits >::init ( DO d)
inline

Build the consistent face stencil, openness-free (w_f = A_f/d_f).

Definition at line 53 of file distributed_fv.hpp.

References peclet::core::amr::DistributedFvOperator< Dim, Bits >::init().

Referenced by peclet::core::amr::DistributedFvOperator< Dim, Bits >::init().

◆ init() [2/2]

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

Build with cut-cell openness: w_f = α_f · A_f/d_f, where α_f = openFn(face centroid, axis) ∈ [0,1] (1 fluid, 0 solid) evaluated at the finer side's (sub-)face centroid in world coords.

Both sides of a face — even across a block boundary — evaluate openFn at the same point, so α is symmetric (no exchange needed) and the operator stays conservative. Matches AmrPoisson::buildOpenness. (One owner round to learn cross-block covering levels; octree must be 2:1.)

Definition at line 64 of file distributed_fv.hpp.

References peclet::core::amr::DistributedOctree< Dim, Bits >::blockFineOrigin(), peclet::core::amr::DistributedOctree< Dim, Bits >::coverLevels(), peclet::core::amr::DistributedOctree< Dim, Bits >::faceAcross(), peclet::core::amr::DistributedOctree< Dim, Bits >::globalFineSize(), peclet::core::amr::DistributedOctree< Dim, Bits >::globalGeometry(), peclet::core::amr::DistributedOctree< Dim, Bits >::h0(), peclet::core::amr::DistributedOctree< Dim, Bits >::local(), and peclet::core::amr::BlockOctree< Dim, Bits >::numLeaves().

◆ numLeaves()

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

Definition at line 245 of file distributed_fv.hpp.

◆ apply()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::DistributedFvOperator< Dim, Bits >::apply ( const std::vector< double > &  u,
std::vector< double > &  Lu 
) const
inline

Lu = L u (consistent conservative FV Laplacian, negative-definite).

Definition at line 248 of file distributed_fv.hpp.

References peclet::core::amr::DistributedOctree< Dim, Bits >::coverValues().

Referenced by peclet::core::amr::DistributedFvOperator< Dim, Bits >::residual().

◆ residual()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
double peclet::core::amr::DistributedFvOperator< Dim, Bits >::residual ( const std::vector< double > &  u,
const std::vector< double > &  rhs,
std::vector< double > &  res 
) const
inline

◆ residualNorm()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
double peclet::core::amr::DistributedFvOperator< Dim, Bits >::residualNorm ( const std::vector< double > &  u,
const std::vector< double > &  rhs 
) const
inline

◆ jacobi()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::DistributedFvOperator< Dim, Bits >::jacobi ( std::vector< double > &  u,
const std::vector< double > &  rhs,
int  sweeps,
double  omega = 0.8 
) const
inline

sweeps weighted-Jacobi relaxations of L u = rhs (point solve u_i ← (Σ w u_nb − V_i rhs_i)/Σ w).

Reads only the previous iterate (one ghost gather per sweep) ⇒ bit-identical across rank counts.

Definition at line 290 of file distributed_fv.hpp.

References peclet::core::amr::DistributedOctree< Dim, Bits >::coverValues().


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