From 50950ca16d1753b5a93d9c5fd62b8f881ddbf967 Mon Sep 17 00:00:00 2001 From: Jason Sheldon Date: Thu, 6 Aug 2015 12:47:36 -0400 Subject: [PATCH] Added function to mapping that transforms a real point to unit and then projects to a face --- include/deal.II/fe/mapping.h | 12 ++++++++++++ source/fe/mapping.cc | 31 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/include/deal.II/fe/mapping.h b/include/deal.II/fe/mapping.h index a2fcbcdff3..3d0d09e2ec 100644 --- a/include/deal.II/fe/mapping.h +++ b/include/deal.II/fe/mapping.h @@ -275,6 +275,18 @@ public: const typename Triangulation::cell_iterator &cell, const Point &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 +transform_real_to_unit_projected_to_face ( + const typename Triangulation::cell_iterator &cell, + const unsigned int &face_no, + const Point &p) const; + /** * Base class for internal data of mapping objects. The * internal mechanism is that upon construction of a FEValues object, it diff --git a/source/fe/mapping.cc b/source/fe/mapping.cc index 6160a21dba..89bd005cdc 100644 --- a/source/fe/mapping.cc +++ b/source/fe/mapping.cc @@ -39,6 +39,35 @@ Mapping::get_vertices ( } +template +Point +Mapping:: +transform_real_to_unit_projected_to_face ( + const typename Triangulation::cell_iterator &cell, + const unsigned int &face_no, + const Point &p) const +{ + Point unit_cell_pt = transform_real_to_unit_cell(cell, p); + + Point unit_face_pt; + + if (dim==2) { + if (GeometryInfo::unit_normal_direction[face_no] == 0) + unit_face_pt = Point(unit_cell_pt(1)); + else if (GeometryInfo::unit_normal_direction[face_no] == 1) + unit_face_pt = Point(unit_cell_pt(0)); + } + else if (dim==3) { + if (GeometryInfo::unit_normal_direction[face_no] == 0) + unit_face_pt = Point(unit_cell_pt(1), unit_cell_pt(2)); + else if (GeometryInfo::unit_normal_direction[face_no] == 1) + unit_face_pt = Point(unit_cell_pt(0), unit_cell_pt(2)); + else if (GeometryInfo::unit_normal_direction[face_no] == 2) + unit_face_pt = Point(unit_cell_pt(0), unit_cell_pt(1)); + } + + return unit_face_pt; +} /*------------------------------ InternalDataBase ------------------------------*/ @@ -67,6 +96,8 @@ Mapping::InternalDataBase::memory_consumption () const } + + /*------------------------------ InternalData ------------------------------*/ -- 2.39.5