// which stops the iteration:
SolverControl solver_control(1000, 1e-12);
// Then we need the solver itself. The template parameter to the SolverCG
- // class is the type of the vectors, but the empty angle brackets indicate
- // that we simply take the default argument (which is
- // <code>Vector@<double@></code>):
+ // class is the type of the vectors, and leaving the empty angle brackets
+ // would indicate that we are taking the default argument (which is
+ // <code>Vector@<double@></code>). However, we explicitly mention the template
+ // argument:
SolverCG<Vector<double>> solver(solver_control);
// Now solve the system of equations. The CG solver takes a preconditioner
HelmholtzProblem(const FiniteElement<dim> &fe,
const RefinementMode refinement_mode);
- ~HelmholtzProblem();
-
void run();
private:
{}
- // @sect4{HelmholtzProblem::~HelmholtzProblem destructor}
-
- // This is no different than before:
- template <int dim>
- HelmholtzProblem<dim>::~HelmholtzProblem()
- {
- dof_handler.clear();
- }
-
-
// @sect4{HelmholtzProblem::setup_system}
// The following function sets up the degrees of freedom, sizes of matrices
// Note that the operations we will do with the right hand side object are
// only querying data, never changing the object. We can therefore declare
// it <code>const</code>:
- RightHandSide<dim> right_hand_side;
- std::vector<double> rhs_values(n_q_points);
+ const RightHandSide<dim> right_hand_side;
+ std::vector<double> rhs_values(n_q_points);
// Finally we define an object denoting the exact solution function. We
// will use it to compute the Neumann values at the boundary from