From b0d0a39c02a96f1d18060f1ec141accd39b4f36d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 20 Nov 2018 08:28:14 -0700 Subject: [PATCH] Add get_triangulation() functions to TriaAccessor<0,*,structdim> classes. --- include/deal.II/grid/tria_accessor.h | 16 +++++++++++++++- include/deal.II/grid/tria_accessor.templates.h | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index 40ee283c6e..4124892bbf 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -488,7 +488,7 @@ public: state() const; /** - * Return a pointer to the triangulation which the object pointed to by this + * Return a reference to the triangulation which the object pointed to by this * class belongs to. */ const Triangulation & @@ -1794,6 +1794,13 @@ public: int index() const; + /** + * Return a reference to the triangulation which the object pointed to by this + * class belongs to. + */ + const Triangulation & + get_triangulation() const; + /** * @name Advancement of iterators */ @@ -2212,6 +2219,13 @@ public: int index() const; + /** + * Return a reference to the triangulation which the object pointed to by this + * class belongs to. + */ + const Triangulation<1, spacedim> & + get_triangulation() const; + /** * @name Advancement of iterators */ diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 45898346c6..bbb44552b7 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -2327,6 +2327,15 @@ TriaAccessor<0, dim, spacedim>::index() const +template +inline const Triangulation & +TriaAccessor<0, dim, spacedim>::get_triangulation() const +{ + return *tria; +} + + + template inline void TriaAccessor<0, dim, spacedim>::operator++() @@ -2698,6 +2707,15 @@ TriaAccessor<0, 1, spacedim>::index() const +template +inline const Triangulation<1, spacedim> & +TriaAccessor<0, 1, spacedim>::get_triangulation() const +{ + return *tria; +} + + + template inline void TriaAccessor<0, 1, spacedim>::operator++() const -- 2.39.5