From c30be9917c48ce58565624af062e520c4a7950fa Mon Sep 17 00:00:00 2001 From: David Wells Date: Thu, 10 Aug 2017 18:49:07 -0400 Subject: [PATCH] Add additional functions to InvalidAccessor. This was originally written by Luca Heltai and is necessary for the patch removing the Boundary classes. --- include/deal.II/grid/tria_accessor.h | 17 ++++++++++ .../deal.II/grid/tria_accessor.templates.h | 34 +++++++++++++++++++ 2 files changed, 51 insertions(+) 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 ---------------------------*/ -- 2.39.5