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

#include <distributed_poisson.hpp>

Public Member Functions

void init (DistributedOctree< Dim, Bits > &d, double h0)
void init (DistributedOctree< Dim, Bits > &d, const Vec< Dim > &h0)
Index numLeaves () const
void apply (const std::vector< double > &x, std::vector< double > &y) const
 y = L x with L = ∇² (negative-definite: diagonal −2*Dim/h², off +1/h²).
void jacobi (std::vector< double > &x, const std::vector< double > &b, int sweeps, double omega=0.8) const
 sweeps damped-Jacobi relaxations of L u = b (in place), L = ∇².
double residual (const std::vector< double > &x, const std::vector< double > &b, std::vector< double > &res) const
 res = b − L x (local vector); also returns its global L2 norm.
double residualNorm (const std::vector< double > &x, const std::vector< double > &b) const
 Global L2 norm of b − L x (across ranks).

Detailed Description

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

Definition at line 38 of file distributed_poisson.hpp.

Member Function Documentation

◆ init() [1/2]

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::amr::DistributedPoisson< Dim, Bits >::init ( DistributedOctree< Dim, Bits > & d,
double h0 )
inline

Definition at line 40 of file distributed_poisson.hpp.

References peclet::amr::detail::filledVec(), and init().

Referenced by init().

◆ init() [2/2]

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::amr::DistributedPoisson< Dim, Bits >::init ( DistributedOctree< Dim, Bits > & d,
const Vec< Dim > & h0 )
inline

◆ numLeaves()

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

Definition at line 50 of file distributed_poisson.hpp.

Referenced by apply(), jacobi(), residual(), and residualNorm().

◆ apply()

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

y = L x with L = ∇² (negative-definite: diagonal −2*Dim/h², off +1/h²).

Cross-block neighbours come from the owner-based halo; periodic global domain ⇒ every face has a neighbour.

Definition at line 55 of file distributed_poisson.hpp.

References numLeaves().

Referenced by jacobi(), residual(), and residualNorm().

◆ jacobi()

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

sweeps damped-Jacobi relaxations of L u = b (in place), L = ∇².

The point update is u_i += ω (L u_i − b_i)/diag with diag = 2*Dim/h² (= −L_ii, so the damping has the right sign for the negative-definite L). Reads only the previous iterate (one halo gather per sweep) ⇒ bit-identical to a serial single-block sweep.

Definition at line 78 of file distributed_poisson.hpp.

References apply(), and numLeaves().

◆ residual()

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

res = b − L x (local vector); also returns its global L2 norm.

Definition at line 97 of file distributed_poisson.hpp.

References apply(), and numLeaves().

◆ residualNorm()

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

Global L2 norm of b − L x (across ranks).

Definition at line 115 of file distributed_poisson.hpp.

References apply(), and numLeaves().


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