Go to the documentation of this file.
21 #ifndef THUNDEREGG_GMG_CYCLE_H
22 #define THUNDEREGG_GMG_CYCLE_H
46 std::shared_ptr<const Level<D>> finest_level;
83 : finest_level(new
Level<D>(finest_level))
97 visit(*finest_level, f, u);
106 extern template class Cycle<2>;
107 extern template class Cycle<3>;
virtual void visit(const Level< D > &level, const Vector< D > &f, Vector< D > &u) const =0
Virtual visit function that needs to be implemented in derived classes.
void scaleThenAdd(double alpha, const Vector< D > &b)
this = alpha * this + b
Definition: Vector.h:509
const Level< D > & getFinestLevel() const
Get the finest Level.
Definition: Cycle.h:104
const Operator< D > & getOperator() const
Get the operator for this level.
Definition: Level.h:120
void apply(const Vector< D > &f, Vector< D > &u) const
Run one iteration of the cycle.
Definition: Cycle.h:94
Cycle(const Level< D > &finest_level)
Create new cycle object.
Definition: Cycle.h:82
const Restrictor< D > & getRestrictor() const
Get the restriction operator for this level.
Definition: Level.h:81
void setWithGhost(double alpha)
set all values in the vector (including ghost cells)
Definition: Vector.h:404
Base abstract class for cycles.
Definition: Cycle.h:40
Base class for operators.
Definition: Operator.h:37
Represents a level in geometric multi-grid.
Definition: Level.h:38
Vector class for use in thunderegg.
Definition: Vector.h:42
Vector< D > getZeroClone() const
Get a vector of the same length initialized to zero.
Definition: Vector.h:601
Vector< D > restrict(const Level< D > &level, const Vector< D > &f, const Vector< D > &u) const
Prepare vectors for coarser level.
Definition: Cycle.h:57
Geometric-Multigrid classes.
Definition: Cycle.h:33