From: kayser-herold Date: Wed, 30 May 2007 03:29:22 +0000 (+0000) Subject: Added support for local condensation of hanging nodes instead X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ea7249bdde5426a56e18e2ac79df147bf61efa7;p=dealii-svn.git Added support for local condensation of hanging nodes instead of global condensation. git-svn-id: https://svn.dealii.org/trunk@14730 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-27/step-27.cc b/deal.II/examples/step-27/step-27.cc index 7e28967828..9436517529 100644 --- a/deal.II/examples/step-27/step-27.cc +++ b/deal.II/examples/step-27/step-27.cc @@ -26,6 +26,8 @@ #include #include #include +#include + #include #include #include @@ -53,6 +55,7 @@ #include + // Finally, this is as in previous // programs: using namespace dealii; @@ -61,7 +64,7 @@ template class LaplaceProblem { public: - LaplaceProblem (); + LaplaceProblem (const bool condense_glob = true); ~LaplaceProblem (); void run (); @@ -93,6 +96,7 @@ class LaplaceProblem Timer distr, condense, hang, assemble, solver; const unsigned int max_degree; + const bool condense_global; }; @@ -136,9 +140,10 @@ RightHandSide::value (const Point &p, template -LaplaceProblem::LaplaceProblem () : +LaplaceProblem::LaplaceProblem (bool condense_glob) : dof_handler (triangulation), - max_degree (dim == 2 ? 7 : 5) + max_degree (dim == 2 ? 7 : 5), + condense_global (condense_glob) { for (unsigned int degree=2; degree<=max_degree; ++degree) { @@ -197,7 +202,8 @@ void LaplaceProblem::setup_system () condense.reset(); condense.start(); hanging_node_constraints.condense (csp); - condense.stop(); + condense.stop(); + sparsity_pattern.copy_from (csp); } @@ -250,21 +256,41 @@ void LaplaceProblem::assemble_system () } cell->get_dof_indices (local_dof_indices); - for (unsigned int i=0; i boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, @@ -1298,7 +1324,7 @@ int main () { deallog.depth_console (0); - LaplaceProblem<3> laplace_problem; + LaplaceProblem<3> laplace_problem (true); laplace_problem.run (); } catch (std::exception &exc) diff --git a/deal.II/examples/step-28/Makefile b/deal.II/examples/step-28/Makefile index 039b7d08c0..02166419b8 100644 --- a/deal.II/examples/step-28/Makefile +++ b/deal.II/examples/step-28/Makefile @@ -7,7 +7,7 @@ # The first is the name of the application. It is assumed that the # application name is the same as the base file name of the single C++ # file from which the application is generated. -target = step-28 +target = $(basename $(shell echo step-*.cc)) # The second field determines whether you want to run your program in # debug or optimized mode. The latter is significantly faster, but no