From 270e19eef3211c83bb9b9596c575542c4dc53f32 Mon Sep 17 00:00:00 2001 From: Ralf Hartmann Date: Tue, 25 Mar 2008 14:51:50 +0000 Subject: [PATCH] Do the same in FESubfaceValues, i.e. avoid code duplication by moving common code from FESubfaceValues::reinit to do_reinit. git-svn-id: https://svn.dealii.org/trunk@15932 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/fe/fe_values.cc | 42 ++++++++------------------ 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index efcc7630cc..62247421f5 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -1772,15 +1772,6 @@ void FESubfaceValues::reinit (const typename DoFHandler::cell_iterator "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)); - if (cell->face(face_no)->has_children()) - this->present_face_index=cell->face(face_no)->child_index(real_subface_no); - else - this->present_face_index=cell->face_index(face_no); // set new cell. auto_ptr will take // care that old object gets // destroyed and also that this @@ -1831,13 +1822,6 @@ 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 @@ -1873,13 +1857,6 @@ 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 @@ -1908,13 +1885,6 @@ 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 @@ -1929,6 +1899,18 @@ template void FESubfaceValues::do_reinit (const unsigned int face_no, const unsigned int subface_no) { + + // set the present face index + const typename Triangulation::cell_iterator cell=*this->present_cell; + 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)); + if (cell->face(face_no)->has_children()) + this->present_face_index=cell->face(face_no)->child_index(real_subface_no); + else + this->present_face_index=cell->face_index(face_no); + this->get_mapping().fill_fe_subface_values(*this->present_cell, face_no, subface_no, this->quadrature, -- 2.39.5