![]() |
KASKADE 7 development version
|
#include <qpmg.hh>
Public Types | |
| using | Self = QPMultiGridStrict<d,Prolongation,Real,Smoother,CoarseSmoother> |
| using | VectorX = Dune::BlockVector<Dune::FieldVector<Real,d>> |
| using | VectorB = Dune::BlockVector<Dune::FieldVector<Real,1>> |
| using | MatrixA = NumaBCRSMatrix<EntryA> |
| using | MatrixB = NumaBCRSMatrix<Dune::FieldMatrix<Real,1,d>> |
| using | SmootherType |
Public Member Functions | |
| QPMultiGridStrict (MatrixA const &A, MatrixB const &B, std::vector< Prolongation > &&prolongations, Real smootherRegularization=0, bool blocks=true, bool directOnCoarse=true) | |
| Constructs the solver, providing the matrices \( A \) and \( B \). | |
| ~QPMultiGridStrict () | |
| Destructor. | |
| std::tuple< VectorX, int > | solve (VectorX x, VectorX const &c, VectorB const &b, double tol, int vcycles) const |
| Approximately solves the QP for the given right hand side vectors up to a given tolerance. | |
| VectorX | step (VectorX const &x, VectorX c, VectorB b) const |
| Computes a single V-cycle correction for approximately solving the QP for the given right hand side vectors. | |
| Self & | setCoarseLevel (int coarselevel) |
| Defines the grid level to be used as coarse grid. | |
| Self & | setSmoothings (int pre, int post) |
| Self & | setCoarseCorrections (int n) |
| Sets the number of coarse corrections to compute and apply. | |
| Self & | setBulkMode (ParallelMode m) |
| Defines the smoothing strategy to use for unconstrained degrees of freedom. | |
| Self & | setLogger (MGSolverStatistics< d, Real > *logger) |
| Sets the logging facility for reporting solver statistics. | |
Static Public Attributes | |
| static constexpr bool | smoothersEqual = std::is_same<Smoother,CoarseSmoother>::value |
Protected Member Functions | |
| virtual double | computeEnergy (MatrixA const &A, MatrixB const &B, VectorX const &c, VectorB const &b, VectorX const &x) const |
| Compute the problem energy of current iterate for logging purposes. | |
| virtual std::tuple< VectorX, VectorB, int > | gradient (MatrixA const &A, MatrixB const &B, VectorX const &c, VectorB const &b, VectorX const &x) const |
| Computes the gradient of the (non-augmented) Lagrangian. | |
| virtual std::tuple< VectorX, VectorX, VectorX, VectorB, int > | gradient_extended (MatrixA const &A, MatrixB const &B, VectorX const &c, VectorB const &b, VectorX const &x) const |
| Computes the gradient of the (non-augmented) Lagrangian. | |
| virtual double | qpLinesearch (MatrixA const &A, MatrixB const &B, VectorX const &c, VectorB const &b, VectorX const &dx) const |
| Compute the optimal step size in direction of dx. | |
| MatrixB const & | B () const |
| Provides a reference to the fine grid constraints. | |
Protected Attributes | |
| std::vector< SmootherType > | smoothers |
|
inherited |
|
inherited |
| using Kaskade::QPMultiGridStrict< d, Prolongation, Real, Smoother, CoarseSmoother >::Self = QPMultiGridStrict<d,Prolongation,Real,Smoother,CoarseSmoother> |
|
inherited |
|
inherited |
|
inherited |
| Kaskade::QPMultiGridStrict< d, Prolongation, Real, Smoother, CoarseSmoother >::QPMultiGridStrict | ( | MatrixA const & | A, |
| MatrixB const & | B, | ||
| std::vector< Prolongation > && | prolongations, | ||
| Real | smootherRegularization = 0, | ||
| bool | blocks = true, | ||
| bool | directOnCoarse = true ) |
Constructs the solver, providing the matrices \( A \) and \( B \).
| A | the Hessian. The matrix is copied internally and need not exist after solver construction. |
| B | the constraints. The matrix is referenced internally and has to exist during the lifetime of the solver. |
| blocks |
|
| directOnCoarse |
|
| Kaskade::QPMultiGridStrict< d, Prolongation, Real, Smoother, CoarseSmoother >::~QPMultiGridStrict | ( | ) |
Destructor.
|
protectedinherited |
Provides a reference to the fine grid constraints.
|
protectedvirtual |
Compute the problem energy of current iterate for logging purposes.
Implements Kaskade::QPMultiGridBase< d, Prolongation, Smoother, CoarseSmoother, Real >.
|
protectedvirtual |
Computes the gradient of the (non-augmented) Lagrangian.
\[ g = Ax + c \]
Implements Kaskade::QPMultiGridBase< d, Prolongation, Smoother, CoarseSmoother, Real >.
|
protectedvirtual |
Computes the gradient of the (non-augmented) Lagrangian.
\[ g = Ax + c \]
\[ Ax + c + \gamma*B^T(Bx-b)_+ \]
\[ Ax \]
\[ \gamma*B^T(Bx-b)_+ \]
\[ (Bx-b)_+ \]
\[ | \{ i \colon (Bx-b)_i >= 0 \} | \]
Implements Kaskade::QPMultiGridBase< d, Prolongation, Smoother, CoarseSmoother, Real >.
|
protectedvirtual |
Compute the optimal step size in direction of dx.
Implements Kaskade::QPMultiGridBase< d, Prolongation, Smoother, CoarseSmoother, Real >.
|
inherited |
Defines the smoothing strategy to use for unconstrained degrees of freedom.
In contact problems, those are usually the interior nodes, and the ones without potential contact partner. The smoother can operate in parallel (Jacobi) or sequentially (Gauss-Seidel). In the parallel way, an exact linesearch is performed after the smoothing in order to guarantee descent.
|
inherited |
Sets the number of coarse corrections to compute and apply.
| n | number of coarse corrections |
|
inherited |
Defines the grid level to be used as coarse grid.
| coarselevel | the coarse grid level, between 0 and the max grid level |
If coarselevel is outside its allowed range, it is projected onto that range.
|
inherited |
Sets the logging facility for reporting solver statistics.
| logger | a pointer to the logger object. This can be a nullpointer, in which case logging is stopped. |
Ownership of the logger object remains with the caller. The logger object needs to exist for the lifetime of the QPMultiGrid class or until it is replaced by a different logger (or none).
|
inherited |
| std::tuple< VectorX, int > Kaskade::QPMultiGridStrict< d, Prolongation, Real, Smoother, CoarseSmoother >::solve | ( | VectorX | x, |
| VectorX const & | c, | ||
| VectorB const & | b, | ||
| double | tol, | ||
| int | vcycles ) const |
Approximately solves the QP for the given right hand side vectors up to a given tolerance.
| x | initial guess for the solution |
| c | linear objective term |
| b | constant constraint term |
| lambda | approximate multiplier |
| tol | tolerance |
|
inherited |
Computes a single V-cycle correction for approximately solving the QP for the given right hand side vectors.
| x | initial guess for the solution |
| c | linear objective term |
| b | constant constraint term |
|
protectedinherited |
|
staticconstexprinherited |