From: Luca Heltai Date: Thu, 7 Aug 2014 13:04:09 +0000 (+0200) Subject: Merge pull request #63 from tamiko/fix_manifold_instantiations X-Git-Tag: v8.2.0-rc1~218 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abd3ff193624c9d25e3b5391148779aa171c03a9;p=dealii.git Merge pull request #63 from tamiko/fix_manifold_instantiations This commit reverts the quick fix in commit 982b0683. The issue why we encountered unresolved references to dealii::FlatManifold::FlatManifold(dealii::Point, double) etc. was due to boilerplate instantiations of Triangulation::get_manifold for cases with spacedim < dim (in order to make TriaAccessor happy). This commit fixes the issue by using a nullptr-dereference in order to return an invalid object - the specific code throws an error message before that and should actually not be reachable at all. --- abd3ff193624c9d25e3b5391148779aa171c03a9 diff --cc source/grid/tria.cc index 03380582b9,ff37b0787e..14da3cc2b9 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@@ -13272,27 -13290,33 +13272,36 @@@ Triangulation::remove_re } template <> -const Manifold<2,1> & Triangulation<2, 1>::get_manifold(const types::manifold_id) const { +const Manifold<2,1> &Triangulation<2, 1>::get_manifold(const types::manifold_id) const +{ Assert(false, ExcImpossibleInDim(1)); - static FlatManifold<2,1> flat; - return flat; + // We cannot simply create a temporary Manifold<2,1> because it is not + // instantiated and would lead to unresolved symbols. Given the fact that + // this function should be unreachable anyaway, just dereference a + // nullptr: + return *static_cast*>(0); } template <> -const Manifold<3,1> & Triangulation<3, 1>::get_manifold(const types::manifold_id) const { +const Manifold<3,1> &Triangulation<3, 1>::get_manifold(const types::manifold_id) const +{ Assert(false, ExcImpossibleInDim(1)); - static FlatManifold<3,1> flat; - return flat; + // We cannot simply create a temporary Manifold<2,1> because it is not + // instantiated and would lead to unresolved symbols. Given the fact that + // this function should be unreachable anyaway, just dereference a + // nullptr: + return *static_cast*>(0); } template <> -const Manifold<3,2> & Triangulation<3, 2>::get_manifold(const types::manifold_id) const { +const Manifold<3,2> &Triangulation<3, 2>::get_manifold(const types::manifold_id) const +{ Assert(false, ExcImpossibleInDim(2)); - static FlatManifold<3,2> flat; - return flat; + // We cannot simply create a temporary Manifold<2,1> because it is not + // instantiated and would lead to unresolved symbols. Given the fact that + // this function should be unreachable anyaway, just dereference a + // nullptr: + return *static_cast*>(0); } // explicit instantiations