From 5878babacb38ba51894fe907bec5e0c47e4f17d2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 29 Dec 2021 09:36:41 -0700 Subject: [PATCH] Provide an overload for TriaAccess<0,1,spacedim>::copy_from(). --- include/deal.II/grid/tria_accessor.h | 8 ++++++++ include/deal.II/grid/tria_accessor.templates.h | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index a095c8f36b..c6f9ff01e4 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -2384,6 +2384,14 @@ public: void copy_from(const TriaAccessor &); + /** + * Copy operator. We need this function to support generic + * programming, but it just throws an exception because it cannot do + * the required operations. + */ + void + copy_from(const TriaAccessorBase<0, 1, spacedim> &); + /** * Return the state of the iterator. Since an iterator to points can not be * incremented or decremented, its state remains constant, and in particular diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 70ad55af02..c93e2713ee 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -2769,6 +2769,19 @@ TriaAccessor<0, 1, spacedim>::copy_from(const TriaAccessor &t) +template +inline void +TriaAccessor<0, 1, spacedim>::copy_from( + const TriaAccessorBase<0, 1, spacedim> &) +{ + // We cannot convert from TriaAccessorBase to + // TriaAccessor<0,1,spacedim> because the latter is not derived from + // the former. We should never get here. + Assert(false, ExcInternalError()); +} + + + template inline bool TriaAccessor<0, 1, spacedim>::operator<( -- 2.39.5