|
Peano
|
Functions | |
| void | rollOverAndPrepareCGVertex (auto &vertex, bool restrictRhsAndInjectSolution, bool fas) |
| Apply updates from previous mesh sweep in multigrid sense and prepare for next correction step. | |
| void | updateRestrictionCounters (auto &vertices) |
| Restrict counters. | |
| template<class DGSolver , class CGSolver > | |
| void | injectSolution (const tarch::la::Matrix< TwoPowerD *CGSolver::VertexUnknowns, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &injectionMatrix, const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &dgSolution, auto &cgVertices) |
| template<class DGSolver , class CGSolver > | |
| tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > | prolongate (const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, TwoPowerD *CGSolver::VertexUnknowns, double > &prolongationMatrix, const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &dgSolution, const auto &cgVertices) |
| template<class DGSolver , class CGSolver > | |
| void | computeAndRestrictResidual (const tarch::la::Matrix< TwoPowerD *CGSolver::VertexUnknowns, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &restrictionMatrix, const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &massMatrix, const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &systemMatrix, const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &dgSolution, const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &dgRhs, const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &faceSolutions, auto &cgVertices) |
| template<class DGSolver , class CGSolver > | |
| void | computeAndRestrictHierarchicalResidual (const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, TwoPowerD *CGSolver::VertexUnknowns, double > &prolongationMatrix, const tarch::la::Matrix< TwoPowerD *CGSolver::VertexUnknowns, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &restrictionMatrix, const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &massMatrix, const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &systemMatrix, const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &dgSolution, const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > &dgRhs, auto &cgVertices) |
| template<class CGSolver > | |
| tarch::la::Vector< TwoPowerD *CGSolver::VertexUnknowns, double > | getCoarseGridSolution (auto &cgVertices) |
| Get the vector of course grid solutions. | |
Variables | |
| tarch::logging::Log | _log |
| void mghype::matrixfree::solvers::dgcgcoupling::computeAndRestrictHierarchicalResidual | ( | const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, TwoPowerD *CGSolver::VertexUnknowns, double > & | prolongationMatrix, |
| const tarch::la::Matrix< TwoPowerD *CGSolver::VertexUnknowns, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | restrictionMatrix, | ||
| const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | massMatrix, | ||
| const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | systemMatrix, | ||
| const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | dgSolution, | ||
| const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | dgRhs, | ||
| auto & | cgVertices | ||
| ) |
| void mghype::matrixfree::solvers::dgcgcoupling::computeAndRestrictResidual | ( | const tarch::la::Matrix< TwoPowerD *CGSolver::VertexUnknowns, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | restrictionMatrix, |
| const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | massMatrix, | ||
| const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | systemMatrix, | ||
| const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | dgSolution, | ||
| const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | dgRhs, | ||
| const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | faceSolutions, | ||
| auto & | cgVertices | ||
| ) |
| tarch::la::Vector< TwoPowerD *CGSolver::VertexUnknowns, double > mghype::matrixfree::solvers::dgcgcoupling::getCoarseGridSolution | ( | auto & | cgVertices | ) |
Get the vector of course grid solutions.
| void mghype::matrixfree::solvers::dgcgcoupling::injectSolution | ( | const tarch::la::Matrix< TwoPowerD *CGSolver::VertexUnknowns, DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | injectionMatrix, |
| const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | dgSolution, | ||
| auto & | cgVertices | ||
| ) |
constexpr int Rows = TwoPowerD * {{CG_SOLVER_NAME}}::VertexUnknowns;
constexpr int Cols = {{DG_SOLVER_NAME}}NodesPerCell * {{DG_SOLVER_NAME}}UnknownsPerCellNode;
| injectionMatrix | Of type tarch::la::Matrix< Rows, Cols, double > where the constraints above are given on Rows and Cols, i.e. they have to match the other types. |
| tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > mghype::matrixfree::solvers::dgcgcoupling::prolongate | ( | const tarch::la::Matrix< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, TwoPowerD *CGSolver::VertexUnknowns, double > & | prolongationMatrix, |
| const tarch::la::Vector< DGSolver::NodesPerCell *DGSolver::UnknownsPerCellNode, double > & | dgSolution, | ||
| const auto & | cgVertices | ||
| ) |
| void mghype::matrixfree::solvers::dgcgcoupling::rollOverAndPrepareCGVertex | ( | auto & | vertex, |
| bool | restrictRhsAndInjectSolution, | ||
| bool | fas | ||
| ) |
Apply updates from previous mesh sweep in multigrid sense and prepare for next correction step.
This routine runs through a couple of steps which are required for any correction mesh sweep. We assume that a vertex holds the following fields:
First and foremost, we need a case distinction: If a vertex is outside or if we don't have any valid restricted data, then we cannot realise any data flow from fine to coarse, coarse to fine or only from one iteration to the other. It makes no sense. So, in this case, we just set everything zero. We rely on the fact that the counter NumberOfRestrictions will hold invalid values for the outer vertices - typically 0.
Boundary vertices do not really require special treatment. The only important thing in a multigrid sense is that the delta at the boundary point is zero. In a correction scheme, we'd furthermore fix them to homogeneous Dirichlet values, but as we typically favour FAS we take the injected value. We can identify boundary values as the number of restrictions there is smaller than \( 2^ \).
In the very first sweep, we reset the right-hand side, as we don't know its value yet.
To prepare of for the next mesh sweep, we reset the restriction and accumulation variables:
It does not hurt if we do this for outer or boundary vertices, so we simply do it everywhere.
Updates: Align this docu later. We need this function to do two things: send newRestrictedRhs -> rhs on the CG vertices before solving on the CG vertices
We also need it to send the CG solution into the delta field, so that we interpolate it correctly before the DG step.
So we transform this function using restrictRhsAndInjectSolution.
| restrictRhsAndInjectSolution | Flag to control the behaviour that allows us to use this routine in different context such as additive vs multiplicative MG or schemes with multiple coarse grid sweeps. If the flag is true, then we are about to start CG, and we can set value <- 0, rhs <- newRestrictedRhs. delta <- 0. This works because we use touchCellLastTime during DGCGCoupling to set the newRestrictedRhs at the final stage of the DG solver. If the flag is false, then we are starting DG, so we can erase newRestrictedRhs, but more importantly set delta so that we can interpolate against this in touchCellFirstTime of the DGCGCoupling stage. |
| void mghype::matrixfree::solvers::dgcgcoupling::updateRestrictionCounters | ( | auto & | vertices | ) |
Restrict counters.
This routine is typically invoked by touchCellLastTime(). We run through the \( 2^d \) adjacent vertices of a cell and increment each of its restriction counters by one. Some sanity checks ensure they hold valid data.
The standard invocation of this routine resembles
| vertices | Instance of Peano's VertexEnumerator. |
|
extern |