// been covered in previous examples
// and will thus not be further
// commented on.
-#include <base/quadrature_lib.h>
-#include <base/function.h>
-#include <base/logstream.h>
-#include <lac/vector.h>
-#include <lac/full_matrix.h>
-#include <lac/sparse_matrix.h>
-#include <lac/compressed_sparsity_pattern.h>
-#include <lac/solver_cg.h>
-#include <lac/solver_gmres.h>
-#include <lac/precondition.h>
-#include <grid/tria.h>
-#include <dofs/dof_handler.h>
-#include <grid/grid_generator.h>
-#include <grid/tria_accessor.h>
-#include <grid/tria_iterator.h>
-#include <grid/tria_boundary_lib.h>
-#include <dofs/dof_accessor.h>
-#include <dofs/dof_tools.h>
-#include <fe/fe_values.h>
-#include <numerics/vectors.h>
-#include <numerics/matrices.h>
-#include <numerics/data_out.h>
-
-#include "constrained_matrix.h"
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/base/function.h>
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/vector.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/sparse_matrix.h>
+#include <deal.II/lac/compressed_sparsity_pattern.h>
+#include <deal.II/lac/solver_cg.h>
+#include <deal.II/lac/precondition.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/dofs/dof_accessor.h>
+#include <deal.II/dofs/dof_tools.h>
+#include <deal.II/fe/fe_values.h>
+#include <deal.II/numerics/vectors.h>
+#include <deal.II/numerics/matrices.h>
+#include <deal.II/numerics/data_out.h>
+
#include <fstream>
#include <iostream>
// tri-linear elements, but we will
// now use it for bi-quadratic
// elements:
-#include <fe/fe_q.h>
+#include <deal.II/fe/fe_q.h>
// We will not read the grid from a
// file as in the previous example,
// but generate it using a function
// the solution) in each step, so we
// need the following include file
// instead of <code>grid_in.h</code>:
-#include <grid/grid_out.h>
+#include <deal.II/grid/grid_out.h>
// When using locally refined grids,
// following file contains a class
// which is used to handle these
// constraints:
-#include <lac/constraint_matrix.h>
+#include <deal.II/lac/constraint_matrix.h>
// In order to refine our grids
// locally, we need a function from
// coarsening based on the error
// indicators we have computed. This
// function is defined here:
-#include <grid/grid_refinement.h>
+#include <deal.II/grid/grid_refinement.h>
// Finally, we need a simple way to
// actually compute the refinement
// often yields quite nicely adapted
// grids for a wide class of
// problems.
-#include <numerics/error_estimator.h>
+#include <deal.II/numerics/error_estimator.h>
// Finally, this is as in previous
// programs:
// constraints due to hanging
// nodes. This is done using the
// following two function calls:
- // hanging_node_constraints.condense (system_matrix);
- // hanging_node_constraints.condense (system_rhs);
-
+ hanging_node_constraints.condense (system_matrix);
+ hanging_node_constraints.condense (system_rhs);
// Using them, degrees of freedom
// associated to hanging nodes have
// been removed from the linear
template <int dim>
void Step6<dim>::solve ()
{
- SolverControl solver_control (10000, 1e-12);
- SolverGMRES<> solver (solver_control);
-
- PreconditionIdentity preconditioner;
-//preconditioner.initialize(system_matrix, 1.2);rGM
-
- double scaling = 10000;
- typename DoFHandler<dim>::active_cell_iterator
- cell=dof_handler.begin_active(),
- endc = dof_handler.end();
- for(; cell != endc; ++cell)
- scaling = std::min(scaling, cell->diameter()*cell->diameter());
+ SolverControl solver_control (1000, 1e-12);
+ SolverCG<> solver (solver_control);
- ConstrainedOperator<Vector<double>, SparseMatrix<double> >
- cc(system_matrix, hanging_node_constraints, scaling);
+ PreconditionSSOR<> preconditioner;
+ preconditioner.initialize(system_matrix, 1.2);
- // cc.distribute_rhs(system_rhs);
- solution = system_rhs;
- cc.distribute_rhs(system_rhs);
-
- solver.solve (cc, solution, system_rhs,
+ solver.solve (system_matrix, solution, system_rhs,
preconditioner);
+
+ hanging_node_constraints.distribute (solution);
}
GridOut grid_out;
grid_out.write_eps (triangulation, output);
-
- DataOut<dim> data_out;
-
- data_out.attach_dof_handler (dof_handler);
- data_out.add_data_vector (solution, "solution");
- data_out.build_patches ();
-
- filename = "solution-";
- filename += ('0' + cycle);
- filename += ".vtu";
- output.close();
- output.open(filename.c_str());
- data_out.write_vtu (output);
}
data_out.add_data_vector (solution, "solution");
data_out.build_patches ();
- std::ofstream output ("final-solution.vtk");
- data_out.write_vtk (output);
+ std::ofstream output ("final-solution.eps");
+ data_out.write_eps (output);
}