From: bangerth Date: Sat, 5 Mar 2011 19:32:49 +0000 (+0000) Subject: Fix several bugs that stood in the way of making the things with FE_Nothing that... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd72050a6d216e3229fd634a20c81aec67411c6e;p=dealii-svn.git Fix several bugs that stood in the way of making the things with FE_Nothing that didn't work last week work. git-svn-id: https://svn.dealii.org/trunk@23461 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/fe/fe_base.h b/deal.II/include/deal.II/fe/fe_base.h index ec46db31f7..d4b6b48552 100644 --- a/deal.II/include/deal.II/fe/fe_base.h +++ b/deal.II/include/deal.II/fe/fe_base.h @@ -682,14 +682,16 @@ namespace FiniteElementDomination { case this_element_dominates: if ((d2 == this_element_dominates) || - (d2 == either_element_can_dominate)) + (d2 == either_element_can_dominate) || + (d2 == no_requirements)) return this_element_dominates; else return neither_element_dominates; case other_element_dominates: if ((d2 == other_element_dominates) || - (d2 == either_element_can_dominate)) + (d2 == either_element_can_dominate) || + (d2 == no_requirements)) return other_element_dominates; else return neither_element_dominates; diff --git a/deal.II/include/deal.II/fe/fe_q_hierarchical.h b/deal.II/include/deal.II/fe/fe_q_hierarchical.h index a4daa1f28f..bff542ffe9 100644 --- a/deal.II/include/deal.II/fe/fe_q_hierarchical.h +++ b/deal.II/include/deal.II/fe/fe_q_hierarchical.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------- // $Id$ // -// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2010 by the deal.II authors +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2010, 2011 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -352,6 +352,22 @@ class FE_Q_Hierarchical : public FE_Poly,dim> */ virtual void get_subface_interpolation_matrix (const FiniteElement& source, const unsigned int subface, FullMatrix& matrix) const; + /** + * Return whether this element dominates + * the one given as argument when they + * meet at a common face, + * whether it is the other way around, + * whether neither dominates, or if + * either could dominate. + * + * For a definition of domination, see + * FiniteElementBase::Domination and in + * particular the @ref hp_paper "hp paper". + */ + virtual + FiniteElementDomination::Domination + compare_for_face_domination (const FiniteElement &fe_other) const; + /** * Determine an estimate for the * memory consumption (in bytes) diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index c5e4181456..c2c6df733a 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -2266,34 +2266,6 @@ namespace internal Assert(cell->face(face)->refinement_case()==RefinementCase::isotropic_refinement, ExcNotImplemented()); - // check to see if the child elements - // have no dofs on the - // shared face. if none of them do, we - // we can simply continue to the next face. - // if only some of them have dofs, while - // others do not, then we don't know - // what to do and throw an exception. - // - // ignore all - // interfaces with - // artificial cells - bool any_are_zero = false; - bool all_are_zero = true; - - for (unsigned int c=0; cface(face)->n_children(); ++c) - if (!cell->neighbor_child_on_subface(face, c)->is_artificial()) - { - if (cell->neighbor_child_on_subface(face, c)->get_fe().dofs_per_face == 0) - any_are_zero = true; - else - all_are_zero = false; - } - - if(all_are_zero) - continue; - - Assert( all_are_zero || !any_are_zero, ExcNotImplemented() ); - // so now we've found a // face of an active // cell that has @@ -2998,6 +2970,12 @@ namespace internal break; } + case FiniteElementDomination::no_requirements: + { + // nothing to do here + break; + } + default: // we shouldn't get // here diff --git a/deal.II/source/fe/fe_dgp.cc b/deal.II/source/fe/fe_dgp.cc index 3e6fe2c836..1ca1b52780 100644 --- a/deal.II/source/fe/fe_dgp.cc +++ b/deal.II/source/fe/fe_dgp.cc @@ -223,11 +223,10 @@ FiniteElementDomination::Domination FE_DGP::compare_for_face_domination (const FiniteElement &fe_other) const { // check whether both are discontinuous - // elements and both could dominate, see - // the description of + // elements, see the description of // FiniteElementDomination::Domination if (dynamic_cast*>(&fe_other) != 0) - return FiniteElementDomination::either_element_can_dominate; + return FiniteElementDomination::no_requirements; Assert (false, ExcNotImplemented()); return FiniteElementDomination::neither_element_dominates; diff --git a/deal.II/source/fe/fe_dgp_monomial.cc b/deal.II/source/fe/fe_dgp_monomial.cc index ad2f656cea..83969bc586 100644 --- a/deal.II/source/fe/fe_dgp_monomial.cc +++ b/deal.II/source/fe/fe_dgp_monomial.cc @@ -367,11 +367,11 @@ FE_DGPMonomial:: compare_for_face_domination (const FiniteElement &fe_other) const { // check whether both are discontinuous - // elements and both could dominate, see + // elements, see // the description of // FiniteElementDomination::Domination if (dynamic_cast*>(&fe_other) != 0) - return FiniteElementDomination::either_element_can_dominate; + return FiniteElementDomination::no_requirements; Assert (false, ExcNotImplemented()); return FiniteElementDomination::neither_element_dominates; diff --git a/deal.II/source/fe/fe_dgp_nonparametric.cc b/deal.II/source/fe/fe_dgp_nonparametric.cc index 36fbeb0c26..ba5ff93f1c 100644 --- a/deal.II/source/fe/fe_dgp_nonparametric.cc +++ b/deal.II/source/fe/fe_dgp_nonparametric.cc @@ -573,11 +573,10 @@ FE_DGPNonparametric:: compare_for_face_domination (const FiniteElement &fe_other) const { // check whether both are discontinuous - // elements and both could dominate, see - // the description of + // elements, see the description of // FiniteElementDomination::Domination if (dynamic_cast*>(&fe_other) != 0) - return FiniteElementDomination::either_element_can_dominate; + return FiniteElementDomination::no_requirements; Assert (false, ExcNotImplemented()); return FiniteElementDomination::neither_element_dominates; diff --git a/deal.II/source/fe/fe_dgq.cc b/deal.II/source/fe/fe_dgq.cc index 11d3216cca..d0667da04f 100644 --- a/deal.II/source/fe/fe_dgq.cc +++ b/deal.II/source/fe/fe_dgq.cc @@ -576,11 +576,10 @@ FiniteElementDomination::Domination FE_DGQ::compare_for_face_domination (const FiniteElement &fe_other) const { // check whether both are discontinuous - // elements and both could dominate, see - // the description of + // elements, see the description of // FiniteElementDomination::Domination if (dynamic_cast*>(&fe_other) != 0) - return FiniteElementDomination::either_element_can_dominate; + return FiniteElementDomination::no_requirements; Assert (false, ExcNotImplemented()); return FiniteElementDomination::neither_element_dominates; diff --git a/deal.II/source/fe/fe_q_hierarchical.cc b/deal.II/source/fe/fe_q_hierarchical.cc index 6f6a888ac6..348c7cfa56 100644 --- a/deal.II/source/fe/fe_q_hierarchical.cc +++ b/deal.II/source/fe/fe_q_hierarchical.cc @@ -164,6 +164,38 @@ hp_vertex_dof_identities (const FiniteElement &fe_other) const } } + +template +FiniteElementDomination::Domination +FE_Q_Hierarchical:: +compare_for_face_domination (const FiniteElement &fe_other) const +{ + if (const FE_Q_Hierarchical *fe_q_other + = dynamic_cast*>(&fe_other)) + { + if (this->degree < fe_q_other->degree) + return FiniteElementDomination::this_element_dominates; + else if (this->degree == fe_q_other->degree) + return FiniteElementDomination::either_element_can_dominate; + else + return FiniteElementDomination::other_element_dominates; + } + else if (dynamic_cast*>(&fe_other) != 0) + { + // the FE_Nothing has no + // degrees of freedom and it is + // typically used in a context + // where we don't require any + // continuity along the + // interface + return FiniteElementDomination::no_requirements; + } + + Assert (false, ExcNotImplemented()); + return FiniteElementDomination::neither_element_dominates; +} + + //--------------------------------------------------------------------------- // Auxiliary functions //---------------------------------------------------------------------------