From e1d65177ed608383a0a35927f36a45c247f74c1c Mon Sep 17 00:00:00 2001 From: hartmann Date: Fri, 15 Feb 2008 15:02:33 +0000 Subject: [PATCH] Implementation of a new FEFaceValuesBase::get_face_index() function which returns the index of the face selected the last time the reinit() function was called. git-svn-id: https://svn.dealii.org/trunk@15743 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_values.h | 23 +++++++++++++++ deal.II/deal.II/source/fe/fe_values.cc | 40 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index b675d6e4d6..f2e9e34210 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -2077,6 +2077,13 @@ class FEFaceValuesBase : public FEValuesBase */ const std::vector > & get_boundary_forms () const; + /** + * Return the index of the face + * selected the last time the + * reinit() function was called. + */ + unsigned int get_face_index() const; + /** * Return a reference to the copy * of the quadrature formula @@ -2092,6 +2099,14 @@ class FEFaceValuesBase : public FEValuesBase unsigned int memory_consumption () const; protected: + + /** + * Index of the face selected the + * last time the reinit() + * function was called. + */ + unsigned int present_face_index; + /** * Store a copy of the quadrature * formula here. @@ -2964,6 +2979,14 @@ FEFaceValuesBase::normal_vector (const unsigned int i) const } +template +inline +unsigned int +FEFaceValuesBase::get_face_index () const +{ + return present_face_index; +} + /*------------------------ Inline functions: FE*FaceValues --------------------*/ diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index 8408e3574c..866c10c757 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -1540,6 +1540,9 @@ void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &c (new typename FEValuesBase::template CellIterator::cell_iterator> (cell)); + // set the present face index + this->present_face_index=cell->face_index(face_no); + // this was the part of the work // that is dependent on the actual // data type of the iterator. now @@ -1575,6 +1578,9 @@ void FEFaceValues::reinit (const typename hp::DoFHandler::cell_iterato (new typename FEValuesBase::template CellIterator::cell_iterator> (cell)); + // set the present face index + this->present_face_index=cell->face_index(face_no); + // this was the part of the work // that is dependent on the actual // data type of the iterator. now @@ -1608,6 +1614,9 @@ void FEFaceValues::reinit (const typename MGDoFHandler::cell_iterator (new typename FEValuesBase::template CellIterator::cell_iterator> (cell)); + // set the present face index + this->present_face_index=cell->face_index(face_no); + // this was the part of the work // that is dependent on the actual // data type of the iterator. now @@ -1632,6 +1641,9 @@ void FEFaceValues::reinit (const typename Triangulation::cell_iterator this->present_cell.reset (new typename FEValuesBase::TriaCellIterator (cell)); + // set the present face index + this->present_face_index=cell->face_index(face_no); + // this was the part of the work // that is dependent on the actual // data type of the iterator. now @@ -1765,6 +1777,13 @@ void FESubfaceValues::reinit (const typename DoFHandler::cell_iterator ExcMessage ("You can't use subface data for cells that are " "already refined. Iterate over their children " "instead in these cases.")); + + // set the present face index + unsigned int real_subface_no=subface_no; + if (dim==3) + real_subface_no=GeometryInfo::standard_to_real_face_vertex( + subface_no, cell->face_orientation(face_no), cell->face_flip(face_no), cell->face_rotation(face_no)); + this->present_face_index=cell->face(face_no)->child_index(real_subface_no); // set new cell. auto_ptr will take // care that old object gets @@ -1816,6 +1835,13 @@ void FESubfaceValues::reinit (const typename hp::DoFHandler::cell_iter (new typename FEValuesBase::template CellIterator::cell_iterator> (cell)); + // set the present face index + unsigned int real_subface_no=subface_no; + if (dim==3) + real_subface_no=GeometryInfo::standard_to_real_face_vertex( + subface_no, cell->face_orientation(face_no), cell->face_flip(face_no), cell->face_rotation(face_no)); + this->present_face_index=cell->face(face_no)->child_index(real_subface_no); + // this was the part of the work // that is dependent on the actual // data type of the iterator. now @@ -1851,6 +1877,13 @@ void FESubfaceValues::reinit (const typename MGDoFHandler::cell_iterat (new typename FEValuesBase::template CellIterator::cell_iterator> (cell)); + // set the present face index + unsigned int real_subface_no=subface_no; + if (dim==3) + real_subface_no=GeometryInfo::standard_to_real_face_vertex( + subface_no, cell->face_orientation(face_no), cell->face_flip(face_no), cell->face_rotation(face_no)); + this->present_face_index=cell->face(face_no)->child_index(real_subface_no); + // this was the part of the work // that is dependent on the actual // data type of the iterator. now @@ -1879,6 +1912,13 @@ void FESubfaceValues::reinit (const typename Triangulation::cell_itera this->present_cell.reset (new typename FEValuesBase::TriaCellIterator (cell)); + // set the present face index + unsigned int real_subface_no=subface_no; + if (dim==3) + real_subface_no=GeometryInfo::standard_to_real_face_vertex( + subface_no, cell->face_orientation(face_no), cell->face_flip(face_no), cell->face_rotation(face_no)); + this->present_face_index=cell->face(face_no)->child_index(real_subface_no); + // this was the part of the work // that is dependent on the actual // data type of the iterator. now -- 2.39.5