* 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>
* 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
// 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
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
{
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;
}
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
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
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
// and rather allow the
// function to be discontinuous
// along the interface
- return FiniteElementDomination::this_element_dominates;
+ return FiniteElementDomination::other_element_dominates;
}
Assert (false, ExcNotImplemented());