From: Wolfgang Bangerth Date: Wed, 20 Apr 2011 15:19:52 +0000 (+0000) Subject: Make run in 3d as well. X-Git-Tag: v8.0.0~4140 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d22903b75ad4f97ae26201dc25035ccd8a8646d;p=dealii.git Make run in 3d as well. git-svn-id: https://svn.dealii.org/trunk@23617 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-46/step-46.cc b/deal.II/examples/step-46/step-46.cc index 6edf976d59..1d45c73204 100644 --- a/deal.II/examples/step-46/step-46.cc +++ b/deal.II/examples/step-46/step-46.cc @@ -130,8 +130,16 @@ BoundaryValues::value (const Point &p, Assert (component < this->n_components, ExcIndexRange (component, 0, this->n_components)); - if (component == 1) - return std::sin(numbers::PI*p[0]); + if (component == dim-1) + switch (dim) + { + case 2: + return std::sin(numbers::PI*p[0]); + case 3: + return std::sin(numbers::PI*p[0]) * std::sin(numbers::PI*p[1]); + default: + Assert (false, ExcNotImplemented()); + } return 0; } @@ -340,11 +348,11 @@ FluidStructureProblem::setup_subdomains () cell != dof_handler.end(); ++cell) if (((std::fabs(cell->center()[0]) < 0.25) && - (cell->center()[1] > 0.5)) + (cell->center()[dim-1] > 0.5)) || ((std::fabs(cell->center()[0]) >= 0.25) && - (cell->center()[1] > -0.5))) + (cell->center()[dim-1] > -0.5))) cell->set_active_fe_index (0); else cell->set_active_fe_index (1); @@ -786,9 +794,9 @@ void FluidStructureProblem::run () && (cell->face(f)->center()[dim-1] == 1)) cell->face(f)->set_all_boundary_indicators(1); - triangulation.refine_global (3); + triangulation.refine_global (5-dim); - for (unsigned int refinement_cycle = 0; refinement_cycle<6; + for (unsigned int refinement_cycle = 0; refinement_cycle<10-2*dim; ++refinement_cycle) { std::cout << "Refinement cycle " << refinement_cycle << std::endl;