From: David Wells Date: Thu, 10 Aug 2017 22:49:07 +0000 (-0400) Subject: Add additional functions to InvalidAccessor. X-Git-Tag: v9.0.0-rc1~1303^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4777%2Fhead;p=dealii.git Add additional functions to InvalidAccessor. This was originally written by Luca Heltai and is necessary for the patch removing the Boundary classes. --- diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index dc5531a534..0ce10cea06 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -563,6 +563,23 @@ public: * Dummy function that always returns numbers::invalid_manifold_id. */ types::manifold_id manifold_id () const; + + /** + * Dummy function to extract vertices. Returns the origin. + */ + Point &vertex (const unsigned int i) const; + + /** + * Dummy function to extract lines. Returns a default-constructed line iterator. + */ + typename dealii::internal::Triangulation::Iterators::line_iterator + line (const unsigned int i) const; + + /** + * Dummy function to extract quads. Returns a default-constructed quad iterator. + */ + typename dealii::internal::Triangulation::Iterators::quad_iterator + quad (const unsigned int i) const; }; diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 6529d22ab9..65a88f78a0 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -519,6 +519,40 @@ InvalidAccessor::manifold_id () const } +template +inline +Point & +InvalidAccessor::vertex (const unsigned int) const +{ + // nothing to do here. we could throw an exception but we can't get here + // without first creating an object which would have already thrown + static Point invalid_vertex; + return invalid_vertex; +} + + +template +inline +typename dealii::internal::Triangulation::Iterators::line_iterator +InvalidAccessor::line (const unsigned int) const +{ + // nothing to do here. we could throw an exception but we can't get here + // without first creating an object which would have already thrown + return typename dealii::internal::Triangulation::Iterators::line_iterator(); +} + + + +template +inline +typename dealii::internal::Triangulation::Iterators::quad_iterator +InvalidAccessor::quad (const unsigned int) const +{ + // nothing to do here. we could throw an exception but we can't get here + // without first creating an object which would have already thrown + return dealii::internal::Triangulation::Iterators::quad_iterator(); +} + /*------------------------ Functions: TriaAccessor ---------------------------*/