const mg_solver coarse_solver,
const unsigned int n_unknowns_coarse_level,
const unsigned int max_iter,
- const mg_cycle cycle,
+ const mg_cycle cycle,
const mg_interpolation interpolation,
const double coupling_strength,
const double relaxation_parameter,
- const double over_interpolation)
+ const double over_interpolation)
:
verbose(verbose),
coarse_solver(coarse_solver),
{
// Downcast the preconditioner pointer
paralution::AMG<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number>* downcasted_ptr = static_cast<paralution::AMG<paralution::
- LocalMatrix<Number>,paralution::LocalVector<Number>,Number>* >(this->preconditioner.get());
+ Number>* downcasted_ptr = static_cast<paralution::AMG<paralution::
+ LocalMatrix<Number>,paralution::LocalVector<Number>,Number>* >(this->preconditioner.get());
// Set the maximum number of iterations.
downcasted_ptr->InitMaxIter(additional_data.max_iter);
// Set the interpolation type.
switch (additional_data.interpolation)
- {
+ {
case aggregation :
- {
- downcasted_ptr->SetInterpolation(paralution::Aggregation);
- downcasted_ptr->SetOverInterp(additional_data.over_interpolation);
- break;
- }
+ {
+ downcasted_ptr->SetInterpolation(paralution::Aggregation);
+ downcasted_ptr->SetOverInterp(additional_data.over_interpolation);
+ break;
+ }
case smoothed_aggregation :
- {
- downcasted_ptr->SetInterpolation(paralution::SmoothedAggregation);
- downcasted_ptr->SetInterpRelax(additional_data.relaxation_parameter);
- break;
- }
+ {
+ downcasted_ptr->SetInterpolation(paralution::SmoothedAggregation);
+ downcasted_ptr->SetInterpRelax(additional_data.relaxation_parameter);
+ break;
+ }
default :
- {
- AssertThrow(false,ExcMessage("Unknown interpolation type for PreconditionAMG."));
- }
- }
+ {
+ AssertThrow(false,ExcMessage("Unknown interpolation type for PreconditionAMG."));
+ }
+ }
// Set the coupling strength
downcasted_ptr->SetCouplingStrength(additional_data.coupling_strength);
// Set the type of cycle
switch (additional_data.cycle)
- {
+ {
case V_cycle :
- {
- downcasted_ptr->SetCycle(paralution::Vcycle);
- break;
- }
+ {
+ downcasted_ptr->SetCycle(paralution::Vcycle);
+ break;
+ }
case W_cycle :
- {
- downcasted_ptr->SetCycle(paralution::Wcycle);
- break;
- }
+ {
+ downcasted_ptr->SetCycle(paralution::Wcycle);
+ break;
+ }
case K_cycle :
- {
- downcasted_ptr->SetCycle(paralution::Kcycle);
- break;
- }
+ {
+ downcasted_ptr->SetCycle(paralution::Kcycle);
+ break;
+ }
case F_cycle :
- {
- downcasted_ptr->SetCycle(paralution::Fcycle);
- }
+ {
+ downcasted_ptr->SetCycle(paralution::Fcycle);
+ }
default :
- {
- AssertThrow(false,ExcMessage("Unknown cycle type for PreconditionAMG."));
- }
- }
+ {
+ AssertThrow(false,ExcMessage("Unknown cycle type for PreconditionAMG."));
+ }
+ }
// Use manual coarse grid solver.
downcasted_ptr->SetManualSolver(true);
// Coarse solver
switch (additional_data.coarse_solver)
- {
+ {
case richardson :
- {
- paralution::FixedPoint<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::FixedPoint<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::FixedPoint<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::FixedPoint<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case cg :
- {
- paralution::CG<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::CG<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::CG<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::CG<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case cr :
- {
- paralution::CR<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::CR<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::CR<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::CR<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case bicgstab :
- {
- paralution::BiCGStab<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::BiCGStab<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::BiCGStab<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::BiCGStab<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case gmres :
- {
- paralution::GMRES<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::GMRES<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::GMRES<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::GMRES<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case fgmres :
- {
- paralution::FGMRES<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::FGMRES<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::FGMRES<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::FGMRES<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
default :
- {
- AssertThrow(false,ExcMessage("Unknown coarse solver for PreconditionAMG."));
- }
- }
+ {
+ AssertThrow(false,ExcMessage("Unknown coarse solver for PreconditionAMG."));
+ }
+ }
// Set the coarse solver and the verbosity of the coarse solver.
coarse_solver->Verbose(additional_data.verbose);
- SolverControl& SolverBase::control() const
+ SolverControl &SolverBase::control() const
{
return solver_control;
}
// Let the deal.II SolverControl object know what has happened. If the solve
// succeeded, the status of the solver control will turn into
// SolverControl::success. solver_control only exists on the host so the solver
- // needs to be on the most.
+ // needs to be on the most.
solver->MoveToHost();
solver_control.check (solver->GetIterationCount(), solver->GetCurrentResidual());
// Set the system to solve.
solver.SetOperator(A.paralution_matrix());
solver.SetOperatorFormat(CSR);
-
+
// Set the verbosity of the multigrid.
solver.Verbose(additional_data.verbose);
-
+
// Set number of unknowns on coarsest level.
solver.SetCoarsestLevel(additional_data.n_unknowns_coarse_level);
// Set the interpolation type.
switch (additional_data.interpolation)
- {
+ {
case aggregation :
- {
- solver.SetInterpolation(paralution::Aggregation);
- solver.SetOverInterp(additional_data.over_interpolation);
- break;
- }
+ {
+ solver.SetInterpolation(paralution::Aggregation);
+ solver.SetOverInterp(additional_data.over_interpolation);
+ break;
+ }
case smoothed_aggregation :
- {
- solver.SetInterpolation(paralution::SmoothedAggregation);
- solver.SetInterpRelax(additional_data.relaxation_parameter);
- break;
- }
+ {
+ solver.SetInterpolation(paralution::SmoothedAggregation);
+ solver.SetInterpRelax(additional_data.relaxation_parameter);
+ break;
+ }
default :
- {
- AssertThrow(false,ExcMessage("Unknown interpolation type for PreconditionAMG."));
- }
- }
+ {
+ AssertThrow(false,ExcMessage("Unknown interpolation type for PreconditionAMG."));
+ }
+ }
// Set the coupling strength.
solver.SetCouplingStrength(additional_data.coupling_strength);
// Set the type of cycle
switch (additional_data.cycle)
- {
+ {
case V_cycle :
- {
- solver.SetCycle(paralution::Vcycle);
- break;
- }
+ {
+ solver.SetCycle(paralution::Vcycle);
+ break;
+ }
case W_cycle :
- {
- solver.SetCycle(paralution::Wcycle);
- break;
- }
+ {
+ solver.SetCycle(paralution::Wcycle);
+ break;
+ }
case K_cycle :
- {
- solver.SetCycle(paralution::Kcycle);
- break;
- }
+ {
+ solver.SetCycle(paralution::Kcycle);
+ break;
+ }
case F_cycle :
- {
- solver.SetCycle(paralution::Fcycle);
- }
+ {
+ solver.SetCycle(paralution::Fcycle);
+ }
default :
- {
- AssertThrow(false,ExcMessage("Unknown cycle type for PreconditionAMG."));
- }
- }
-
+ {
+ AssertThrow(false,ExcMessage("Unknown cycle type for PreconditionAMG."));
+ }
+ }
+
// Manual smoothers
solver.SetManualSmoothers(true);
-
+
// Manual course grid solver
solver.SetManualSolver(true);
-
+
// Set grid transfer scaling
solver.SetScaling(true);
// Smoother for each level
paralution::IterativeLinearSolver<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number> **smoothers = NULL;
+ paralution::LocalVector<Number>,Number> **smoothers = NULL;
smoothers = new paralution::IterativeLinearSolver<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>* [n_levels-1];
+ paralution::LocalVector<Number>,Number>* [n_levels-1];
// Preconditioner for each smoother
paralution::Preconditioner<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number> **preconds = NULL;
+ paralution::LocalVector<Number>,Number> **preconds = NULL;
preconds = new paralution::Preconditioner<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>* [n_levels-1];
+ paralution::LocalVector<Number>,Number>* [n_levels-1];
// Coarse Grid Solver
paralution::IterativeLinearSolver<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number> *coarse_solver;
+ paralution::LocalVector<Number>,Number> *coarse_solver;
// Smoother
switch (additional_data.smoother)
- {
+ {
case richardson :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::FixedPoint<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number> *richardson = NULL;
+ paralution::LocalVector<Number>,Number> *richardson = NULL;
richardson = new paralution::FixedPoint<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>;
+ paralution::LocalVector<Number>,Number>;
smoothers[i] = richardson;
smoothers[i]->Verbose(additional_data.verbose);
}
- break;
- }
+ break;
+ }
case cg :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::CG<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *cg = NULL;
+ Number> *cg = NULL;
cg = new paralution::CG<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number>;
+ Number>;
smoothers[i] = cg;
smoothers[i]->Verbose(additional_data.verbose);
}
- break;
- }
+ break;
+ }
case cr :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::CR<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *cr = NULL;
+ Number> *cr = NULL;
cr = new paralution::CR<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number>;
+ Number>;
smoothers[i] = cr;
smoothers[i]->Verbose(additional_data.verbose);
}
- break;
- }
+ break;
+ }
case bicgstab :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::BiCGStab<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *bicgstab = NULL;
+ Number> *bicgstab = NULL;
bicgstab = new paralution::BiCGStab<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>;
+ paralution::LocalVector<Number>,Number>;
smoothers[i] = bicgstab;
smoothers[i]->Verbose(additional_data.verbose);
}
- break;
- }
+ break;
+ }
case gmres :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::GMRES<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *gmres = NULL;
+ Number> *gmres = NULL;
gmres = new paralution::GMRES<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>;
+ paralution::LocalVector<Number>,Number>;
smoothers[i] = gmres;
smoothers[i]->Verbose(additional_data.verbose);
}
- break;
- }
+ break;
+ }
case fgmres :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::FGMRES<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *fgmres = NULL;
+ Number> *fgmres = NULL;
fgmres = new paralution::FGMRES<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>;
+ paralution::LocalVector<Number>,Number>;
smoothers[i] = fgmres;
smoothers[i]->Verbose(additional_data.verbose);
}
- break;
- }
+ break;
+ }
default :
- {
- AssertThrow(false,ExcMessage("Unknown smoother for AMG."));
- }
- }
+ {
+ AssertThrow(false,ExcMessage("Unknown smoother for AMG."));
+ }
+ }
// Preconditioner
switch (additional_data.preconditioner)
- {
+ {
case jacobi :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::Jacobi<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *jacobi = NULL;
+ Number> *jacobi = NULL;
jacobi = new paralution::Jacobi<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>;
+ paralution::LocalVector<Number>,Number>;
preconds[i] = jacobi;
smoothers[i]->SetPreconditioner(*preconds[i]);
}
- break;
- }
+ break;
+ }
case sgs :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::SGS<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *sgs = NULL;
+ Number> *sgs = NULL;
sgs = new paralution::SGS<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number>;
+ Number>;
preconds[i] = sgs;
smoothers[i]->SetPreconditioner(*preconds[i]);
}
- break;
- }
+ break;
+ }
case multicolored_sgs :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::MultiColoredSGS<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *multicolored_sgs = NULL;
+ Number> *multicolored_sgs = NULL;
multicolored_sgs = new paralution::MultiColoredSGS<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>;
+ paralution::LocalVector<Number>,Number>;
multicolored_sgs->SetPrecondMatrixFormat(ELL);
preconds[i] = multicolored_sgs;
smoothers[i]->SetPreconditioner(*preconds[i]);
}
- break;
- }
+ break;
+ }
case multicolored_sor :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::MultiColoredGS<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *multicolored_sor = NULL;
+ Number> *multicolored_sor = NULL;
multicolored_sor = new paralution::MultiColoredGS<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>;
+ paralution::LocalVector<Number>,Number>;
multicolored_sor->SetPrecondMatrixFormat(ELL);
preconds[i] = multicolored_sor;
smoothers[i]->SetPreconditioner(*preconds[i]);
}
- break;
- }
+ break;
+ }
case ilu :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::ILU<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *ilu = NULL;
+ Number> *ilu = NULL;
ilu = new paralution::ILU<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number>;
+ Number>;
preconds[i] = ilu;
smoothers[i]->SetPreconditioner(*preconds[i]);
}
- break;
- }
+ break;
+ }
case ilut :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::ILUT<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *ilut = NULL;
+ Number> *ilut = NULL;
ilut = new paralution::ILUT<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>;
+ paralution::LocalVector<Number>,Number>;
preconds[i] = ilut;
smoothers[i]->SetPreconditioner(*preconds[i]);
}
- break;
- }
+ break;
+ }
case multicolored_ilu :
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
{
paralution::MultiColoredILU<paralution::LocalMatrix<Number>,paralution::LocalVector<Number>,
- Number> *multicolored_ilu = NULL;
+ Number> *multicolored_ilu = NULL;
multicolored_ilu = new paralution::MultiColoredILU<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>,Number>;
+ paralution::LocalVector<Number>,Number>;
multicolored_ilu->SetPrecondMatrixFormat(ELL);
preconds[i] = multicolored_ilu;
smoothers[i]->SetPreconditioner(*preconds[i]);
}
- break;
- }
+ break;
+ }
default :
- {
- AssertThrow(false,ExcMessage("Unknown preconditioner for the smoother for AMG."));
- }
- }
+ {
+ AssertThrow(false,ExcMessage("Unknown preconditioner for the smoother for AMG."));
+ }
+ }
// Set the smoothers.
solver.SetSmoother(smoothers);
// Coarse solver
switch (additional_data.coarse_solver)
- {
+ {
case richardson :
- {
- paralution::FixedPoint<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::FixedPoint<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::FixedPoint<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::FixedPoint<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case cg :
- {
- paralution::CG<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::CG<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::CG<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::CG<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case cr :
- {
- paralution::CR<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::CR<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::CR<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::CR<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case bicgstab :
- {
- paralution::BiCGStab<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::BiCGStab<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::BiCGStab<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::BiCGStab<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case gmres :
- {
- paralution::GMRES<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::GMRES<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::GMRES<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::GMRES<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
case fgmres :
- {
- paralution::FGMRES<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
- Number> *cs = new paralution::FGMRES<paralution::LocalMatrix<Number>,
- paralution::LocalVector<Number>, Number>;
- coarse_solver = cs;
- break;
- }
+ {
+ paralution::FGMRES<paralution::LocalMatrix<Number>, paralution::LocalVector<Number>,
+ Number> *cs = new paralution::FGMRES<paralution::LocalMatrix<Number>,
+ paralution::LocalVector<Number>, Number>;
+ coarse_solver = cs;
+ break;
+ }
default :
- {
- AssertThrow(false,ExcMessage("Unknown coarse solver for PreconditionAMG."));
- }
- }
+ {
+ AssertThrow(false,ExcMessage("Unknown coarse solver for PreconditionAMG."));
+ }
+ }
solver.SetSolver(*coarse_solver);
// Set absolute tolerance, relative tolerance, divergence tolerance,
// Let the deal.II SolverControl object know what has happened. If the solve
// succeeded, the status of the solver control will turn into
// SolverControl::success. solver_control only exists on the host so the solver
- // needs to be on the most.
+ // needs to be on the most.
solver.MoveToHost();
solver_control.check (solver.GetIterationCount(), solver.GetCurrentResidual());
// Free the coarse solver, the preconditioners and the smoothers.
if (coarse_solver!=NULL)
- {
- delete coarse_solver;
- coarse_solver = NULL;
- }
+ {
+ delete coarse_solver;
+ coarse_solver = NULL;
+ }
if (preconds!=NULL)
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
- delete [] preconds[i];
- delete [] preconds;
- preconds = NULL;
- }
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
+ delete [] preconds[i];
+ delete [] preconds;
+ preconds = NULL;
+ }
if (smoothers!=NULL)
- {
- for (unsigned int i=0; i<n_levels-1; ++i)
- delete [] smoothers[i];
- delete [] smoothers;
- smoothers = NULL;
- }
+ {
+ for (unsigned int i=0; i<n_levels-1; ++i)
+ delete [] smoothers[i];
+ delete [] smoothers;
+ smoothers = NULL;
+ }
}
- SolverControl& SolverAMG::control() const
+ SolverControl &SolverAMG::control() const
{
return solver_control;
}