*/
static std::vector<bool>
get_ria_vector (const unsigned int degree);
+ /**
+ * Check whether a shape function
+ * may be non-zero on a face.
+ *
+ * Right now, this is only
+ * implemented for RT0 in
+ * 1D. Otherwise, returns always
+ * @p true.
+ */
+ virtual bool has_support_on_face (const unsigned int shape_index,
+ const unsigned int face_index) const;
/**
* Initialize the
* FiniteElement<dim>::generalized_support_points
template <>
std::vector<unsigned int>
-FE_RaviartThomas<1>::get_dpo_vector (const unsigned int)
+FE_RaviartThomas<1>::get_dpo_vector (const unsigned int deg)
{
- Assert (false, ExcImpossibleInDim(1));
- return std::vector<unsigned int>();
+ std::vector<unsigned int> dpo(2);
+ dpo[0] = 1;
+ dpo[1] = deg;
+ return dpo;
}
#endif
template <int dim>
std::vector<unsigned int>
-FE_RaviartThomas<dim>::get_dpo_vector (const unsigned int rt_order)
+FE_RaviartThomas<dim>::get_dpo_vector (const unsigned int deg)
{
- // the element is face-based (not
- // to be confused with George
- // W. Bush's Faith Based
- // Initiative...), and we have
- // (rt_order+1)^(dim-1) DoFs per face
+ // the element is face-based and we have
+ // (deg+1)^(dim-1) DoFs per face
unsigned int dofs_per_face = 1;
- for (unsigned int d=0; d<dim-1; ++d)
- dofs_per_face *= rt_order+1;
+ for (unsigned int d=1; d<dim; ++d)
+ dofs_per_face *= deg+1;
// and then there are interior dofs
const unsigned int
- interior_dofs = dim*rt_order*dofs_per_face;
+ interior_dofs = dim*deg*dofs_per_face;
std::vector<unsigned int> dpo(dim+1);
dpo[dim-1] = dofs_per_face;
}
-
template <int dim>
void
FE_RaviartThomas<dim>::interpolate(
}
-
template <int dim>
void
FE_RaviartThomas<dim>::interpolate(
}
+template <int dim>
+bool
+FE_RaviartThomasNodal<dim>::has_support_on_face (
+ const unsigned int shape_index,
+ const unsigned int face_index) const
+{
+ Assert (shape_index < this->dofs_per_cell,
+ ExcIndexRange (shape_index, 0, this->dofs_per_cell));
+ Assert (face_index < GeometryInfo<dim>::faces_per_cell,
+ ExcIndexRange (face_index, 0, GeometryInfo<dim>::faces_per_cell));
+
+ // The first degrees of freedom are
+ // on the faces and each face has
+ // degree degrees.
+ const unsigned int support_face = shape_index / this->degree;
+
+ // The only thing we know for sure
+ // is that shape functions with
+ // support on one face are zero on
+ // the opposite face.
+ if (support_face < GeometryInfo<dim>::faces_per_cell)
+ return (face_index != GeometryInfo<dim>::opposite_face[support_face]);
+
+ // In all other cases, return true,
+ // which is safe
+ return true;
+}
+
+
template <int dim>
void
FE_RaviartThomasNodal<dim>::interpolate(
}
-
template <int dim>
void
FE_RaviartThomasNodal<dim>::interpolate(