From 3467c85805c2c0d78279afdba0bf7b5588885e59 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 25 Feb 2023 15:41:16 -0700 Subject: [PATCH] Avoid some more instantiations of class Triangulation for invalid arguments. --- include/deal.II/dofs/dof_accessor.h | 8 +++--- include/deal.II/grid/tria_accessor.h | 18 ++++++------- .../deal.II/grid/tria_accessor.templates.h | 25 ++++++++----------- source/dofs/dof_accessor.cc | 2 +- 4 files changed, 23 insertions(+), 30 deletions(-) diff --git a/include/deal.II/dofs/dof_accessor.h b/include/deal.II/dofs/dof_accessor.h index 68be280fd9..ee4aa970da 100644 --- a/include/deal.II/dofs/dof_accessor.h +++ b/include/deal.II/dofs/dof_accessor.h @@ -1260,10 +1260,10 @@ public: * semantic sense, and we generate an exception when such an object is * actually generated. */ - DoFInvalidAccessor(const Triangulation *parent = 0, - const int level = -1, - const int index = -1, - const AccessorData * local_data = 0); + DoFInvalidAccessor(const void * parent = 0, + const int level = -1, + const int index = -1, + const AccessorData *local_data = 0); /** * Copy constructor. This class is used for iterators that do not make diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index d6c44e618d..eff7f3ff0d 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -605,10 +605,10 @@ public: * semantic sense, and we generate an exception when such an object is * actually generated. */ - InvalidAccessor(const Triangulation *parent = nullptr, - const int level = -1, - const int index = -1, - const AccessorData * local_data = nullptr); + InvalidAccessor(const void * parent = nullptr, + const int level = -1, + const int index = -1, + const AccessorData *local_data = nullptr); /** * Copy constructor. This class is used for iterators that do not make @@ -718,17 +718,15 @@ public: * Dummy function to extract lines. Returns a default-constructed line * iterator. */ - typename dealii::internal::TriangulationImplementation:: - Iterators::line_iterator - line(const unsigned int i) const; + void * + line(const unsigned int i) const; /** * Dummy function to extract quads. Returns a default-constructed quad * iterator. */ - typename dealii::internal::TriangulationImplementation:: - Iterators::quad_iterator - quad(const unsigned int i) const; + void * + 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 18920e2035..958f8d4913 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -375,11 +375,10 @@ TriaAccessorBase::objects() const /*---------------------- Functions: InvalidAccessor -------------------------*/ template -InvalidAccessor::InvalidAccessor( - const Triangulation *, - const int, - const int, - const AccessorData *) +InvalidAccessor::InvalidAccessor(const void *, + const int, + const int, + const AccessorData *) { Assert(false, ExcMessage("You are attempting an invalid conversion between " @@ -544,27 +543,23 @@ InvalidAccessor::vertex(const unsigned int) const template -inline typename dealii::internal::TriangulationImplementation:: - Iterators::line_iterator - InvalidAccessor::line(const unsigned int) const +inline void * +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::TriangulationImplementation:: - Iterators::line_iterator(); + return nullptr; } template -inline typename dealii::internal::TriangulationImplementation:: - Iterators::quad_iterator - InvalidAccessor::quad(const unsigned int) const +inline void * +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 typename dealii::internal::TriangulationImplementation:: - Iterators::quad_iterator(); + return nullptr; } diff --git a/source/dofs/dof_accessor.cc b/source/dofs/dof_accessor.cc index 6c5d023cb6..b9ff6a56d6 100644 --- a/source/dofs/dof_accessor.cc +++ b/source/dofs/dof_accessor.cc @@ -42,7 +42,7 @@ const unsigned int template DoFInvalidAccessor::DoFInvalidAccessor( - const Triangulation *, + const void *, const int, const int, const AccessorData *) -- 2.39.5