]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Patch by Joshua White: More pieces of the FE_Nothing puzzle.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 8 Oct 2009 18:41:41 +0000 (18:41 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 8 Oct 2009 18:41:41 +0000 (18:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@19771 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_nothing.h
deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/deal.II/source/fe/fe_nothing.cc
deal.II/deal.II/source/fe/fe_q.cc

index 799e6e68423c676e8e9e0420b149ff862ca9fe93..3cddf4c604e6c15032ff47972a730eabca53b183 100644 (file)
@@ -32,6 +32,39 @@ DEAL_II_NAMESPACE_OPEN
  * therefore assign no degrees of freedom to the FE_Nothing cells, and
  * this subregion is therefore implicitly deleted from the computation.
  *
+ * Note that some care must be taken that the resulting mesh topology
+ * continues to make sense when FE_Nothing elements are introduced.
+ * This is particularly true when dealing with hanging node constraints,
+ * because the library makes some basic assumptions about the nature
+ * of those constraints.  The following geometries are acceptable:
+ *
+ * +---------+----+----+
+ * |         | 0  |    |
+ * |    1    +----+----+
+ * |         | 0  |    |
+ * +---------+----+----+
+ *
+ * +---------+----+----+
+ * |         | 1  |    |
+ * |    0    +----+----+
+ * |         | 1  |    |
+ * +---------+----+----+
+ *
+ * Here, 0 denotes an FE_Nothing cell, and 1 denotes some other
+ * element type.  The library has no difficulty computing the necessary
+ * hanging node constraints in these cases (i.e. no constraint).  
+ * However, the following geometry is NOT acceptable (at least 
+ * in the current implementation):
+ *
+ * +---------+----+----+
+ * |         | 0  |    |
+ * |    1    +----+----+
+ * |         | 1  |    |
+ * +---------+----+----+
+ * 
+ * The distinction lies in the mixed nature of the child faces,
+ * a case we have not implemented as of yet.
+ *
  * @author Joshua White
  */
 template <int dim>
@@ -269,7 +302,7 @@ class FE_Nothing : public FiniteElement<dim>
                                       * FiniteElementBase::Domination and in
                                       * particular the @ref hp_paper "hp paper".
                                       *
-                                      * In the current case, the other element
+                                      * In the current case, this element
                                       * is always assumed to dominate, unless 
                                       * it is also of type FE_Nothing().  In
                                       * that situation, either element can
index c171243a69b5ac3de569eca9e0161b5b2e486087..9bf8407d4f432b81366539ffe9a361c4782e7e0d 100644 (file)
@@ -2240,11 +2240,34 @@ namespace internal
                                               // on the face at all or no
                                               // anisotropic refinement
              if (cell->get_fe().dofs_per_face == 0)
-               continue;
+               continue;
              
              Assert(cell->face(face)->refinement_case()==RefinementCase<dim-1>::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.
+              bool any_are_zero = false;
+              bool all_are_zero = true;
+
+             for (unsigned int c=0; c<cell->face(face)->n_children(); ++c)
+              {
+                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
@@ -2696,7 +2719,12 @@ namespace internal
                        cell->face(face)->get_dof_indices (slave_dofs,
                                                           neighbor->active_fe_index ());
                          
-                                                 
+                                                        // break if the n_master_dofs == 0,
+                                                         // because we are attempting to 
+                                                         // constrain to an element that has
+                                                         // has no face dofs
+                        if(master_dofs.size() == 0) break;
                                                         // make sure
                                                         // the element
                                                         // constraints
index 78ea19564c0988218e69e4fa9dc34af0810de11e..795e054e4c84fbb5bb89e4707fbbf6d370275ee1 100644 (file)
@@ -182,15 +182,8 @@ compare_for_face_domination (const FiniteElement<dim> & fe_other) const
 {
   if(dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != 0)
     return FiniteElementDomination::either_element_can_dominate;
-    
-              // Question: Best to assume this element always dominates,
-              // since we will always no how to do deal with other elements
-              // regardless of type, or do we leave it up to the other 
-              // element to handle the FENothing appropriately?  Set
-              // to the second choice for now.
   else
-    return FiniteElementDomination::other_element_dominates;
-    //return FiniteElementDomination::this_element_dominates;
+    return FiniteElementDomination::this_element_dominates;
 }
    
    
@@ -199,7 +192,7 @@ std::vector<std::pair<unsigned int, unsigned int> >
 FE_Nothing<dim> ::
 hp_vertex_dof_identities (const FiniteElement<dim> &/*fe_other*/) const
 {
-               // the FE_Nothing has no
+                                       // the FE_Nothing has no
                                       // degrees of freedom, so there
                                       // are no equivalencies to be
                                       // recorded
@@ -212,7 +205,7 @@ std::vector<std::pair<unsigned int, unsigned int> >
 FE_Nothing<dim> ::
 hp_line_dof_identities (const FiniteElement<dim> &/*fe_other*/) const
 {
-               // the FE_Nothing has no
+                                       // the FE_Nothing has no
                                       // degrees of freedom, so there
                                       // are no equivalencies to be
                                       // recorded
@@ -225,7 +218,7 @@ std::vector<std::pair<unsigned int, unsigned int> >
 FE_Nothing<dim> ::
 hp_quad_dof_identities (const FiniteElement<dim> &/*fe_other*/) const
 {
-               // the FE_Nothing has no
+                                       // the FE_Nothing has no
                                       // degrees of freedom, so there
                                       // are no equivalencies to be
                                       // recorded
index fe0d0caebc2f77432d53f5334c6ac7bc232ecec2..f3df8e23f8a351049405687c8ac546846c24f41b 100644 (file)
@@ -1257,7 +1257,7 @@ compare_for_face_domination (const FiniteElement<dim,spacedim> &fe_other) const
                                       // and rather allow the
                                       // function to be discontinuous
                                       // along the interface
-      return FiniteElementDomination::this_element_dominates;
+      return FiniteElementDomination::other_element_dominates;
     }
 
   Assert (false, ExcNotImplemented());

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.