From 4eb09246279f72f7a9941a5356e1864f02f3df4d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 23 Apr 2011 03:28:51 +0000 Subject: [PATCH] Make it more abstract. git-svn-id: https://svn.dealii.org/trunk@23635 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-46/step-46.cc | 30 ++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/deal.II/examples/step-46/step-46.cc b/deal.II/examples/step-46/step-46.cc index d39d7a883c..718455050c 100644 --- a/deal.II/examples/step-46/step-46.cc +++ b/deal.II/examples/step-46/step-46.cc @@ -270,7 +270,7 @@ bool FluidStructureProblem:: cell_is_in_fluid_domain (const typename hp::DoFHandler::cell_iterator &cell) { - return (cell->active_fe_index() == 0); + return (cell->material_id() == 0); } @@ -279,7 +279,7 @@ bool FluidStructureProblem:: cell_is_in_solid_domain (const typename hp::DoFHandler::cell_iterator &cell) { - return (cell->active_fe_index() == 1); + return (cell->material_id() == 1); } @@ -300,14 +300,9 @@ FluidStructureProblem::make_grid () cell->face(f)->set_all_boundary_indicators(1); triangulation.refine_global (3-dim); -} -template -void -FluidStructureProblem::setup_subdomains () -{ - for (typename hp::DoFHandler::active_cell_iterator + for (typename Triangulation::active_cell_iterator cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell) if (((std::fabs(cell->center()[0]) < 0.25) @@ -317,9 +312,26 @@ FluidStructureProblem::setup_subdomains () ((std::fabs(cell->center()[0]) >= 0.25) && (cell->center()[dim-1] > -0.5))) - cell->set_active_fe_index (0); + cell->set_material_id (0); else + cell->set_material_id (1); +} + + + +template +void +FluidStructureProblem::setup_subdomains () +{ + for (typename hp::DoFHandler::active_cell_iterator + cell = dof_handler.begin_active(); + cell != dof_handler.end(); ++cell) + if (cell_is_in_fluid_domain(cell)) + cell->set_active_fe_index (0); + else if (cell_is_in_solid_domain(cell)) cell->set_active_fe_index (1); + else + Assert (false, ExcNotImplemented()); } -- 2.39.5