From 29964efa49d92bfc815c6f9ebffd4dc5b727caa0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 18 Oct 2007 23:23:47 +0000 Subject: [PATCH] Make run in 3d as well. git-svn-id: https://svn.dealii.org/trunk@15347 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-22/step-22.cc | 35 ++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/deal.II/examples/step-22/step-22.cc b/deal.II/examples/step-22/step-22.cc index b65ec3f140..ba47382776 100644 --- a/deal.II/examples/step-22/step-22.cc +++ b/deal.II/examples/step-22/step-22.cc @@ -563,7 +563,6 @@ void BoussinesqFlowProblem::assemble_system () const Point gravity = fe_values.quadrature_point(q) / fe_values.quadrature_point(q).norm(); - Assert (dim == 2, ExcInternalError()); local_rhs(i) += (Raleigh_number * gravity * phi_i_u * old_temperature)* fe_values.JxW(q); @@ -930,12 +929,38 @@ BoussinesqFlowProblem::get_maximal_velocity () const template void BoussinesqFlowProblem::run () { - GridGenerator::half_hyper_shell (triangulation, Point(), 0.5, 1.0); + switch (dim) + { + case 2: + { + GridGenerator::half_hyper_shell (triangulation, + Point(), 0.5, 1.0); + + static HalfHyperShellBoundary boundary; + triangulation.set_boundary (0, boundary); + + triangulation.refine_global (5); - static HalfHyperShellBoundary boundary; - triangulation.set_boundary (0, boundary); + break; + } + + case 3: + { + GridGenerator::hyper_shell (triangulation, + Point(), 0.5, 1.0); + + static HyperShellBoundary boundary; + triangulation.set_boundary (0, boundary); + + triangulation.refine_global (2); + + break; + } + + default: + Assert (false, ExcNotImplemented()); + } - triangulation.refine_global (5); setup_dofs(); -- 2.39.5