From: bangerth Date: Mon, 28 Jan 2008 20:50:43 +0000 (+0000) Subject: Make run in 3d as well. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e6f7f19d09a9dbe0541af7016f25ea5f4740401;p=dealii-svn.git Make run in 3d as well. git-svn-id: https://svn.dealii.org/trunk@15696 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-31/step-31.cc b/deal.II/examples/step-31/step-31.cc index 1fea326201..095c1e9b24 100644 --- a/deal.II/examples/step-31/step-31.cc +++ b/deal.II/examples/step-31/step-31.cc @@ -553,7 +553,7 @@ void StokesProblem::assemble_system () std::vector component_mask (dim+1, true); component_mask[dim] = false; VectorTools::interpolate_boundary_values (dof_handler, - 3, + 1, BoundaryValues(), boundary_values, component_mask); @@ -694,41 +694,31 @@ StokesProblem::refine_mesh () template void StokesProblem::run () { - switch (dim) - { - case 2: - { - std::vector subdivisions (dim, 1); - subdivisions[0] = 4; - - GridGenerator::subdivided_hyper_rectangle (triangulation, - subdivisions, - Point(-2,-1), - Point(2,0), - true); - - triangulation.refine_global (2); - - break; - } - - case 3: - { - GridGenerator::hyper_shell (triangulation, - Point(), 0.5, 1.0); + std::vector subdivisions (dim, 1); + subdivisions[0] = 4; - static HyperShellBoundary boundary; - triangulation.set_boundary (0, boundary); - - triangulation.refine_global (2); - - break; - } - - default: - Assert (false, ExcNotImplemented()); - } + GridGenerator::subdivided_hyper_rectangle (triangulation, + subdivisions, + (dim == 2 ? + Point(-2,-1) : + Point(-2,0,-1)), + (dim == 2 ? + Point(2,0) : + Point(2,1,0))); + for (typename Triangulation::active_cell_iterator + cell = triangulation.begin_active(); + cell != triangulation.end(); ++cell) + for (unsigned int f=0; f::faces_per_cell; ++f) + if (cell->face(f)->center()[dim-1] == 0) + { + cell->face(f)->set_boundary_indicator(1); + +// for (unsigned int e=0; e::lines_per_face; ++e) +// cell->face(f)->line(e)->set_boundary_indicator (1); + } + + triangulation.refine_global (4-dim); for (unsigned int refinement_cycle = 0; refinement_cycle<9; ++refinement_cycle)