|
| void | setVcycle (int pre, int post, int bottom, double omega) |
| | V-cycle parameters used for the preconditioner application.
|
| void | setCyclesPerPrec (int k) |
| | Number of V-cycles per preconditioner application (default 1).
|
| void | setSingular (bool s) |
| | Whether to project out the constant nullspace (default true; set false for the non-singular homogeneous-Dirichlet operator).
|
| void | setDistributed (std::function< void(View< double >)> refresh, std::function< double(double)> dotReduce, Index nExt) |
| | Distributed solve (docs/amr_distributed_flow.md, rung 3): refresh re-fills the ghost tail [n, nExt) of a vector before its neighbour entries are read (the CG direction ahead of every matvec); dotReduce folds a local sum into the global one (an MPI_Allreduce lambda — a callable so this header stays MPI-free), applied to every volume-weighted dot AND to the nullspace-projection mean sums.
|
| template<class MGT = MG> |
| Result | solve (MGT &mg, View< double > x, View< const double > rhs, int maxIters=200, double tol=1e-10) |
| | Solve L x = rhs on mg's finest level into x (size n; nExt distributed).
|
template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
class peclet::amr::PCG< Dim, Bits >
Definition at line 116 of file pcg.hpp.
template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
| void peclet::amr::PCG< Dim, Bits >::setDistributed |
( |
std::function< void(View< double >)> | refresh, |
|
|
std::function< double(double)> | dotReduce, |
|
|
Index | nExt ) |
|
inline |
Distributed solve (docs/amr_distributed_flow.md, rung 3): refresh re-fills the ghost tail [n, nExt) of a vector before its neighbour entries are read (the CG direction ahead of every matvec); dotReduce folds a local sum into the global one (an MPI_Allreduce lambda — a callable so this header stays MPI-free), applied to every volume-weighted dot AND to the nullspace-projection mean sums.
Scratch (and the search direction) allocate at nExt so they carry ghost tails; the multigrid passed to solve() must size its finest x(0)/b(0) at the same nExt (DistributedFlowMultigrid does). Unset (default): the single-rank behaviour, bit-identical.
Definition at line 147 of file pcg.hpp.
template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
template<class MGT = MG>
| Result peclet::amr::PCG< Dim, Bits >::solve |
( |
MGT & | mg, |
|
|
View< double > | x, |
|
|
View< const double > | rhs, |
|
|
int | maxIters = 200, |
|
|
double | tol = 1e-10 ) |
|
inline |
Solve L x = rhs on mg's finest level into x (size n; nExt distributed).
Returns iteration count and residual history. tol is relative to the initial residual; maxIters caps the CG iterations. The multigrid mg must already be built (operator + hierarchy); any type exposing op(0)/x(0)/b(0)/numLeaves(0)/vcycle works (Multigrid, DistributedFlowMultigrid).
Definition at line 160 of file pcg.hpp.
References peclet::amr::applyFv(), peclet::amr::buildFluidMask(), peclet::amr::dotVol(), peclet::amr::FvOp::invVol, peclet::amr::PCG< Dim, Bits >::Result::iters, peclet::amr::maskSolid(), peclet::amr::removeMeanVolReduced(), peclet::amr::PCG< Dim, Bits >::Result::res, and peclet::amr::PCG< Dim, Bits >::Result::res0.