From: hartmann Date: Mon, 28 Jun 2004 10:43:46 +0000 (+0000) Subject: Add missing reinit functions taking MGDoFHandler::cell_iterators. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c4adaafc548a9728e7d8bce791b3af7fdfb46f8;p=dealii-svn.git Add missing reinit functions taking MGDoFHandler::cell_iterators. git-svn-id: https://svn.dealii.org/trunk@9472 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 18a620e161..24fd2e44fc 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -1720,6 +1720,22 @@ class FEFaceValues : public FEFaceValuesBase */ void reinit (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no); + + /** + * Reinitialize the gradients, + * Jacobi determinants, etc for + * the given cell of type + * "iterator into a MGDoFHandler + * object", and the finite + * element associated with this + * object. It is assumed that the + * finite element used by the + * given cell is also the one + * used by this @p FEValues + * object. + */ + void reinit (const typename MGDoFHandler::cell_iterator &cell, + const unsigned int face_no); /** * Reinitialize the gradients, @@ -1835,6 +1851,23 @@ class FESubfaceValues : public FEFaceValuesBase * @p FESubfaceValues object. */ void reinit (const typename DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no); + + /** + * Reinitialize the gradients, + * Jacobi determinants, etc for + * the given cell of type + * "iterator into a MGDoFHandler + * object", and the finite + * element associated with this + * object. It is assumed that the + * finite element used by the + * given cell is also the one + * used by this @p FEValues + * object. + */ + void reinit (const typename MGDoFHandler::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no); diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index 6ae075c98e..39a0d3e737 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -1045,6 +1045,39 @@ void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &c } +template +void FEFaceValues::reinit (const typename MGDoFHandler::cell_iterator &cell, + const unsigned int face_no) +{ + // assert that the finite elements + // passed to the constructor and + // used by the DoFHandler used by + // this cell, are the same + Assert (static_cast&>(*this->fe) == + static_cast&>(cell->get_dof_handler().get_fe()), + typename FEValuesBase::ExcFEDontMatch()); + + Assert (face_no < GeometryInfo::faces_per_cell, + ExcIndexRange (face_no, 0, GeometryInfo::faces_per_cell)); + + // set new cell. auto_ptr will take + // care that old object gets + // destroyed and also that this + // object gets destroyed in the + // destruction of this class + this->present_cell.reset + (new typename FEValuesBase::template + CellIterator::cell_iterator> (cell)); + + // this was the part of the work + // that is dependent on the actual + // data type of the iterator. now + // pass on to the function doing + // the real work. + do_reinit (face_no); +} + + template void FEFaceValues::reinit (const typename Triangulation::cell_iterator &cell, @@ -1192,6 +1225,46 @@ void FESubfaceValues::reinit (const typename DoFHandler::cell_iterator +template +void FESubfaceValues::reinit (const typename MGDoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no) +{ + // assert that the finite elements + // passed to the constructor and + // used by the DoFHandler used by + // this cell, are the same + Assert (static_cast&>(*this->fe) == + static_cast&>(cell->get_dof_handler().get_fe()), + typename FEValuesBase::ExcFEDontMatch()); + Assert (face_no < GeometryInfo::faces_per_cell, + ExcIndexRange (face_no, 0, GeometryInfo::faces_per_cell)); + Assert (subface_no < GeometryInfo::subfaces_per_face, + ExcIndexRange (subface_no, 0, GeometryInfo::subfaces_per_face)); + Assert (cell->has_children() == false, + ExcMessage ("You can't use subface data for cells that are " + "already refined. Iterate over their children " + "instead in these cases.")); + + // set new cell. auto_ptr will take + // care that old object gets + // destroyed and also that this + // object gets destroyed in the + // destruction of this class + this->present_cell.reset + (new typename FEValuesBase::template + CellIterator::cell_iterator> (cell)); + + // this was the part of the work + // that is dependent on the actual + // data type of the iterator. now + // pass on to the function doing + // the real work. + do_reinit (face_no, subface_no); +} + + + template void FESubfaceValues::reinit (const typename Triangulation::cell_iterator &cell, const unsigned int face_no,