std::shared_ptr<gko::matrix::Csr<ValueType, IndexType>> system_matrix;
/**
- * The execution paradigm as a string to be set by the user . The choices
+ * The execution paradigm as a string to be set by the user. The choices
* are between `omp`, `cuda` and `reference` and more details can be found
* in Ginkgo's documentation.
*/
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the CG solver from the CG factory which solves the
- * linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the CG solver from the CG factory which
+ * solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the CG solver.
*
- * @p exec_type The execution paradigm for the CG solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverCG(SolverControl & solver_control,
const std::string & exec_type,
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the CG solver from the CG factory which solves the
- * linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the CG solver from the CG factory which
+ * solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the CG solver.
*
- * @p exec_type The execution paradigm for the CG solver.
+ * @param[in] preconditioner The preconditioner for the solver.
*
- * @p preconditioner The preconditioner for the solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverCG(SolverControl & solver_control,
const std::string & exec_type,
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the Bicgstab solver from the Bicgstab factory which
- * solves the linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the Bicgstab solver from the Bicgstab
+ * factory which solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the Bicgstab solver.
*
- * @p exec_type The execution paradigm for the Bicgstab solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverBicgstab(SolverControl & solver_control,
const std::string & exec_type,
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the Bicgstab solver from the Bicgstab factory which
- * solves the linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the Bicgstab solver from the Bicgstab
+ * factory which solves the linear system.
*
- * @p exec_type The execution paradigm for the Bicgstab solver.
+ * @param[in] exec_type The execution paradigm for the Bicgstab solver.
*
- * @p preconditioner The preconditioner for the solver.
+ * @param[in] preconditioner The preconditioner for the solver.
+ *
+ * @param[in] data The additional data required by the solver.
*/
SolverBicgstab(SolverControl & solver_control,
const std::string & exec_type,
/**
* An implementation of the solver interface using the Ginkgo CGS solver.
*
+ * CGS or the conjugate gradient square method is an iterative type Krylov
+ * subspace method which is suitable for general systems.
+ *
* @ingroup GinkgoWrappers
*/
template <typename ValueType = double, typename IndexType = int32_t>
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the CGS solver from the CGS factory which solves the
- * linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the CGS solver from the CGS factory which
+ * solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the CGS solver.
*
- * @p exec_type The execution paradigm for the CGS solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverCGS(SolverControl & solver_control,
const std::string & exec_type,
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the CGS solver from the CGS factory which solves the
- * linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the CGS solver from the CGS factory which
+ * solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the CGS solver.
*
- * @p exec_type The execution paradigm for the CGS solver.
+ * @param[in] preconditioner The preconditioner for the solver.
*
- * @p preconditioner The preconditioner for the solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverCGS(SolverControl & solver_control,
const std::string & exec_type,
/**
* An implementation of the solver interface using the Ginkgo FCG solver.
*
+ * FCG or the flexible conjugate gradient method is an iterative type Krylov
+ * subspace method which is suitable for symmetric positive definite methods.
+ *
+ * Though this method performs very well for symmetric positive definite
+ * matrices, it is in general not suitable for general matrices.
+ *
+ * In contrast to the standard CG based on the Polack-Ribiere formula, the
+ * flexible CG uses the Fletcher-Reeves formula for creating the orthonormal
+ * vectors spanning the Krylov subspace. This increases the computational cost
+ * of every Krylov solver iteration but allows for non-constant
+ * preconditioners.
+ *
* @ingroup GinkgoWrappers
*/
template <typename ValueType = double, typename IndexType = int32_t>
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the FCG solver from the FCG factory which solves the
- * linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the FCG solver from the FCG factory which
+ * solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the FCG solver.
*
- * @p exec_type The execution paradigm for the FCG solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverFCG(SolverControl & solver_control,
const std::string & exec_type,
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the FCG solver from the FCG factory which solves the
- * linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the FCG solver from the FCG factory which
+ * solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the FCG solver.
*
- * @p exec_type The execution paradigm for the FCG solver.
+ * @param[in] preconditioner The preconditioner for the solver.
*
- * @p preconditioner The preconditioner for the solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverFCG(SolverControl & solver_control,
const std::string & exec_type,
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the GMRES solver from the GMRES factory which solves
- * the linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the GMRES solver from the GMRES factory
+ * which solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the GMRES solver.
*
- * @p exec_type The execution paradigm for the GMRES solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverGMRES(SolverControl & solver_control,
const std::string & exec_type,
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the GMRES solver from the GMRES factory which solves
- * the linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the GMRES solver from the GMRES factory
+ * which solves the linear system.
*
- * @p exec_type The execution paradigm for the GMRES solver.
+ * @param[in] exec_type The execution paradigm for the GMRES solver.
*
- * @p preconditioner The preconditioner for the solver.
+ * @param[in] preconditioner The preconditioner for the solver.
+ *
+ * @param[in] data The additional data required by the solver.
*/
SolverGMRES(SolverControl & solver_control,
const std::string & exec_type,
/**
* An implementation of the solver interface using the Ginkgo IR solver.
*
+ * Iterative refinement (IR) is an iterative method that uses another coarse
+ * method to approximate the error of the current solution via the current
+ * residual.
+ *
* @ingroup GinkgoWrappers
*/
template <typename ValueType = double, typename IndexType = int32_t>
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the IR solver from the IR factory which solves the
- * linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the IR solver from the IR factory which
+ * solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the IR solver.
*
- * @p exec_type The execution paradigm for the IR solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverIR(SolverControl & solver_control,
const std::string & exec_type,
/**
* Constructor.
*
- * @p solver_control The solver control object is then used to set the
- * parameters and setup the IR solver from the IR factory which solves the
- * linear system.
+ * @param[in,out] solver_control The solver control object is then used to
+ * set the parameters and setup the IR solver from the IR factory which
+ * solves the linear system.
+ *
+ * @param[in] exec_type The execution paradigm for the IR solver.
*
- * @p exec_type The execution paradigm for the IR solver.
+ * @param[in] inner_solver The Inner solver for the IR solver.
*
- * @p inner_solver The Inner solver for the IR solver.
+ * @param[in] data The additional data required by the solver.
*/
SolverIR(SolverControl & solver_control,
const std::string & exec_type,
}
else
{
- std::cerr
- << "exec_type needs to be one of the three strings: \"reference\", \"cuda\" or \"omp\", but provided with"
- << exec_type << std::endl;
- std::exit(-1);
+ Assert(
+ false,
+ ExcMessage(
+ " exec_type needs to be one of the three strings: \"reference\", \"cuda\" or \"omp\" "));
}
using ResidualCriterionFactory = gko::stop::ResidualNormReduction<>;
residual_criterion = ResidualCriterionFactory::build()
.on(executor);
}
+
+
template <typename ValueType, typename IndexType>
void
SolverBase<ValueType, IndexType>::initialize_ginkgo_log()
executor, gko::log::Logger::criterion_check_completed_mask);
}
+
+
template <typename ValueType, typename IndexType>
void
SolverBase<ValueType, IndexType>::apply(Vector<ValueType> & solution,
}
+
template <typename ValueType, typename IndexType>
SolverControl &
SolverBase<ValueType, IndexType>::control() const
}
+
template <typename ValueType, typename IndexType>
void
SolverBase<ValueType, IndexType>::initialize(
}
+
template <typename ValueType, typename IndexType>
void
SolverBase<ValueType, IndexType>::solve(const SparseMatrix<ValueType> &matrix,
}
- /* ---------------------- SolverCG ------------------------ */
+ /* ---------------------- SolverCG ------------------------ */
template <typename ValueType, typename IndexType>
SolverCG<ValueType, IndexType>::SolverCG(SolverControl & solver_control,
const std::string & exec_type,
cg::build().with_criteria(this->combined_factory).on(this->executor);
}
+
+
template <typename ValueType, typename IndexType>
SolverCG<ValueType, IndexType>::SolverCG(
SolverControl & solver_control,
}
- /* ---------------------- SolverBicgstab ------------------------ */
+ /* ---------------------- SolverBicgstab ------------------------ */
template <typename ValueType, typename IndexType>
SolverBicgstab<ValueType, IndexType>::SolverBicgstab(
SolverControl & solver_control,
.on(this->executor);
}
+
+
template <typename ValueType, typename IndexType>
SolverBicgstab<ValueType, IndexType>::SolverBicgstab(
SolverControl & solver_control,
.on(this->executor);
}
- /* ---------------------- SolverCGS ------------------------ */
+
+ /* ---------------------- SolverCGS ------------------------ */
template <typename ValueType, typename IndexType>
SolverCGS<ValueType, IndexType>::SolverCGS(SolverControl & solver_control,
const std::string &exec_type,
cgs::build().with_criteria(this->combined_factory).on(this->executor);
}
+
+
template <typename ValueType, typename IndexType>
SolverCGS<ValueType, IndexType>::SolverCGS(
SolverControl & solver_control,
.on(this->executor);
}
- /* ---------------------- SolverFCG ------------------------ */
+
+ /* ---------------------- SolverFCG ------------------------ */
template <typename ValueType, typename IndexType>
SolverFCG<ValueType, IndexType>::SolverFCG(SolverControl & solver_control,
const std::string &exec_type,
fcg::build().with_criteria(this->combined_factory).on(this->executor);
}
+
+
template <typename ValueType, typename IndexType>
SolverFCG<ValueType, IndexType>::SolverFCG(
SolverControl & solver_control,
.on(this->executor);
}
- /* ---------------------- SolverGMRES ------------------------ */
+
+ /* ---------------------- SolverGMRES ------------------------ */
template <typename ValueType, typename IndexType>
SolverGMRES<ValueType, IndexType>::AdditionalData::AdditionalData(
const unsigned int restart_parameter)
: restart_parameter(restart_parameter)
{}
+
+
template <typename ValueType, typename IndexType>
SolverGMRES<ValueType, IndexType>::SolverGMRES(SolverControl &solver_control,
const std::string &exec_type,
.on(this->executor);
}
+
+
template <typename ValueType, typename IndexType>
SolverGMRES<ValueType, IndexType>::SolverGMRES(
SolverControl & solver_control,
.on(this->executor);
}
- /* ---------------------- SolverIR ------------------------ */
+
+ /* ---------------------- SolverIR ------------------------ */
template <typename ValueType, typename IndexType>
SolverIR<ValueType, IndexType>::SolverIR(SolverControl & solver_control,
const std::string & exec_type,
ir::build().with_criteria(this->combined_factory).on(this->executor);
}
+
+
template <typename ValueType, typename IndexType>
SolverIR<ValueType, IndexType>::SolverIR(
SolverControl & solver_control,
.on(this->executor);
}
+
+
// Explicit instantiations in GinkgoWrappers
# define DEALII_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(_macro) \
template _macro(float, int32_t); \