From f0c0a6cfe0078d2a2a4885d2beec409cb2e20a36 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 8 Nov 2010 20:47:09 +0000 Subject: [PATCH] More steps towards compiling each file only once. git-svn-id: https://svn.dealii.org/trunk@22641 0785d39b-7218-0410-832d-ea1e28bc413d --- ...k_info.cc => block_info.all_dimensions.cc} | 12 +- deal.II/source/dofs/block_info.inst.in | 26 +++ ...ssor.cc => dof_accessor.all_dimensions.cc} | 134 +-------------- deal.II/source/dofs/dof_accessor.inst.in | 145 +++++++++++++++- ...f_faces.cc => dof_faces.all_dimensions.cc} | 14 +- .../source/dofs/dof_objects.all_dimensions.cc | 39 ++++- deal.II/source/dofs/dof_objects.cc | 155 ------------------ deal.II/source/dofs/dof_objects.inst.in | 60 +++++++ 8 files changed, 265 insertions(+), 320 deletions(-) rename deal.II/source/dofs/{block_info.cc => block_info.all_dimensions.cc} (76%) create mode 100644 deal.II/source/dofs/block_info.inst.in rename deal.II/source/dofs/{dof_accessor.cc => dof_accessor.all_dimensions.cc} (66%) rename deal.II/source/dofs/{dof_faces.cc => dof_faces.all_dimensions.cc} (85%) delete mode 100644 deal.II/source/dofs/dof_objects.cc create mode 100644 deal.II/source/dofs/dof_objects.inst.in diff --git a/deal.II/source/dofs/block_info.cc b/deal.II/source/dofs/block_info.all_dimensions.cc similarity index 76% rename from deal.II/source/dofs/block_info.cc rename to deal.II/source/dofs/block_info.all_dimensions.cc index e3b2991c6f..ef0c00742f 100644 --- a/deal.II/source/dofs/block_info.cc +++ b/deal.II/source/dofs/block_info.all_dimensions.cc @@ -72,15 +72,7 @@ BlockInfo::initialize(const MGDoFHandler& dof, bool levels_only) } -template void BlockInfo::initialize(const DoFHandler&); -template void BlockInfo::initialize(const MGDoFHandler&, bool); -template void BlockInfo::initialize_local(const DoFHandler&); - -#if deal_II_dimension==1 || deal_II_dimension==2 -template void BlockInfo::initialize(const DoFHandler&); -template void BlockInfo::initialize(const MGDoFHandler&, bool); -template void BlockInfo::initialize_local(const DoFHandler&); -#endif - +// explicit instantiations +#include "block_info.inst" DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/source/dofs/block_info.inst.in b/deal.II/source/dofs/block_info.inst.in new file mode 100644 index 0000000000..2657e3425d --- /dev/null +++ b/deal.II/source/dofs/block_info.inst.in @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 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 void BlockInfo::initialize(const DoFHandler&); + template void BlockInfo::initialize(const MGDoFHandler&, bool); + template void BlockInfo::initialize_local(const DoFHandler&); + +#if deal_II_dimension < 3 + template void BlockInfo::initialize(const DoFHandler&); + template void BlockInfo::initialize(const MGDoFHandler&, bool); + template void BlockInfo::initialize_local(const DoFHandler&); +#endif + } + diff --git a/deal.II/source/dofs/dof_accessor.cc b/deal.II/source/dofs/dof_accessor.all_dimensions.cc similarity index 66% rename from deal.II/source/dofs/dof_accessor.cc rename to deal.II/source/dofs/dof_accessor.all_dimensions.cc index 2cff208515..0763357d2f 100644 --- a/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/source/dofs/dof_accessor.all_dimensions.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors +// 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 @@ -247,137 +247,7 @@ set_dof_values_by_interpolation (const Vector &local_values, // -------------------------------------------------------------------------- -// explicit instantiations (for DoFHandler) - -#if deal_II_dimension == 1 -template class DoFAccessor<1, DoFHandler<1> >; -#endif - -#if deal_II_dimension == 2 -template class DoFAccessor<1, DoFHandler<2> >; -template class DoFAccessor<2, DoFHandler<2> >; - -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; -#endif - -#if deal_II_dimension == 3 -template class DoFAccessor<1, DoFHandler<3> >; -template class DoFAccessor<2, DoFHandler<3> >; -template class DoFAccessor<3, DoFHandler<3> >; - -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; -#endif - - -template class DoFCellAccessor >; - -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; - - -// -------------------------------------------------------------------------- -// explicit instantiations (for hp::DoFHandler) - -#if deal_II_dimension == 1 -template class DoFAccessor<1, hp::DoFHandler<1> >; -#endif - -#if deal_II_dimension == 2 -template class DoFAccessor<1, hp::DoFHandler<2> >; -template class DoFAccessor<2, hp::DoFHandler<2> >; - -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; -#endif - - -#if deal_II_dimension == 3 -template class DoFAccessor<1, hp::DoFHandler<3> >; -template class DoFAccessor<2, hp::DoFHandler<3> >; -template class DoFAccessor<3, hp::DoFHandler<3> >; - -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; -#endif - - -template class DoFCellAccessor >; - -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; - - - -// // -------------------------------------------------------------------------- -// // explicit instantiations (for DoFHandler) - -#if deal_II_dimension == 1 -template class DoFAccessor<1, DoFHandler<1,2> >; -#endif - -#if deal_II_dimension == 2 -template class DoFAccessor<1, DoFHandler<2,3> >; -template class DoFAccessor<2, DoFHandler<2,3> >; - -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; -#endif - - -#if deal_II_dimension != 3 -template class DoFCellAccessor >; - -template class -TriaRawIterator > >; -template class -TriaIterator > >; -template class -TriaActiveIterator > >; -#endif - -// -------------------------------------------------------------------------- -// explicit instantiations (for hp::DoFHandler) - -#if deal_II_dimension == 1 -template class DoFAccessor<1, hp::DoFHandler<1,2> >; -#endif - -#if deal_II_dimension == 2 -template class DoFAccessor<1, hp::DoFHandler<2,3> >; -template class DoFAccessor<2, hp::DoFHandler<2,3> >; - -template class TriaRawIterator > >; -template class TriaIterator > >; -template class TriaActiveIterator > >; -#endif - -#if deal_II_dimension != 3 -template class DoFCellAccessor >; - -template class -TriaRawIterator > >; -template class -TriaIterator > >; -template class -TriaActiveIterator > >; -#endif - - +// explicit instantiations #include "dof_accessor.inst" DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/source/dofs/dof_accessor.inst.in b/deal.II/source/dofs/dof_accessor.inst.in index 26c3e8022e..5392e65cc1 100644 --- a/deal.II/source/dofs/dof_accessor.inst.in +++ b/deal.II/source/dofs/dof_accessor.inst.in @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -12,8 +12,143 @@ //--------------------------------------------------------------------------- -for (VEC : SERIAL_VECTORS; SCALAR : REAL_SCALARS) - { +// TODO: This could surely be made more systematic! +for (deal_II_dimension : DIMENSIONS) + { +// explicit instantiations (for DoFHandler) + +#if deal_II_dimension == 1 + template class DoFAccessor<1, DoFHandler<1> >; +#endif + +#if deal_II_dimension == 2 + template class DoFAccessor<1, DoFHandler<2> >; + template class DoFAccessor<2, DoFHandler<2> >; + + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; +#endif + +#if deal_II_dimension == 3 + template class DoFAccessor<1, DoFHandler<3> >; + template class DoFAccessor<2, DoFHandler<3> >; + template class DoFAccessor<3, DoFHandler<3> >; + + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; +#endif + + + template class DoFCellAccessor >; + + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; + + +// -------------------------------------------------------------------------- +// explicit instantiations (for hp::DoFHandler) + +#if deal_II_dimension == 1 + template class DoFAccessor<1, hp::DoFHandler<1> >; +#endif + +#if deal_II_dimension == 2 + template class DoFAccessor<1, hp::DoFHandler<2> >; + template class DoFAccessor<2, hp::DoFHandler<2> >; + + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; +#endif + + +#if deal_II_dimension == 3 + template class DoFAccessor<1, hp::DoFHandler<3> >; + template class DoFAccessor<2, hp::DoFHandler<3> >; + template class DoFAccessor<3, hp::DoFHandler<3> >; + + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; +#endif + + + template class DoFCellAccessor >; + + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; + + + +// // -------------------------------------------------------------------------- +// // explicit instantiations (for DoFHandler) + +#if deal_II_dimension == 1 + template class DoFAccessor<1, DoFHandler<1,2> >; +#endif + +#if deal_II_dimension == 2 + template class DoFAccessor<1, DoFHandler<2,3> >; + template class DoFAccessor<2, DoFHandler<2,3> >; + + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; +#endif + + +#if deal_II_dimension != 3 + template class DoFCellAccessor >; + + template class + TriaRawIterator > >; + template class + TriaIterator > >; + template class + TriaActiveIterator > >; +#endif + +// -------------------------------------------------------------------------- +// explicit instantiations (for hp::DoFHandler) + +#if deal_II_dimension == 1 + template class DoFAccessor<1, hp::DoFHandler<1,2> >; +#endif + +#if deal_II_dimension == 2 + template class DoFAccessor<1, hp::DoFHandler<2,3> >; + template class DoFAccessor<2, hp::DoFHandler<2,3> >; + + template class TriaRawIterator > >; + template class TriaIterator > >; + template class TriaActiveIterator > >; +#endif + +#if deal_II_dimension != 3 + template class DoFCellAccessor >; + + template class + TriaRawIterator > >; + template class + TriaIterator > >; + template class + TriaActiveIterator > >; +#endif + } + + +for (VEC : SERIAL_VECTORS; SCALAR : REAL_SCALARS; deal_II_dimension : DIMENSIONS) + { template void DoFCellAccessor >::get_interpolated_dof_values @@ -39,8 +174,8 @@ for (VEC : SERIAL_VECTORS; SCALAR : REAL_SCALARS) } -for (VEC : SERIAL_VECTORS; SCALAR : REAL_SCALARS) - { +for (VEC : SERIAL_VECTORS; SCALAR : REAL_SCALARS; deal_II_dimension : DIMENSIONS) + { template void DoFCellAccessor >::get_interpolated_dof_values diff --git a/deal.II/source/dofs/dof_faces.cc b/deal.II/source/dofs/dof_faces.all_dimensions.cc similarity index 85% rename from deal.II/source/dofs/dof_faces.cc rename to deal.II/source/dofs/dof_faces.all_dimensions.cc index c8468a649c..aae782c96b 100644 --- a/deal.II/source/dofs/dof_faces.cc +++ b/deal.II/source/dofs/dof_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 @@ -23,38 +23,26 @@ namespace internal { namespace DoFHandler { - -#if deal_II_dimension == 1 - unsigned int DoFFaces<1>::memory_consumption () const { return 0; } -#endif -#if deal_II_dimension == 2 - unsigned int DoFFaces<2>::memory_consumption () const { return MemoryConsumption::memory_consumption (lines); } -#endif -#if deal_II_dimension == 3 - unsigned int DoFFaces<3>::memory_consumption () const { return (MemoryConsumption::memory_consumption (quads) + MemoryConsumption::memory_consumption (lines) ); } - -#endif - } } diff --git a/deal.II/source/dofs/dof_objects.all_dimensions.cc b/deal.II/source/dofs/dof_objects.all_dimensions.cc index 17915c32cf..6a6cd0a734 100644 --- a/deal.II/source/dofs/dof_objects.all_dimensions.cc +++ b/deal.II/source/dofs/dof_objects.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 @@ -32,10 +32,39 @@ namespace internal } - // explicit instantiations - template unsigned int DoFObjects<1>::memory_consumption () const; - template unsigned int DoFObjects<2>::memory_consumption () const; - template unsigned int DoFObjects<3>::memory_consumption () const; + + template + template + void + DoFObjects:: + set_dof_index (const dealii::DoFHandler &dof_handler, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index) + { + Assert ((fe_index == dealii::DoFHandler::default_fe_index), + ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); + Assert (local_index(), + ExcIndexRange (local_index, 0, dof_handler.get_fe().template n_dofs_per_object())); + Assert (obj_index * dof_handler.get_fe().template n_dofs_per_object()+local_index + < + dofs.size(), + ExcInternalError()); + + dofs[obj_index * dof_handler.get_fe() + .template n_dofs_per_object() + local_index] = global_index; + } + } +} + + +// explicit instantiations +namespace internal +{ + namespace DoFHandler + { +#include "dof_objects.inst" } } diff --git a/deal.II/source/dofs/dof_objects.cc b/deal.II/source/dofs/dof_objects.cc deleted file mode 100644 index 104b2a6d85..0000000000 --- a/deal.II/source/dofs/dof_objects.cc +++ /dev/null @@ -1,155 +0,0 @@ -//--------------------------------------------------------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2006 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. -// -//--------------------------------------------------------------------------- - - -#include -#include -#include -#include -#include - -DEAL_II_NAMESPACE_OPEN - -namespace internal -{ - namespace DoFHandler - { - template - template - void - DoFObjects:: - set_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) - { - Assert ((fe_index == dealii::DoFHandler::default_fe_index), - ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - Assert (local_index(), - ExcIndexRange (local_index, 0, dof_handler.get_fe().template n_dofs_per_object())); - Assert (obj_index * dof_handler.get_fe().template n_dofs_per_object()+local_index - < - dofs.size(), - ExcInternalError()); - - dofs[obj_index * dof_handler.get_fe() - .template n_dofs_per_object() + local_index] = global_index; - } - -// explicit instantiations - - template class DoFObjects<1>; - - template - unsigned int - DoFObjects<1>:: - get_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const; - - template - void - DoFObjects<1>:: - set_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); - - - template class DoFObjects<2>; - - template - unsigned int - DoFObjects<2>:: - get_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const; - - template - void - DoFObjects<2>:: - set_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); - - template class DoFObjects<3>; - - template - unsigned int - DoFObjects<3>:: - get_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const; - - template - void - DoFObjects<3>:: - set_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); - - -#if deal_II_dimension!=3 - - template - unsigned int - DoFObjects<1>:: - get_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const; - - template - void - DoFObjects<1>:: - set_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); - - - template - unsigned int - DoFObjects<2>:: - get_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const; - - template - void - DoFObjects<2>:: - set_dof_index (const dealii::DoFHandler &dof_handler, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); - - -#endif - - - } -} - -DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/source/dofs/dof_objects.inst.in b/deal.II/source/dofs/dof_objects.inst.in new file mode 100644 index 0000000000..e3fcb7f220 --- /dev/null +++ b/deal.II/source/dofs/dof_objects.inst.in @@ -0,0 +1,60 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// 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 +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------------------- + + +for (deal_II_dimension : DIMENSIONS) + { + template class DoFObjects; + } + + +for (deal_II_dimension, structdim : DIMENSIONS) + { + template + unsigned int + DoFObjects:: + get_dof_index (const dealii::DoFHandler &dof_handler, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index) const; + + template + void + DoFObjects:: + set_dof_index (const dealii::DoFHandler &dof_handler, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index); + +#if (deal_II_dimension < 3) && (structdim < 3) + + template + unsigned int + DoFObjects:: + get_dof_index (const dealii::DoFHandler &dof_handler, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index) const; + + template + void + DoFObjects:: + set_dof_index (const dealii::DoFHandler &dof_handler, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index); +#endif + } + -- 2.39.5