From: heltai Date: Tue, 11 Oct 2011 11:55:57 +0000 (+0000) Subject: Undo accidental changes on step-1, step-6 and step-34 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b391fefe5d112064551e6b41324a616e760f8bb2;p=dealii-svn.git Undo accidental changes on step-1, step-6 and step-34 git-svn-id: https://svn.dealii.org/trunk@24592 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-1/Makefile b/deal.II/examples/step-1/Makefile index b4c21ed325..084f822e9a 100644 --- a/deal.II/examples/step-1/Makefile +++ b/deal.II/examples/step-1/Makefile @@ -33,6 +33,8 @@ D = ../../ clean-up-files = *gmv *gnuplot *gpl *eps *pov *vtk *ucd *.d2 + + # # # Usually, you will not need to change anything beyond this point. @@ -43,41 +45,6 @@ clean-up-files = *gmv *gnuplot *gpl *eps *pov *vtk *ucd *.d2 # settings include $D/common/Make.global_options -CXX += -I$(VTK_DIR)/include/vtk-5.6 -LIBS += -L/usr/local/vtk/lib/vtk/ -I$(VTK_DIR)/include/vtk-5.6 \ --lvtkCharts \ --lvtkCommon \ --lvtkDICOMParser \ --lvtkFiltering \ --lvtkGenericFiltering \ --lvtkGeovis \ --lvtkGraphics \ --lvtkHybrid \ --lvtkIO \ --lvtkImaging \ --lvtkInfovis \ --lvtkNetCDF \ --lvtkRendering \ --lvtkViews \ --lvtkVolumeRendering \ --lvtkWidgets \ --lvtkalglib \ --lvtkexoIIc \ --lvtkexpat \ --lvtkfreetype \ --lvtkftgl \ --lvtkjpeg \ --lvtklibxml2 \ --lvtkmetaio \ --lvtkpng \ --lvtkproj4 \ --lvtksqlite \ --lvtksys \ --lvtktiff \ --lvtkverdict \ --lvtkzlib - - # Since the whole project consists of only one file, we need not # consider difficult dependencies. We only have to declare the diff --git a/deal.II/examples/step-34/parameters.prm b/deal.II/examples/step-34/parameters.prm index 03e374ec0a..5e12caf422 100644 --- a/deal.II/examples/step-34/parameters.prm +++ b/deal.II/examples/step-34/parameters.prm @@ -1,10 +1,10 @@ # Listing of Parameters # --------------------- set Extend solution on the -2,2 box = true -set External refinement = 7 +set External refinement = 5 set Number of cycles = 4 set Run 2d simulation = true -set Run 3d simulation = false +set Run 3d simulation = true subsection Exact solution 2d diff --git a/deal.II/examples/step-6/step-6.cc b/deal.II/examples/step-6/step-6.cc index 5401616f01..657a12ade4 100644 --- a/deal.II/examples/step-6/step-6.cc +++ b/deal.II/examples/step-6/step-6.cc @@ -16,30 +16,28 @@ // been covered in previous examples // and will thus not be further // commented on. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "constrained_matrix.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include @@ -53,7 +51,7 @@ // tri-linear elements, but we will // now use it for bi-quadratic // elements: -#include +#include // We will not read the grid from a // file as in the previous example, // but generate it using a function @@ -63,7 +61,7 @@ // the solution) in each step, so we // need the following include file // instead of grid_in.h: -#include +#include // When using locally refined grids, @@ -79,7 +77,7 @@ // following file contains a class // which is used to handle these // constraints: -#include +#include // In order to refine our grids // locally, we need a function from @@ -88,7 +86,7 @@ // coarsening based on the error // indicators we have computed. This // function is defined here: -#include +#include // Finally, we need a simple way to // actually compute the refinement @@ -100,7 +98,7 @@ // often yields quite nicely adapted // grids for a wide class of // problems. -#include +#include // Finally, this is as in previous // programs: @@ -617,9 +615,8 @@ void Step6::assemble_system () // 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 @@ -698,28 +695,16 @@ void Step6::assemble_system () template void Step6::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::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, SparseMatrix > - 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); } @@ -993,19 +978,6 @@ void Step6::output_results (const unsigned int cycle) const GridOut grid_out; grid_out.write_eps (triangulation, output); - - DataOut 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); } @@ -1118,8 +1090,8 @@ void Step6::run () 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); }