|
core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
|
#include <distributed_poisson.hpp>
Public Member Functions | |
| void | init (DistributedOctree< Dim, Bits > &d, double 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). | |
Definition at line 40 of file distributed_poisson.hpp.
|
inline |
Definition at line 42 of file distributed_poisson.hpp.
References peclet::core::amr::DistributedOctree< Dim, Bits >::buildFaceGatherPlan().
|
inline |
Definition at line 51 of file distributed_poisson.hpp.
References peclet::core::amr::DistributedOctree< Dim, Bits >::local(), and peclet::core::amr::BlockOctree< Dim, Bits >::numLeaves().
Referenced by peclet::core::amr::DistributedPoisson< Dim, Bits >::apply(), peclet::core::amr::DistributedPoisson< Dim, Bits >::jacobi(), peclet::core::amr::DistributedPoisson< Dim, Bits >::residual(), and peclet::core::amr::DistributedPoisson< Dim, Bits >::residualNorm().
|
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 56 of file distributed_poisson.hpp.
References peclet::core::amr::DistributedOctree< Dim, Bits >::faceNeighborGather(), and peclet::core::amr::DistributedPoisson< Dim, Bits >::numLeaves().
Referenced by peclet::core::amr::DistributedPoisson< Dim, Bits >::jacobi(), peclet::core::amr::DistributedPoisson< Dim, Bits >::residual(), and peclet::core::amr::DistributedPoisson< Dim, Bits >::residualNorm().
|
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 74 of file distributed_poisson.hpp.
References peclet::core::amr::DistributedPoisson< Dim, Bits >::apply(), and peclet::core::amr::DistributedPoisson< Dim, Bits >::numLeaves().
Referenced by peclet::core::amr::DistributedMultigrid< Dim, Bits >::vcycle().
|
inline |
res = b − L x (local vector); also returns its global L2 norm.
Definition at line 89 of file distributed_poisson.hpp.
References peclet::core::amr::DistributedPoisson< Dim, Bits >::apply(), peclet::core::amr::DistributedOctree< Dim, Bits >::comm(), MPI_Allreduce(), MPI_DOUBLE, MPI_SUM, and peclet::core::amr::DistributedPoisson< Dim, Bits >::numLeaves().
Referenced by peclet::core::amr::DistributedMultigrid< Dim, Bits >::vcycle().
|
inline |
Global L2 norm of b − L x (across ranks).
Definition at line 107 of file distributed_poisson.hpp.
References peclet::core::amr::DistributedPoisson< Dim, Bits >::apply(), peclet::core::amr::DistributedOctree< Dim, Bits >::comm(), MPI_Allreduce(), MPI_DOUBLE, MPI_SUM, and peclet::core::amr::DistributedPoisson< Dim, Bits >::numLeaves().