From: Wolfgang Bangerth Date: Mon, 11 Apr 2011 14:15:52 +0000 (+0000) Subject: Add framework for coupling. X-Git-Tag: v8.0.0~4182 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11b0669e9219ff61876300a5bbae5f857af9394f;p=dealii.git Add framework for coupling. git-svn-id: https://svn.dealii.org/trunk@23569 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 468d186321..024fe21337 100644 --- a/deal.II/examples/step-46/step-46.cc +++ b/deal.II/examples/step-46/step-46.cc @@ -315,6 +315,8 @@ void FluidStructureProblem::assemble_system () system_matrix=0; system_rhs=0; + const double viscosity = 2; + const QGauss stokes_quadrature(stokes_degree+2); const QGauss elasticity_quadrature(elasticity_degree+2); @@ -328,6 +330,16 @@ void FluidStructureProblem::assemble_system () update_JxW_values | update_gradients); + const QGauss face_quadrature(std::max (stokes_degree+2, + elasticity_degree+2)); + + FEFaceValues stokes_fe_face_values (stokes_fe, face_quadrature, + update_JxW_values | + update_normal_vectors | + update_gradients); + FEFaceValues elasticity_fe_face_values (elasticity_fe, face_quadrature, + update_values); + const unsigned int stokes_dofs_per_cell = stokes_fe.dofs_per_cell; const unsigned int elasticity_dofs_per_cell = elasticity_fe.dofs_per_cell; @@ -348,6 +360,7 @@ void FluidStructureProblem::assemble_system () std::vector > elasticity_phi_grad (elasticity_dofs_per_cell); std::vector elasticity_phi_div (elasticity_dofs_per_cell); + std::vector > elasticity_phi (elasticity_dofs_per_cell); typename hp::DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), @@ -379,7 +392,7 @@ void FluidStructureProblem::assemble_system () for (unsigned int i=0; i::assemble_system () } } - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; local_dof_indices.resize (dofs_per_cell); cell->get_dof_indices (local_dof_indices); @@ -429,6 +441,64 @@ void FluidStructureProblem::assemble_system () constraints.distribute_local_to_global (local_matrix, local_rhs, local_dof_indices, system_matrix, system_rhs); + + // see about face terms + if (cell->active_fe_index() == 0) + // we are on a fluid cell + for (unsigned int f=0; f::faces_per_cell; ++f) + if (cell->at_boundary(f) == false) + { + if ((cell->neighbor(f)->level() == cell->level()) + && + (cell->neighbor(f)->has_children() == false)) + { + // cells are on same level + if (cell->neighbor(f)->active_fe_index() == 0) + // neighbor is also a fluid cell + continue; + + // same size + // neighbors; + // neighbor is + // solids cell + stokes_fe_face_values.reinit (cell, f); + elasticity_fe_face_values.reinit (cell->neighbor(f), + cell->neighbor_of_neighbor(f)); + + local_matrix.reinit (stokes_dofs_per_cell, + elasticity_dofs_per_cell); + for (unsigned int q=0; q normal_vector = stokes_fe_face_values.normal_vector(q); + + for (unsigned int k=0; kneighbor(f)->level() == cell->level()) + && + (cell->neighbor(f)->has_children() == true)) + { + // neighbor has children + } + else + { + // neighbor is coarser + if (cell->active_fe_index() == cell->neighbor(f)->active_fe_index()) + continue; + } + } } }