]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added function to mapping that transforms a real point to unit and then projects...
authorJason Sheldon <Jason.Sheldon@psu.edu>
Thu, 6 Aug 2015 16:47:36 +0000 (12:47 -0400)
committerJason Sheldon <Jason.Sheldon@psu.edu>
Thu, 6 Aug 2015 21:49:31 +0000 (17:49 -0400)
include/deal.II/fe/mapping.h
source/fe/mapping.cc

index a2fcbcdff34a044cf36a86fa44073cad98a0d503..3d0d09e2ecd49df5ef073e64c16c41e84b692dae 100644 (file)
@@ -275,6 +275,18 @@ public:
     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 (
+    const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+    const unsigned int &face_no,
+    const Point<spacedim> &p) const;
+
   /**
    * Base class for internal data of mapping objects. The
    * internal mechanism is that upon construction of a FEValues object, it
index 6160a21dba29158827166ca96983bc091f4764e0..89bd005cdc38e63a6f87f5f91ede415dd6d25123 100644 (file)
@@ -39,6 +39,35 @@ Mapping<dim, spacedim>::get_vertices (
 }
 
 
+template<int dim, int spacedim>
+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
+{
+  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));
+  }
+
+  return unit_face_pt;
+}
 
 /*------------------------------ InternalDataBase ------------------------------*/
 
@@ -67,6 +96,8 @@ Mapping<dim, spacedim>::InternalDataBase::memory_consumption () const
 }
 
 
+
+
 /*------------------------------ InternalData ------------------------------*/
 
 

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.