From df921f6186455e5d6d57fea8288b706eabff2ead Mon Sep 17 00:00:00 2001 From: janssen Date: Tue, 28 Sep 2010 16:35:47 +0000 Subject: [PATCH] some modifications to use both cg and dg elements in mg git-svn-id: https://svn.dealii.org/trunk@22183 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/multigrid/mg_constrained_dofs.h | 9 +++-- .../include/numerics/mesh_worker_assembler.h | 34 ++++++++++--------- deal.II/deal.II/source/multigrid/mg_tools.cc | 6 ++-- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/deal.II/deal.II/include/multigrid/mg_constrained_dofs.h b/deal.II/deal.II/include/multigrid/mg_constrained_dofs.h index b9d82d14b8..a64a1261e1 100644 --- a/deal.II/deal.II/include/multigrid/mg_constrained_dofs.h +++ b/deal.II/deal.II/include/multigrid/mg_constrained_dofs.h @@ -125,7 +125,12 @@ class MGConstrainedDoFs : public Subscriptor */ bool set_boundary_values () const; - bool continuity_across_edges () const; + + /** + * Return if the finite element requires + * continuity across refinement edges. + */ + bool continuity_across_refinement_edges () const; private: /** @@ -281,7 +286,7 @@ MGConstrainedDoFs::set_boundary_values () const inline bool -MGConstrainedDoFs::continuity_across_edges () const +MGConstrainedDoFs::continuity_across_refinement_edges () const { bool is_continuous = false; for(unsigned int l=0; l= threshold) G.add(i1[j], i2[k], M(j,k)); + } + else + { + for (unsigned int j=0; j= threshold) + { + if(!mg_constrained_dofs->continuity_across_refinement_edges()) + G.add(i1[j], i2[k], M(j,k)); + } + } } @@ -1598,14 +1611,9 @@ namespace MeshWorker for (unsigned int j=0; j= threshold) - { - if(!mg_constrained_dofs->at_refinement_edge(level, i1[j]) || - mg_constrained_dofs->at_refinement_edge(level, i2[k])) - { - if(!mg_constrained_dofs->continuity_across_edges()) - G.add(i1[j], i2[k], M(k,j)); - } - } + if(mg_constrained_dofs->at_refinement_edge(level, i1[j]) && + !mg_constrained_dofs->at_refinement_edge(level, i2[k])) + G.add(i1[j], i2[k], M(k,j)); } } @@ -1633,14 +1641,9 @@ namespace MeshWorker for (unsigned int j=0; j= threshold) - { - if(!mg_constrained_dofs->at_refinement_edge(level, i1[j]) || - mg_constrained_dofs->at_refinement_edge(level, i2[k])) - { - if(!mg_constrained_dofs->continuity_across_edges()) + if(mg_constrained_dofs->at_refinement_edge(level, i1[j]) && + !mg_constrained_dofs->at_refinement_edge(level, i2[k])) G.add(i1[j], i2[k], M(j,k)); - } - } } } @@ -1740,7 +1743,6 @@ namespace MeshWorker assemble((*matrix)[level], info.matrix(0,false).matrix, info.indices, info.indices, level); if(mg_constrained_dofs != 0) - //if(interface_in != 0 && interface_out != 0 && level>0) { assemble_in((*interface_in)[level], info.matrix(0,false).matrix, info.indices, info.indices, level); assemble_out((*interface_out)[level],info.matrix(0,false).matrix, info.indices, info.indices, level); diff --git a/deal.II/deal.II/source/multigrid/mg_tools.cc b/deal.II/deal.II/source/multigrid/mg_tools.cc index afccf41f06..d2b29a6f23 100644 --- a/deal.II/deal.II/source/multigrid/mg_tools.cc +++ b/deal.II/deal.II/source/multigrid/mg_tools.cc @@ -1479,6 +1479,9 @@ extract_inner_interface_dofs (const MGDoFHandler &mg_dof_handler, const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int dofs_per_face = fe.dofs_per_face; + + deallog << "dofs_per_face" << dofs_per_face << std::endl; + std::vector local_dof_indices (dofs_per_cell); std::vector face_dof_indices (dofs_per_face); @@ -1495,8 +1498,6 @@ extract_inner_interface_dofs (const MGDoFHandler &mg_dof_handler, std::fill (cell_dofs.begin(), cell_dofs.end(), false); std::fill (boundary_cell_dofs.begin(), boundary_cell_dofs.end(), false); - if(fe.conforms(FiniteElementData::H1)) - { for (unsigned int face_nr=0; face_nr::faces_per_cell; ++face_nr) { const typename DoFHandler::face_iterator face = cell->face(face_nr); @@ -1538,7 +1539,6 @@ extract_inner_interface_dofs (const MGDoFHandler &mg_dof_handler, boundary_interface_dofs[level][local_dof_indices[i]] = true; } } - } } #endif -- 2.39.5