From 96192becf490ae617556343e73ad44e3260e6f3b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 9 Nov 2010 18:47:03 +0000 Subject: [PATCH] Convert the remaining files in this directory. git-svn-id: https://svn.dealii.org/trunk@22654 0785d39b-7218-0410-832d-ea1e28bc413d --- ...sor.cc => tria_accessor.all_dimensions.cc} | 93 +------------------ deal.II/source/grid/tria_accessor.inst.in | 93 +++++++++++++++++++ ...ary.cc => tria_boundary.all_dimensions.cc} | 40 ++------ deal.II/source/grid/tria_boundary.inst.in | 25 +++++ ...cc => tria_boundary_lib.all_dimensions.cc} | 78 ++++------------ deal.II/source/grid/tria_boundary_lib.inst.in | 28 ++++++ ..._faces.cc => tria_faces.all_dimensions.cc} | 13 +-- 7 files changed, 172 insertions(+), 198 deletions(-) rename deal.II/source/grid/{tria_accessor.cc => tria_accessor.all_dimensions.cc} (96%) create mode 100644 deal.II/source/grid/tria_accessor.inst.in rename deal.II/source/grid/{tria_boundary.cc => tria_boundary.all_dimensions.cc} (96%) create mode 100644 deal.II/source/grid/tria_boundary.inst.in rename deal.II/source/grid/{tria_boundary_lib.cc => tria_boundary_lib.all_dimensions.cc} (96%) create mode 100644 deal.II/source/grid/tria_boundary_lib.inst.in rename deal.II/source/grid/{tria_faces.cc => tria_faces.all_dimensions.cc} (86%) diff --git a/deal.II/source/grid/tria_accessor.cc b/deal.II/source/grid/tria_accessor.all_dimensions.cc similarity index 96% rename from deal.II/source/grid/tria_accessor.cc rename to deal.II/source/grid/tria_accessor.all_dimensions.cc index 4d9214845e..376c94744f 100644 --- a/deal.II/source/grid/tria_accessor.cc +++ b/deal.II/source/grid/tria_accessor.all_dimensions.cc @@ -895,7 +895,6 @@ namespace } -#if deal_II_dimension == 2 double measure (const TriaAccessor<2,2,2> &accessor) @@ -945,9 +944,6 @@ namespace return (-x[1]*y[0]+x[1]*y[3]+y[0]*x[2]+x[0]*y[1]-x[0]*y[2]-y[1]*x[3]-x[2]*y[3]+x[3]*y[2])/2; } -#endif - -#if deal_II_dimension == 3 double measure (const TriaAccessor<3, 3, 3> &accessor) @@ -960,7 +956,6 @@ namespace vertex_indices); } -#endif template @@ -1013,7 +1008,6 @@ measure () const } -#if deal_II_dimension == 1 template <> double TriaAccessor<1,1,1>::extent_in_direction(const unsigned int axis) const @@ -1023,7 +1017,6 @@ double TriaAccessor<1,1,1>::extent_in_direction(const unsigned int axis) const return this->diameter(); } -#elif deal_II_dimension == 2 template <> double TriaAccessor<2,2,2>::extent_in_direction(const unsigned int axis) const @@ -1037,7 +1030,6 @@ double TriaAccessor<2,2,2>::extent_in_direction(const unsigned int axis) const this->line(lines[axis][1])->diameter()); } -#elif deal_II_dimension == 3 template <> double TriaAccessor<3,3,3>::extent_in_direction(const unsigned int axis) const @@ -1057,17 +1049,11 @@ double TriaAccessor<3,3,3>::extent_in_direction(const unsigned int axis) const std::max(lengths[2], lengths[3])); } -#else - -// Not implemented for higher dimensions - -#endif /*------------------------ Functions: CellAccessor<1> -----------------------*/ -#if deal_II_dimension == 1 template <> bool CellAccessor<1>::point_inside (const Point<1> &p) const @@ -1086,13 +1072,10 @@ bool CellAccessor<1,2>::point_inside (const Point<2> &) const -#endif - /*------------------------ Functions: CellAccessor<2> -----------------------*/ -#if deal_II_dimension == 2 template <> bool CellAccessor<2>::point_inside (const Point<2> &p) const @@ -1157,13 +1140,11 @@ bool CellAccessor<2,3>::point_inside (const Point<3> &) const } -#endif /*------------------------ Functions: CellAccessor<3> -----------------------*/ -#if deal_II_dimension == 3 template <> bool CellAccessor<3>::point_inside (const Point<3> &p) const @@ -1204,7 +1185,6 @@ bool CellAccessor<3>::point_inside (const Point<3> &p) const } -#endif /*------------------------ Functions: CellAccessor -----------------------*/ @@ -1290,7 +1270,7 @@ CellAccessor::parent () const Assert (this->present_level > 0, TriaAccessorExceptions::ExcCellHasNoParent ()); TriaIterator > q (this->tria, this->present_level-1, this->parent_index ()); - + return q; } @@ -1984,76 +1964,7 @@ neighbor_child_on_subface (const unsigned int face, // For more information, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24331 // explicit instantiations -template class TriaAccessorBase<1,deal_II_dimension>; -#if deal_II_dimension >= 2 -template class TriaAccessorBase<2,deal_II_dimension>; -#endif -#if deal_II_dimension >= 3 -template class TriaAccessorBase<3,deal_II_dimension>; -#endif - -template class TriaAccessor<1,deal_II_dimension,deal_II_dimension>; -#if deal_II_dimension >= 2 -template class TriaAccessor<2,deal_II_dimension,deal_II_dimension>; -#endif -#if deal_II_dimension >= 3 -template class TriaAccessor<3,deal_II_dimension,deal_II_dimension>; -#endif - - -template class CellAccessor; -template class TriaRawIterator >; -template class TriaRawIterator >; -template class TriaIterator >; -template class TriaIterator >; -template class TriaActiveIterator >; -template class TriaActiveIterator >; - - -#if deal_II_dimension >= 2 -template class TriaRawIterator >; -template class TriaIterator >; -template class TriaActiveIterator >; -#endif - -#if deal_II_dimension >= 3 -template class TriaRawIterator >; -template class TriaIterator >; -template class TriaActiveIterator >; -#endif - -#if deal_II_dimension == 1 -template class TriaAccessorBase<1,deal_II_dimension,2>; -template class TriaAccessorBase<1,deal_II_dimension,3>; - -template class TriaAccessor<1,deal_II_dimension,2>; -template class TriaAccessor<1,deal_II_dimension,3>; -#endif -#if deal_II_dimension == 2 -template class TriaAccessorBase<1,deal_II_dimension,3>; -template class TriaAccessorBase<2,deal_II_dimension,3>; - -template class TriaAccessor<1,deal_II_dimension,3>; -template class TriaAccessor<2,deal_II_dimension,3>; -#endif - -#if deal_II_dimension != 3 -template class CellAccessor; -template class TriaRawIterator >; -template class TriaRawIterator >; -template class TriaIterator >; -template class TriaIterator >; -template class TriaActiveIterator >; -template class TriaActiveIterator >; - - -#if deal_II_dimension == 2 -template class TriaRawIterator >; -template class TriaIterator >; -template class TriaActiveIterator >; -#endif - -#endif +#include "tria_accessor.inst" DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/source/grid/tria_accessor.inst.in b/deal.II/source/grid/tria_accessor.inst.in new file mode 100644 index 0000000000..7c4aba537f --- /dev/null +++ b/deal.II/source/grid/tria_accessor.inst.in @@ -0,0 +1,93 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------------------- + + +for (deal_II_dimension : DIMENSIONS) + { +// Remark: The explicit instantiations for "TriaAccessor" were moved +// to the top of this source file. The reason is a slightly buggy version +// of the Apple gcc v.3.3. +// For more information, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24331 + template class TriaAccessorBase<1,deal_II_dimension>; +#if deal_II_dimension >= 2 + template class TriaAccessorBase<2,deal_II_dimension>; +#endif +#if deal_II_dimension >= 3 + template class TriaAccessorBase<3,deal_II_dimension>; +#endif + + template class TriaAccessor<1,deal_II_dimension,deal_II_dimension>; +#if deal_II_dimension >= 2 + template class TriaAccessor<2,deal_II_dimension,deal_II_dimension>; +#endif +#if deal_II_dimension >= 3 + template class TriaAccessor<3,deal_II_dimension,deal_II_dimension>; +#endif + + + template class CellAccessor; + template class TriaRawIterator >; + template class TriaRawIterator >; + template class TriaIterator >; + template class TriaIterator >; + template class TriaActiveIterator >; + template class TriaActiveIterator >; + + +#if deal_II_dimension >= 2 + template class TriaRawIterator >; + template class TriaIterator >; + template class TriaActiveIterator >; +#endif + +#if deal_II_dimension >= 3 + template class TriaRawIterator >; + template class TriaIterator >; + template class TriaActiveIterator >; +#endif + +#if deal_II_dimension == 1 + template class TriaAccessorBase<1,deal_II_dimension,2>; + template class TriaAccessorBase<1,deal_II_dimension,3>; + + template class TriaAccessor<1,deal_II_dimension,2>; + template class TriaAccessor<1,deal_II_dimension,3>; +#endif +#if deal_II_dimension == 2 + template class TriaAccessorBase<1,deal_II_dimension,3>; + template class TriaAccessorBase<2,deal_II_dimension,3>; + + template class TriaAccessor<1,deal_II_dimension,3>; + template class TriaAccessor<2,deal_II_dimension,3>; +#endif + +#if deal_II_dimension != 3 + template class CellAccessor; + template class TriaRawIterator >; + template class TriaRawIterator >; + template class TriaIterator >; + template class TriaIterator >; + template class TriaActiveIterator >; + template class TriaActiveIterator >; + + +#if deal_II_dimension == 2 + template class TriaRawIterator >; + template class TriaIterator >; + template class TriaActiveIterator >; +#endif + +#endif + } + + diff --git a/deal.II/source/grid/tria_boundary.cc b/deal.II/source/grid/tria_boundary.all_dimensions.cc similarity index 96% rename from deal.II/source/grid/tria_boundary.cc rename to deal.II/source/grid/tria_boundary.all_dimensions.cc index e9aefe59d4..bb3e51dc4b 100644 --- a/deal.II/source/grid/tria_boundary.cc +++ b/deal.II/source/grid/tria_boundary.all_dimensions.cc @@ -64,7 +64,6 @@ get_intermediate_points_on_quad (const typename Triangulation::qu } -#if deal_II_dimension > 1 template Point @@ -106,7 +105,7 @@ get_intermediate_points_on_face (const typename Triangulation::fac } } -#else + template <> Point<1> @@ -150,7 +149,6 @@ get_intermediate_points_on_face (const Triangulation<1,2>::face_iterator &, -#endif template void @@ -310,7 +308,6 @@ namespace } -#if deal_II_dimension < 3 template Point @@ -321,7 +318,7 @@ get_new_point_on_quad (const typename Triangulation::quad_iterato return Point(); } -#if deal_II_dimension == 2 + template <> Point<3> StraightBoundary<2,3>:: @@ -330,8 +327,7 @@ get_new_point_on_quad (const Triangulation<2,3>::quad_iterator &quad) const return compute_new_point_on_quad<2> (quad); } -#endif -#else + template <> Point<3> @@ -341,11 +337,8 @@ get_new_point_on_quad (const Triangulation<3>::quad_iterator &quad) const return compute_new_point_on_quad<3> (quad); } -#endif -#if deal_II_dimension == 1 - template <> void StraightBoundary<1>:: @@ -375,7 +368,7 @@ get_intermediate_points_on_line (const Triangulation<1, 2>::line_iterator &line, points[i] = (1-x)*vertices[0] + x*vertices[1]; } -#else + template @@ -397,11 +390,8 @@ get_intermediate_points_on_line (const typename Triangulation::li points[i] = (1-x)*vertices[0] + x*vertices[1]; } -#endif - -#if deal_II_dimension < 3 template void @@ -412,7 +402,7 @@ get_intermediate_points_on_quad (const typename Triangulation::qu Assert(false, ExcImpossibleInDim(dim)); } -#else + template <> void @@ -446,9 +436,7 @@ get_intermediate_points_on_quad (const Triangulation<3>::quad_iterator &quad, } } -#endif -#if deal_II_dimension == 2 template <> void @@ -481,11 +469,8 @@ get_intermediate_points_on_quad (const Triangulation<2,3>::quad_iterator &quad, x * vertices[3]) * y; } } -#endif - -#if deal_II_dimension == 1 template <> void @@ -505,10 +490,7 @@ get_normals_at_vertices (const Triangulation<1,2>::face_iterator &, Assert (false, ExcNotImplemented()); } -#endif - -#if deal_II_dimension == 2 template <> void @@ -537,12 +519,9 @@ get_normals_at_vertices (const Triangulation<2,3>::face_iterator &face, Assert(false, ExcNotImplemented()); } -#endif -#if deal_II_dimension == 3 - template <> void StraightBoundary<3>:: @@ -576,7 +555,6 @@ get_normals_at_vertices (const Triangulation<3>::face_iterator &face, }; } -#endif template @@ -765,13 +743,7 @@ project_to_surface (const typename Triangulation::hex_iterator &, // explicit instantiations -template class Boundary; -template class StraightBoundary; - -#if deal_II_dimension == 1 || deal_II_dimension == 2 -template class Boundary; -template class StraightBoundary; -#endif +#include "tria_boundary.inst" DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/source/grid/tria_boundary.inst.in b/deal.II/source/grid/tria_boundary.inst.in new file mode 100644 index 0000000000..d404a8514d --- /dev/null +++ b/deal.II/source/grid/tria_boundary.inst.in @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------------------- + +for (deal_II_dimension : DIMENSIONS) + { + template class Boundary; + template class StraightBoundary; + +#if deal_II_dimension == 1 || deal_II_dimension == 2 + template class Boundary; + template class StraightBoundary; +#endif + } + + diff --git a/deal.II/source/grid/tria_boundary_lib.cc b/deal.II/source/grid/tria_boundary_lib.all_dimensions.cc similarity index 96% rename from deal.II/source/grid/tria_boundary_lib.cc rename to deal.II/source/grid/tria_boundary_lib.all_dimensions.cc index ce03ff0286..82ea809227 100644 --- a/deal.II/source/grid/tria_boundary_lib.cc +++ b/deal.II/source/grid/tria_boundary_lib.all_dimensions.cc @@ -19,9 +19,9 @@ #include #include -DEAL_II_NAMESPACE_OPEN +DEAL_II_NAMESPACE_OPEN @@ -88,7 +88,6 @@ get_new_point_on_line (const typename Triangulation::line_iterator &line) c } -#if deal_II_dimension >=3 template<> Point<3> @@ -109,7 +108,6 @@ get_new_point_on_quad (const Triangulation<3>::quad_iterator &quad) const point_on_axis); } -#endif template @@ -167,7 +165,6 @@ CylinderBoundary::get_intermediate_points_between_points ( } -#if deal_II_dimension == 3 template <> void @@ -199,7 +196,6 @@ CylinderBoundary<3>::get_intermediate_points_on_quad ( } } -#endif template @@ -213,7 +209,6 @@ CylinderBoundary::get_intermediate_points_on_quad ( -#if deal_II_dimension == 1 template <> void @@ -224,7 +219,6 @@ get_normals_at_vertices (const Triangulation<1>::face_iterator &, Assert (false, ExcImpossibleInDim(1)); } -#endif template @@ -335,13 +329,14 @@ get_new_point_on_line (const typename Triangulation::line_iterator &line) c } -#if deal_II_dimension == 3 -template -Point -ConeBoundary:: -get_new_point_on_quad (const typename Triangulation::quad_iterator &quad) const +template <> +Point<3> +ConeBoundary<3>:: +get_new_point_on_quad (const Triangulation<3>::quad_iterator &quad) const { + const int dim = 3; + const Point axis = x_1 - x_0; // Compute the middle point of the // quad. @@ -360,7 +355,7 @@ get_new_point_on_quad (const typename Triangulation::quad_iterator &quad) c return middle_p + get_radius (middle_p) * (middle - middle_p) / (middle - middle_p).norm (); } -#else + template Point @@ -372,7 +367,7 @@ get_new_point_on_quad (const typename Triangulation::quad_iterator &) const return Point(); } -#endif + template void @@ -387,7 +382,7 @@ get_intermediate_points_on_line (const typename Triangulation::line_iterato } -#if deal_II_dimension == 3 + template<> void @@ -423,7 +418,7 @@ get_intermediate_points_on_quad (const Triangulation<3>::quad_iterator &quad, } } -#endif + template void @@ -435,7 +430,7 @@ get_intermediate_points_on_quad (const typename Triangulation::quad_iterato } -#if deal_II_dimension == 1 + template<> void @@ -446,7 +441,7 @@ get_normals_at_vertices (const Triangulation<1>::face_iterator &, Assert (false, ExcImpossibleInDim (1)); } -#endif + template void @@ -509,8 +504,6 @@ HyperBallBoundary::get_new_point_on_line (const typename Triangula -#if deal_II_dimension == 1 - template <> Point<1> HyperBallBoundary<1,1>:: @@ -529,8 +522,6 @@ get_new_point_on_quad (const Triangulation<1,2>::quad_iterator &) const return Point<2>(); } -#endif - template @@ -558,7 +549,6 @@ get_new_point_on_quad (const typename Triangulation::quad_iterator } -#if deal_II_dimension == 1 template <> void @@ -569,7 +559,6 @@ HyperBallBoundary<1>::get_intermediate_points_on_line ( Assert (false, ExcImpossibleInDim(1)); } -#endif template @@ -664,7 +653,7 @@ HyperBallBoundary::get_intermediate_points_between_points ( } } -#if deal_II_dimension == 3 + template <> void @@ -696,11 +685,8 @@ HyperBallBoundary<3>::get_intermediate_points_on_quad ( } } -#endif -#if deal_II_dimension == 2 - template <> void HyperBallBoundary<2,3>::get_intermediate_points_on_quad ( @@ -731,7 +717,7 @@ HyperBallBoundary<2,3>::get_intermediate_points_on_quad ( } } -#endif + template void @@ -744,8 +730,6 @@ HyperBallBoundary::get_intermediate_points_on_quad ( -#if deal_II_dimension == 1 - template <> void HyperBallBoundary<1>:: @@ -764,7 +748,6 @@ get_normals_at_vertices (const Triangulation<1,2>::face_iterator &, Assert (false, ExcImpossibleInDim(1)); } -#endif template @@ -826,8 +809,6 @@ get_new_point_on_line (const typename Triangulation::line_iterator &line) c -#if deal_II_dimension == 1 - template <> Point<1> HalfHyperBallBoundary<1>:: @@ -837,8 +818,6 @@ get_new_point_on_quad (const Triangulation<1>::quad_iterator &) const return Point<1>(); } -#endif - template @@ -897,7 +876,6 @@ get_intermediate_points_on_quad (const typename Triangulation::quad_iterato } -#if deal_II_dimension == 1 template <> void @@ -908,10 +886,7 @@ get_intermediate_points_on_quad (const Triangulation<1>::quad_iterator &, Assert (false, ExcInternalError()); } -#endif - -#if deal_II_dimension == 1 template <> void @@ -922,7 +897,6 @@ get_normals_at_vertices (const Triangulation<1>::face_iterator &, Assert (false, ExcImpossibleInDim(1)); } -#endif template @@ -1043,8 +1017,6 @@ get_new_point_on_line (const typename Triangulation::line_iterator &line) c -#if deal_II_dimension == 1 - template <> Point<1> HalfHyperShellBoundary<1>:: @@ -1054,7 +1026,6 @@ get_new_point_on_quad (const Triangulation<1>::quad_iterator &) const return Point<1>(); } -#endif @@ -1195,8 +1166,6 @@ get_intermediate_points_on_quad (const typename Triangulation::quad_iterato -#if deal_II_dimension == 1 - template <> void HalfHyperShellBoundary<1>:: @@ -1206,12 +1175,8 @@ get_intermediate_points_on_quad (const Triangulation<1>::quad_iterator &, Assert (false, ExcInternalError()); } -#endif - -#if deal_II_dimension == 1 - template <> void HalfHyperShellBoundary<1>:: @@ -1221,7 +1186,7 @@ get_normals_at_vertices (const Triangulation<1>::face_iterator &, Assert (false, ExcImpossibleInDim(1)); } -#endif + @@ -1240,16 +1205,7 @@ get_normals_at_vertices (const typename Triangulation::face_iterator &face, // explicit instantiations -template class CylinderBoundary; -template class ConeBoundary; -template class HyperBallBoundary; -template class HalfHyperBallBoundary; -template class HyperShellBoundary; -template class HalfHyperShellBoundary; - -#if deal_II_dimension != 3 -template class HyperBallBoundary; -#endif +#include "tria_boundary_lib.inst" DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/source/grid/tria_boundary_lib.inst.in b/deal.II/source/grid/tria_boundary_lib.inst.in new file mode 100644 index 0000000000..79b58d4f2f --- /dev/null +++ b/deal.II/source/grid/tria_boundary_lib.inst.in @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------------------- + +for (deal_II_dimension : DIMENSIONS) + { + template class CylinderBoundary; + template class ConeBoundary; + template class HyperBallBoundary; + template class HalfHyperBallBoundary; + template class HyperShellBoundary; + template class HalfHyperShellBoundary; + +#if deal_II_dimension != 3 + template class HyperBallBoundary; +#endif + } + + diff --git a/deal.II/source/grid/tria_faces.cc b/deal.II/source/grid/tria_faces.all_dimensions.cc similarity index 86% rename from deal.II/source/grid/tria_faces.cc rename to deal.II/source/grid/tria_faces.all_dimensions.cc index f86469b224..45d7cc0108 100644 --- a/deal.II/source/grid/tria_faces.cc +++ b/deal.II/source/grid/tria_faces.all_dimensions.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2006 by the deal.II authors +// Copyright (C) 2006, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -22,17 +22,12 @@ namespace internal namespace Triangulation { -#if deal_II_dimension == 1 - unsigned int TriaFaces<1>::memory_consumption () const { return 0; } -#endif - -#if deal_II_dimension == 2 unsigned int TriaFaces<2>::memory_consumption () const @@ -40,9 +35,6 @@ namespace internal return MemoryConsumption::memory_consumption (lines); } -#endif - -#if deal_II_dimension == 3 unsigned int TriaFaces<3>::memory_consumption () const @@ -50,9 +42,6 @@ namespace internal return (MemoryConsumption::memory_consumption (quads) + MemoryConsumption::memory_consumption (lines) ); } - -#endif - } } -- 2.39.5