From 6b9b0e8c2e9013cec72b31c2ece2438edd0663df Mon Sep 17 00:00:00 2001 From: kronbichler Date: Mon, 21 Sep 2009 09:28:28 +0000 Subject: [PATCH] Revert accidental check-in. git-svn-id: https://svn.dealii.org/trunk@19487 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-38/step-38.cc | 4 +-- deal.II/examples/step-5/step-5.cc | 46 +++++++++++++---------------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/deal.II/examples/step-38/step-38.cc b/deal.II/examples/step-38/step-38.cc index 753f24868e..2e79616d83 100644 --- a/deal.II/examples/step-38/step-38.cc +++ b/deal.II/examples/step-38/step-38.cc @@ -1541,7 +1541,7 @@ void DGMethod::run () { GridGenerator::hyper_cube (triangulation); - triangulation.refine_global (5); + triangulation.refine_global (3); } else refine_grid (); @@ -1599,7 +1599,7 @@ void DGMethod::run () // two solutions for equality. solution1-=solution2; const double difference=solution1.linfty_norm(); - if (difference>1e-12) + if (difference>1e-13) std::cout << "solution1 and solution2 differ!!" << std::endl; else std::cout << "solution1 and solution2 coincide." << std::endl; diff --git a/deal.II/examples/step-5/step-5.cc b/deal.II/examples/step-5/step-5.cc index 50ab262717..86d3b720c5 100644 --- a/deal.II/examples/step-5/step-5.cc +++ b/deal.II/examples/step-5/step-5.cc @@ -73,12 +73,12 @@ using namespace dealii; // setup_system. Apart from this, // everything is as before. template -class LaplaceProblem +class LaplaceProblem { public: LaplaceProblem (); void run (); - + private: void setup_system (); void assemble_system (); @@ -125,14 +125,14 @@ class LaplaceProblem // here just as in the previous // example. template -class Coefficient : public Function +class Coefficient : public Function { public: Coefficient () : Function() {} - + virtual double value (const Point &p, const unsigned int component = 0) const; - + virtual void value_list (const std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -154,7 +154,7 @@ class Coefficient : public Function // after all): template double Coefficient::value (const Point &p, - const unsigned int /*component*/) const + const unsigned int /*component*/) const { if (p.square() < 0.5*0.5) return 20; @@ -271,9 +271,9 @@ double Coefficient::value (const Point &p, template void Coefficient::value_list (const std::vector > &points, std::vector &values, - const unsigned int component) const + const unsigned int component) const { - Assert (values.size() == points.size(), + Assert (values.size() == points.size(), ExcDimensionMismatch (values.size(), points.size())); // Since examples are not very good // if they do not demonstrate their @@ -295,7 +295,7 @@ void Coefficient::value_list (const std::vector > &points, // call stack to immediately find // the place where the the array // with the wrong size was set up. - + // While we're at it, we can do // another check: the coefficient // is a scalar, but the @@ -331,7 +331,7 @@ void Coefficient::value_list (const std::vector > &points, // of writing v.size()-1 in // many places, the range is // defined as half-open.) - Assert (component == 0, + Assert (component == 0, ExcIndexRange (component, 0, 1)); // The rest of the function is @@ -430,11 +430,11 @@ void LaplaceProblem::setup_system () // are completely unchanged from // before: template -void LaplaceProblem::assemble_system () -{ +void LaplaceProblem::assemble_system () +{ QGauss quadrature_formula(2); - FEValues fe_values (fe, quadrature_formula, + FEValues fe_values (fe, quadrature_formula, update_values | update_gradients | update_quadrature_points | update_JxW_values); @@ -540,7 +540,7 @@ void LaplaceProblem::assemble_system () coefficient.value_list (fe_values.get_quadrature_points(), coefficient_values); - + for (unsigned int q_point=0; q_point::assemble_system () } - cell->distribute_local_to_global (cell_rhs, system_rhs); - cell->distribute_local_to_global (cell_matrix, system_matrix); - /* cell->get_dof_indices (local_dof_indices); for (unsigned int i=0; i::assemble_system () system_matrix.add (local_dof_indices[i], local_dof_indices[j], cell_matrix(i,j)); - + system_rhs(local_dof_indices[i]) += cell_rhs(i); } - */ } // With the matrix so built, we use @@ -638,7 +634,7 @@ void LaplaceProblem::assemble_system () // declared, and the CG solver will // do the rest for us: template -void LaplaceProblem::solve () +void LaplaceProblem::solve () { SolverControl solver_control (1000, 1e-12); SolverCG<> cg (solver_control); @@ -820,7 +816,7 @@ void LaplaceProblem::output_results (const unsigned int cycle) const // this is the first cycle, however, // we first have to generate a mesh: template -void LaplaceProblem::run () +void LaplaceProblem::run () { for (unsigned int cycle=0; cycle<6; ++cycle) { @@ -910,7 +906,7 @@ void LaplaceProblem::run () // might be worth to show // what not to do, after // all. - + // So if we got past the // assertion, we know that // dim==2, and we can now @@ -987,7 +983,7 @@ void LaplaceProblem::run () // like the one in the previous // example, so we won't comment on it // further: -int main () +int main () { deallog.depth_console (0); @@ -1016,12 +1012,12 @@ int main () // Results section of the program // to see what happens when the // code is actually run: -/* +/* Coefficient<2> coefficient; std::vector > points (2); std::vector coefficient_values (1); coefficient.value_list (points, coefficient_values); */ - + return 0; } -- 2.39.5