From 9b4e2002c61cdd4c330cca03f6d4fb2694fe6cd9 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 3 Sep 2008 02:42:17 +0000 Subject: [PATCH] Instantiate a bunch of templates using the pre-processor. git-svn-id: https://svn.dealii.org/trunk@16719 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/common/template-arguments.in | 9 ++ deal.II/deal.II/source/grid/grid_tools.cc | 135 +----------------- .../deal.II/source/grid/grid_tools.inst.in | 50 +++++++ deal.II/deal.II/source/grid/intergrid_map.cc | 8 +- .../deal.II/source/grid/intergrid_map.inst.in | 19 +++ 5 files changed, 82 insertions(+), 139 deletions(-) create mode 100644 deal.II/deal.II/source/grid/grid_tools.inst.in create mode 100644 deal.II/deal.II/source/grid/intergrid_map.inst.in diff --git a/deal.II/common/template-arguments.in b/deal.II/common/template-arguments.in index c15d4524ed..5885944921 100644 --- a/deal.II/common/template-arguments.in +++ b/deal.II/common/template-arguments.in @@ -19,3 +19,12 @@ SERIAL_VECTORS := { Vector; @DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR@; @DEAL_II_EXPAND_PETSC_BLOCKVECTOR@; } + +DOFHANDLERS := { DoFHandler; + hp::DoFHandler; + MGDoFHandler } + +TRIANGULATION_AND_DOFHANDLERS := { Triangulation; + DoFHandler; + hp::DoFHandler; + MGDoFHandler } \ No newline at end of file diff --git a/deal.II/deal.II/source/grid/grid_tools.cc b/deal.II/deal.II/source/grid/grid_tools.cc index ec733f3fe4..cfa7f16573 100644 --- a/deal.II/deal.II/source/grid/grid_tools.cc +++ b/deal.II/deal.II/source/grid/grid_tools.cc @@ -1241,90 +1241,6 @@ template void GridTools::scale (const double, Triangulation &); -template -unsigned int -GridTools::find_closest_vertex (const Triangulation &, - const Point &); - -template -unsigned int -GridTools::find_closest_vertex (const DoFHandler &, - const Point &); - -template -unsigned int -GridTools::find_closest_vertex (const hp::DoFHandler &, - const Point &); - -template -unsigned int -GridTools::find_closest_vertex (const MGDoFHandler &, - const Point &); - -template -std::vector::active_cell_iterator> -GridTools::find_cells_adjacent_to_vertex(const Triangulation &, - const unsigned int); - -template -std::vector::active_cell_iterator> -GridTools::find_cells_adjacent_to_vertex(const DoFHandler &, - const unsigned int); - -template -std::vector::active_cell_iterator> -GridTools::find_cells_adjacent_to_vertex(const hp::DoFHandler &, - const unsigned int); - -template -std::vector::active_cell_iterator> -GridTools::find_cells_adjacent_to_vertex(const MGDoFHandler &, - const unsigned int); - -template -Triangulation::active_cell_iterator -GridTools::find_active_cell_around_point (const Triangulation &, - const Point &p); - -template -DoFHandler::active_cell_iterator -GridTools::find_active_cell_around_point (const DoFHandler &, - const Point &p); - -template -hp::DoFHandler::active_cell_iterator -GridTools::find_active_cell_around_point (const hp::DoFHandler &, - const Point &p); - -template -MGDoFHandler::active_cell_iterator -GridTools::find_active_cell_around_point (const MGDoFHandler &, - const Point &p); - -template -std::pair::active_cell_iterator, Point > -GridTools::find_active_cell_around_point (const Mapping &, - const Triangulation &, - const Point &); - -template -std::pair::active_cell_iterator, Point > -GridTools::find_active_cell_around_point (const Mapping &, - const DoFHandler &, - const Point &); - -template -std::pair::active_cell_iterator, Point > -GridTools::find_active_cell_around_point (const Mapping &, - const MGDoFHandler &, - const Point &); - -template -std::pair::active_cell_iterator, Point > -GridTools::find_active_cell_around_point (const Mapping &, - const hp::DoFHandler &, - const Point &); - template std::pair::active_cell_iterator, Point > GridTools::find_active_cell_around_point (const hp::MappingCollection &, @@ -1355,55 +1271,6 @@ count_cells_with_subdomain_association (const Triangulation & const unsigned int ); -template -std::list::cell_iterator, - Triangulation::cell_iterator> > -GridTools:: -get_finest_common_cells (const Triangulation &mesh_1, - const Triangulation &mesh_2); - -template -std::list::cell_iterator, - DoFHandler::cell_iterator> > -GridTools:: -get_finest_common_cells (const DoFHandler &mesh_1, - const DoFHandler &mesh_2); - -template -std::list::cell_iterator, - hp::DoFHandler::cell_iterator> > -GridTools:: -get_finest_common_cells (const hp::DoFHandler &mesh_1, - const hp::DoFHandler &mesh_2); - -template -std::list::cell_iterator, - MGDoFHandler::cell_iterator> > -GridTools:: -get_finest_common_cells (const MGDoFHandler &mesh_1, - const MGDoFHandler &mesh_2); - - -template -bool -GridTools::have_same_coarse_mesh (const Triangulation &mesh_1, - const Triangulation &mesh_2); - -template -bool -GridTools::have_same_coarse_mesh (const DoFHandler &mesh_1, - const DoFHandler &mesh_2); - -template -bool -GridTools::have_same_coarse_mesh (const hp::DoFHandler &mesh_1, - const hp::DoFHandler &mesh_2); - -template -bool -GridTools::have_same_coarse_mesh (const MGDoFHandler &mesh_1, - const MGDoFHandler &mesh_2); - template double GridTools::minimal_cell_diameter (const Triangulation &triangulation); @@ -1418,5 +1285,7 @@ GridTools::create_union_triangulation (const Triangulation &t const Triangulation &triangulation_2, Triangulation &result); +#include "grid_tools.inst" + DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/deal.II/source/grid/grid_tools.inst.in b/deal.II/deal.II/source/grid/grid_tools.inst.in new file mode 100644 index 0000000000..5cdd4ccdb8 --- /dev/null +++ b/deal.II/deal.II/source/grid/grid_tools.inst.in @@ -0,0 +1,50 @@ +//--------------------------------------------------------------------------- +// $Id: grid_tools.cc 16506 2008-08-06 17:49:50Z bangerth $ +// Version: $Name$ +// +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 (X : TRIANGULATION_AND_DOFHANDLERS) +{ + template + unsigned int + GridTools::find_closest_vertex (const X &, + const Point &); + + template + std::vector + GridTools::find_cells_adjacent_to_vertex(const X &, + const unsigned int); + + template + X::active_cell_iterator + GridTools::find_active_cell_around_point (const X &, + const Point &p); + + template + std::pair > + GridTools::find_active_cell_around_point (const Mapping &, + const X &, + const Point &); + + template + std::list > + GridTools:: + get_finest_common_cells (const X &mesh_1, + const X &mesh_2); + + + template + bool + GridTools::have_same_coarse_mesh (const X &mesh_1, + const X &mesh_2); +} diff --git a/deal.II/deal.II/source/grid/intergrid_map.cc b/deal.II/deal.II/source/grid/intergrid_map.cc index d0ccbe2c55..0030deab7f 100644 --- a/deal.II/deal.II/source/grid/intergrid_map.cc +++ b/deal.II/deal.II/source/grid/intergrid_map.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -236,11 +236,7 @@ InterGridMap::memory_consumption () const // explicit instantiations -template class InterGridMap >; -template class InterGridMap >; - -template class InterGridMap >; -template class InterGridMap >; +#include "intergrid_map.inst" DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/deal.II/source/grid/intergrid_map.inst.in b/deal.II/deal.II/source/grid/intergrid_map.inst.in new file mode 100644 index 0000000000..62bd46485d --- /dev/null +++ b/deal.II/deal.II/source/grid/intergrid_map.inst.in @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +// $Id: intergrid_map.cc 16430 2008-07-08 15:25:01Z hartmann $ +// Version: $Name$ +// +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 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 (X : TRIANGULATION_AND_DOFHANDLERS) +{ + template class InterGridMap; +} -- 2.39.5