From: bangerth Date: Fri, 25 Feb 2011 00:36:44 +0000 (+0000) Subject: Change geometry slightly. Impose no-slip boundary conditions on the X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c210f623b2d09268e07b128c7d25c9eb5c1b1c8d;p=dealii-svn.git Change geometry slightly. Impose no-slip boundary conditions on the interface. git-svn-id: https://svn.dealii.org/trunk@23448 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 ec51f8edc7..176fbb7e1e 100644 --- a/deal.II/examples/step-46/step-46.cc +++ b/deal.II/examples/step-46/step-46.cc @@ -204,11 +204,11 @@ void StokesProblem::setup_dofs () for (typename hp::DoFHandler::active_cell_iterator cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell) - if (((cell->center()[0] < 0) + if (((std::fabs(cell->center()[0]) < 0.25) && (cell->center()[1] > 0.5)) || - ((cell->center()[0] >= 0) + ((std::fabs(cell->center()[0]) >= 0.25) && (cell->center()[1] > -0.5))) cell->set_active_fe_index (0); @@ -232,6 +232,49 @@ void StokesProblem::setup_dofs () component_mask); } + // make sure velocity is zero at + // the interface + { + std::vector local_face_dof_indices (stokes_fe.dofs_per_face); + for (typename hp::DoFHandler::active_cell_iterator + cell = dof_handler.begin_active(); + cell != dof_handler.end(); ++cell) + if (cell->active_fe_index() == 0) + for (unsigned int f=0; f::faces_per_cell; ++f) + if (not cell->at_boundary(f)) + { + bool face_is_on_interface = false; + + if ((cell->neighbor(f)->has_children() == false) + && + (cell->neighbor(f)->active_fe_index() == 1)) + face_is_on_interface = true; + else if (cell->neighbor(f)->has_children() == true) + { + // neighbor does + // have + // children. see if + // any of the cells + // on the other + // side are elastic + for (unsigned int sf=0; sfface(f)->n_children(); ++sf) + if (cell->neighbor_child_on_subface(f, sf)->active_fe_index() == 1) + { + face_is_on_interface = true; + break; + } + } + + if (face_is_on_interface) + { + cell->face(f)->get_dof_indices (local_face_dof_indices, 0); + for (unsigned int i=0; i::run () && (cell->face(f)->center()[dim-1] == 1)) cell->face(f)->set_all_boundary_indicators(1); - triangulation.refine_global (2); + triangulation.refine_global (3); for (unsigned int refinement_cycle = 0; refinement_cycle<6; ++refinement_cycle)