const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Point<spacedim> &p) const = 0;
-/**
- * Transforms the point @p p on the real @p cell to the corresponding point
- * on the unit cell, and then projects it to a dim-1 point on the face with
- * the given face number @p face_no. Ideally the point @p p is near the face
- * @ face_no, but any point in the cell can technically be projected.
- */
-virtual Point<dim-1>
-transform_real_to_unit_projected_to_face (
+ /**
+ * Transforms the point @p p on the real @p cell to the corresponding point
+ * on the unit cell, and then projects it to a dim-1 point on the face with
+ * the given face number @p face_no. Ideally the point @p p is near the face
+ * @ face_no, but any point in the cell can technically be projected.
+ *
+ * This function does not make physical sense when dim=1,
+ * so it throws an exception in this case.
+ */
+ virtual Point<dim-1>
+ transform_real_to_unit_projected_to_face (
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const unsigned int &face_no,
const Point<spacedim> &p) const;
Point<dim-1>
Mapping<dim,spacedim>::
transform_real_to_unit_projected_to_face (
- const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- const unsigned int &face_no,
- const Point<spacedim> &p) const
+ const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+ const unsigned int &face_no,
+ const Point<spacedim> &p) const
{
+ //The function doesn't make physical sense for dim=1
+ Assert(dim>1, ExcNotImplemented());
+ //Not implemented for higher dimensions
+ Assert(3<=dim, ExcNotImplemented());
+
Point<dim> unit_cell_pt = transform_real_to_unit_cell(cell, p);
Point<dim-1> unit_face_pt;
- if (dim==2) {
- if (GeometryInfo<dim>::unit_normal_direction[face_no] == 0)
- unit_face_pt = Point<dim-1>(unit_cell_pt(1));
- else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 1)
- unit_face_pt = Point<dim-1>(unit_cell_pt(0));
- }
- else if (dim==3) {
- if (GeometryInfo<dim>::unit_normal_direction[face_no] == 0)
- unit_face_pt = Point<dim-1>(unit_cell_pt(1), unit_cell_pt(2));
- else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 1)
- unit_face_pt = Point<dim-1>(unit_cell_pt(0), unit_cell_pt(2));
- else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 2)
- unit_face_pt = Point<dim-1>(unit_cell_pt(0), unit_cell_pt(1));
- }
+ if (dim==2)
+ {
+ if (GeometryInfo<dim>::unit_normal_direction[face_no] == 0)
+ unit_face_pt = Point<dim-1>(unit_cell_pt(1));
+ else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 1)
+ unit_face_pt = Point<dim-1>(unit_cell_pt(0));
+ }
+ else if (dim==3)
+ {
+ if (GeometryInfo<dim>::unit_normal_direction[face_no] == 0)
+ unit_face_pt = Point<dim-1>(unit_cell_pt(1), unit_cell_pt(2));
+ else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 1)
+ unit_face_pt = Point<dim-1>(unit_cell_pt(0), unit_cell_pt(2));
+ else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 2)
+ unit_face_pt = Point<dim-1>(unit_cell_pt(0), unit_cell_pt(1));
+ }
return unit_face_pt;
}
}
-
-
/*------------------------------ InternalData ------------------------------*/