]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
use automatic instantiation
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Nov 2011 20:26:28 +0000 (20:26 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Nov 2011 20:26:28 +0000 (20:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@24781 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/multigrid/mg_transfer.templates.h
deal.II/source/multigrid/mg_transfer_prebuilt.cc
deal.II/source/multigrid/mg_transfer_prebuilt.inst.in

index 97bab2de51465cefc141f5f202ea80758fe2df1d..094d00ae426564358bd0b29631ec125a94b3238a 100644 (file)
@@ -30,6 +30,42 @@ DEAL_II_NAMESPACE_OPEN
 
 
 
+template <class VECTOR>
+template <int dim, class InVector, int spacedim>
+void
+MGTransferPrebuilt<VECTOR>::copy_to_mg (
+  const MGDoFHandler<dim,spacedim>& mg_dof_handler,
+  MGLevelObject<VECTOR>& dst,
+  const InVector& src) const
+{
+  reinit_vector(mg_dof_handler, component_to_block_map, dst);
+  bool first = true;
+  for (unsigned int level=mg_dof_handler.get_tria().n_levels();level != 0;)
+    {
+      --level;
+      VECTOR& dst_level = dst[level];
+
+      typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+      for (IT i= copy_indices[level].begin();
+          i != copy_indices[level].end();++i)
+       dst_level(i->second) = src(i->first);
+
+                                      // For non-DG: degrees of
+                                      // freedom in the refinement
+                                      // face may need special
+                                      // attention, since they belong
+                                      // to the coarse level, but
+                                      // have fine level basis
+                                      // functions
+      if (!first)
+       restrict_and_add (level+1, dst[level], dst[level+1]);
+
+      first = false;
+    }
+}
+
+
+
 template <class VECTOR>
 template <int dim, class OutVector, int spacedim>
 void
index 2e658172cba383fc1925dffa7882fe814415220e..1c7bebce246eb54d3e9bbc230730add3bb96d7ff 100644 (file)
@@ -1,6 +1,5 @@
 //---------------------------------------------------------------------------
 //    $Id$
-//    Version: $Name$
 //
 //    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
 //
@@ -109,42 +108,6 @@ namespace
 
 
 
-template <class VECTOR>
-template <int dim, class InVector, int spacedim>
-void
-MGTransferPrebuilt<VECTOR>::copy_to_mg (
-  const MGDoFHandler<dim,spacedim>& mg_dof_handler,
-  MGLevelObject<VECTOR>& dst,
-  const InVector& src) const
-{
-  reinit_vector(mg_dof_handler, component_to_block_map, dst);
-  bool first = true;
-  for (unsigned int level=mg_dof_handler.get_tria().n_levels();level != 0;)
-    {
-      --level;
-      VECTOR& dst_level = dst[level];
-
-      typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
-      for (IT i= copy_indices[level].begin();
-          i != copy_indices[level].end();++i)
-       dst_level(i->second) = src(i->first);
-
-                                      // For non-DG: degrees of
-                                      // freedom in the refinement
-                                      // face may need special
-                                      // attention, since they belong
-                                      // to the coarse level, but
-                                      // have fine level basis
-                                      // functions
-      if (!first)
-       restrict_and_add (level+1, dst[level], dst[level+1]);
-
-      first = false;
-    }
-}
-
-
-
 template <typename VECTOR>
 template <int dim, int spacedim>
 void MGTransferPrebuilt<VECTOR>::build_matrices (
index 49660ae0bf88ebe2a3b16fa8110be5efa43d62f3..3fb5cdb8432c8d23fbda1852f3b9f5b347b644e4 100644 (file)
@@ -1,8 +1,7 @@
 //---------------------------------------------------------------------------
 //    $Id$
-//    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
 //---------------------------------------------------------------------------
 
 
-for (deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; V1 : SERIAL_VECTORS)
   {
-//TODO: Use template expander script
-
-template
-void MGTransferPrebuilt<Vector<float> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof);
-
-template
-void MGTransferPrebuilt<Vector<double> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof);
-
-template
-void MGTransferPrebuilt<BlockVector<float> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof);
-
-template
-void MGTransferPrebuilt<BlockVector<double> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof);
-
-template void
-MGTransferPrebuilt<Vector<float> >::copy_to_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<Vector<float> >&,
-  const Vector<double>&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_to_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<Vector<float> >&,
-  const BlockVector<double>&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_from_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  Vector<double>&,
-  const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_from_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  BlockVector<double>&,
-  const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_from_mg_add (
-  const MGDoFHandler<deal_II_dimension>&,
-  Vector<double>&,
-  const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_from_mg_add (
-  const MGDoFHandler<deal_II_dimension>&,
-  BlockVector<double>&,
-  const MGLevelObject<Vector<float> >&) const;
-
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_to_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<BlockVector<float> >&,
-  const Vector<double>&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_to_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<BlockVector<float> >&,
-  const BlockVector<double>&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_from_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  Vector<double>&,
-  const MGLevelObject<BlockVector<float> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_from_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  BlockVector<double>&,
-  const MGLevelObject<BlockVector<float> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_from_mg_add (
-  const MGDoFHandler<deal_II_dimension>&,
-  Vector<double>&,
-  const MGLevelObject<BlockVector<float> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_from_mg_add (
-  const MGDoFHandler<deal_II_dimension>&,
-  BlockVector<double>&,
-  const MGLevelObject<BlockVector<float> >&) const;
-
-template void
-MGTransferPrebuilt<Vector<double> >::copy_to_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<Vector<double> >&,
-  const Vector<double>&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_to_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<Vector<double> >&,
-  const BlockVector<double>&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_from_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  Vector<double>&,
-  const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_from_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  BlockVector<double>&,
-  const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_from_mg_add (
-  const MGDoFHandler<deal_II_dimension>&,
-  Vector<double>&,
-  const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_from_mg_add (
-  const MGDoFHandler<deal_II_dimension>&,
-  BlockVector<double>&,
-  const MGLevelObject<Vector<double> >&) const;
+    template
+      void MGTransferPrebuilt<V1 >::build_matrices<deal_II_dimension>(
+       const MGDoFHandler<deal_II_dimension> &mg_dof);
+  }
 
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_to_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<BlockVector<double> >&,
-  const Vector<double>&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_to_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<BlockVector<double> >&,
-  const BlockVector<double>&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_from_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  Vector<double>&,
-  const MGLevelObject<BlockVector<double> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_from_mg (
-  const MGDoFHandler<deal_II_dimension>&,
-  BlockVector<double>&,
-  const MGLevelObject<BlockVector<double> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_from_mg_add (
-  const MGDoFHandler<deal_II_dimension>&,
-  Vector<double>&,
-  const MGLevelObject<BlockVector<double> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_from_mg_add (
-  const MGDoFHandler<deal_II_dimension>&,
-  BlockVector<double>&,
-  const MGLevelObject<BlockVector<double> >&) const;
+for (deal_II_dimension : DIMENSIONS; V1,V2 : SERIAL_VECTORS)
+  {    
+    template void
+      MGTransferPrebuilt<V1 >::copy_to_mg (
+       const MGDoFHandler<deal_II_dimension>&, MGLevelObject<V1 >&, const V2&) const;
+    template void
+      MGTransferPrebuilt<V1 >::copy_from_mg (const MGDoFHandler<deal_II_dimension>&, V2&,
+                                            const MGLevelObject<V1 >&) const;
+    template void
+      MGTransferPrebuilt<V1 >::copy_from_mg_add (const MGDoFHandler<deal_II_dimension>&, V2&,
+                                                const MGLevelObject<V1 >&) const;
   }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.