bool conforms (const Conformity) const;
/**
+ * Given an index in the natural
+ * ordering of indices on a face,
+ * return the index of the same
+ * degree of freedom on the cell.
+ *
+ */
+ unsigned int face_to_cell_index(unsigned int face_index,
+ unsigned int face,
+ bool orientation = true) const;
+
+ /**
+ * @deprecated This function is
+ * just a special version of
+ * face_to_cell_index for the face
+ * zero. It is therefore of
+ * limited use in aplications and
+ * most of the time, the other
+ * function is what is required.
+ *
* Given an index in the natural
* ordering of indices on a face,
* return the index of an
* if (fe.is_primitive(fe.face_to_equivalent_cell_index(i)))
* ... do whatever
* @endcode
+ *
*/
unsigned int face_to_equivalent_cell_index (const unsigned int index) const;
face_to_equivalent_cell_index (const unsigned int index) const
{
Assert (index < dofs_per_face,
- ExcIndexRange (index, 0, dofs_per_vertex));
+ ExcIndexRange (index, 0, dofs_per_face));
return index;
}
face_to_equivalent_cell_index (const unsigned int index) const
{
Assert (index < dofs_per_face,
- ExcIndexRange (index, 0, dofs_per_vertex));
- return (index < (GeometryInfo<2>::vertices_per_face *
- this->dofs_per_vertex)
- ?
- index
- :
- GeometryInfo<2>::vertices_per_cell *
- this->dofs_per_vertex +
- (index -
- GeometryInfo<2>::vertices_per_face *
- this->dofs_per_vertex));
+ ExcIndexRange (index, 0, dofs_per_face));
+ return (index < (this->first_face_line_index)
+ ? index
+ : this->first_line_index +
+ (index - this->first_face_line_index));
}
face_to_equivalent_cell_index (const unsigned int index) const
{
Assert (index < dofs_per_face,
- ExcIndexRange (index, 0, dofs_per_vertex));
+ ExcIndexRange (index, 0, dofs_per_face));
return (index < (GeometryInfo<3>::vertices_per_face *
this->dofs_per_vertex)
- ?
- index
- :
- (index < (GeometryInfo<3>::vertices_per_face *
- this->dofs_per_vertex
- +
- GeometryInfo<3>::lines_per_face *
- this->dofs_per_line)
- ?
- GeometryInfo<3>::vertices_per_cell *
- this->dofs_per_vertex +
- (index -
- GeometryInfo<3>::vertices_per_face *
- this->dofs_per_vertex)
- :
- GeometryInfo<3>::vertices_per_cell *
- this->dofs_per_vertex +
- GeometryInfo<3>::lines_per_cell *
- this->dofs_per_line +
- (index -
- GeometryInfo<3>::vertices_per_face *
- this->dofs_per_vertex
- -
- GeometryInfo<3>::lines_per_face *
- this->dofs_per_line)));
+ ? index
+ : (index < (this->first_face_quad_index)
+ ? this->first_line_index +
+ (index - this->first_face_line_index)
+ : this->first_quad_index +
+ (index - this->first_face_quad_index)));
}
(conforming_space == f.conforming_space));
}
+template<int dim>
+unsigned int
+FiniteElementData<dim>::face_to_cell_index(
+ unsigned int face_index,
+ unsigned int face,
+ bool orientation) const
+{
+ Assert(face_index < this->dofs_per_face,
+ ExcIndexRange(face_index, 0, this->dofs_per_face));
+ Assert(face < GeometryInfo<dim>::faces_per_cell,
+ ExcIndexRange(face, 0, GeometryInfo<dim>::faces_per_cell));
+
+ // DoF on a vertex
+ if (face_index < this->first_face_line_index)
+ {
+ // Vertex number on the face
+ const unsigned int face_vertex = face_index / this->dofs_per_vertex;
+ return face_index % this->dofs_per_vertex
+ + GeometryInfo<dim>::face_to_cell_vertices(face, face_vertex, orientation)
+ * this->dofs_per_vertex;
+ }
+ // Else, DoF on a line?
+ if (face_index < this->first_face_quad_index)
+ {
+ // Ignore vertex dofs
+ const unsigned int index = face_index - this->first_face_line_index;
+ // Line number on the face
+ const unsigned int face_line = index / this->dofs_per_line;
+ return this->first_line_index + index % this->dofs_per_line
+ + GeometryInfo<dim>::face_to_cell_lines(face, face_line, orientation)
+ * this->dofs_per_line;
+ }
+ // Else, DoF is on a quad
+
+ // Ignore vertex and line dofs
+ const unsigned int index = face_index - this->first_face_quad_index;
+ return this->first_quad_index + index
+ + face * this->dofs_per_quad;
+}
+
template class FiniteElementData<1>;
template class FiniteElementData<2>;