// before solving we scale the
// initial solution to the right
// dimensions
- distributed_stokes_solution.block(1) /= EquationData::MaterialModel::pressure_scaling;
+ distributed_stokes_solution.block(1) /= EquationData::pressure_scaling;
const unsigned int
// step 1: try if the simple and fast solver
// succeeds in 30 steps or less.
unsigned int n_iterations = 0;
- double reduction = 0;
const double solver_tolerance = 1e-7 * stokes_rhs.l2_norm();
SolverControl solver_control (30, solver_tolerance);
preconditioner);
n_iterations = solver_control.last_step();
- reduction = solver_control.last_value()/solver_control.initial_value();
}
// step 2: take the stronger solver in case
n_iterations = (solver_control.last_step() +
solver_control_refined.last_step());
- reduction = (solver_control_refined.last_value()/
- std::max(solver_control.initial_value(),
- solver_control_refined.initial_value()));
}
// now rescale the pressure
// back to real physical units
- distributed_stokes_solution.block(1) *= EquationData::MaterialModel::pressure_scaling;
+ distributed_stokes_solution.block(1) *= EquationData::pressure_scaling;
stokes_solution.block(0).reinit(distributed_stokes_solution.block(0),
false, true);
false, true);
pcout << n_iterations << " iterations."
- << " Reduced residual by " << reduction
<< std::endl;
-
- TrilinosWrappers::MPI::Vector tmp;
- tmp.reinit (stokes_rhs.block(1));
- pcout << " Relative divergence residual: "
- << stokes_matrix.block(1,0).residual (tmp,
- distributed_stokes_solution.block(0),
- stokes_rhs.block(1))
- /
- distributed_stokes_solution.block(0).l2_norm() / EquationData::pressure_scaling
- << std::endl;
-
- pcout << " Relative vector sizes: "
- << distributed_stokes_solution.block(0).linfty_norm() << ' '
- << distributed_stokes_solution.block(1).linfty_norm() << std::endl;
}
computing_timer.exit_section();