From: bangerth Date: Sun, 14 Feb 2010 05:37:30 +0000 (+0000) Subject: Use the preprocessor to avoid writing lots of declarations and instantiations. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c2bd96ee1c1a29eb3b8ae9e17dd37efb43ad859;p=dealii-svn.git Use the preprocessor to avoid writing lots of declarations and instantiations. git-svn-id: https://svn.dealii.org/trunk@20616 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index ab6361add0..ae4e039866 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -1141,141 +1141,7 @@ class FEValuesBase::CellIteratorBase unsigned int n_dofs_for_dof_handler () const = 0; - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const Vector &in, - Vector &out) const = 0; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const Vector &in, - Vector &out) const = 0; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const Vector &in, - Vector &out) const = 0; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const BlockVector &in, - Vector &out) const = 0; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const BlockVector &in, - Vector &out) const = 0; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const BlockVector &in, - Vector &out) const = 0; - -#ifdef DEAL_II_USE_PETSC - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::Vector &in, - Vector &out) const = 0; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::BlockVector &in, - Vector &out) const = 0; -#endif - -#ifdef DEAL_II_USE_TRILINOS - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::Vector &in, - Vector &out) const = 0; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::BlockVector &in, - Vector &out) const = 0; - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::MPI::Vector &in, - Vector &out) const = 0; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::MPI::BlockVector &in, - Vector &out) const = 0; -#endif +#include "fe_values.decl.1.inst" }; @@ -1335,163 +1201,7 @@ class FEValuesBase::CellIterator : public FEValuesBase &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const BlockVector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const BlockVector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const BlockVector &in, - Vector &out) const; - -#ifdef DEAL_II_USE_PETSC - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::BlockVector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::MPI::Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::MPI::BlockVector &in, - Vector &out) const; -#endif - -#ifdef DEAL_II_USE_TRILINOS - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::BlockVector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::MPI::Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::MPI::BlockVector &in, - Vector &out) const; -#endif +#include "fe_values.decl.2.inst" private: /** @@ -1585,167 +1295,7 @@ class FEValuesBase::TriaCellIterator : public FEValuesBase &in, - Vector &out) const; - - /** - * Implement the respective - * function of the base - * class. Since this is not - * possible, we just raise an - * error. - */ - virtual - void - get_interpolated_dof_values (const Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const Vector &in, - Vector &out) const; - - /** - * Implement the respective - * function of the base - * class. Since this is not - * possible, we just raise an - * error. - */ - virtual - void - get_interpolated_dof_values (const BlockVector &in, - Vector &out) const; - - /** - * Implement the respective - * function of the base - * class. Since this is not - * possible, we just raise an - * error. - */ - virtual - void - get_interpolated_dof_values (const BlockVector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const BlockVector &in, - Vector &out) const; - -#ifdef DEAL_II_USE_PETSC - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::BlockVector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::MPI::Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const PETScWrappers::MPI::BlockVector &in, - Vector &out) const; -#endif - -#ifdef DEAL_II_USE_TRILINOS - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::BlockVector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::MPI::Vector &in, - Vector &out) const; - - /** - * Call - * @p get_interpolated_dof_values - * of the iterator with the - * given arguments. - */ - virtual - void - get_interpolated_dof_values (const TrilinosWrappers::MPI::BlockVector &in, - Vector &out) const; -#endif +#include "fe_values.decl.2.inst" private: /** @@ -1801,171 +1351,7 @@ FEValuesBase::CellIterator::n_dofs_for_dof_handler () const -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const Vector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const Vector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const Vector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const BlockVector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const BlockVector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const BlockVector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - - -#ifdef DEAL_II_USE_PETSC - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const PETScWrappers::Vector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const PETScWrappers::BlockVector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const PETScWrappers::MPI::Vector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const PETScWrappers::MPI::BlockVector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - -#endif - -#ifdef DEAL_II_USE_TRILINOS - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const TrilinosWrappers::Vector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const TrilinosWrappers::BlockVector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const TrilinosWrappers::MPI::Vector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - - - -template -template -void -FEValuesBase::CellIterator:: -get_interpolated_dof_values (const TrilinosWrappers::MPI::BlockVector &in, - Vector &out) const -{ - cell->get_interpolated_dof_values (in, out); -} - -#endif +#include "fe_values.impl.inst" /* ---------------- FEValuesBase::TriaCellIterator --------- */ @@ -2009,158 +1395,7 @@ FEValuesBase::TriaCellIterator::n_dofs_for_dof_handler () const } -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const Vector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const Vector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const Vector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const BlockVector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const BlockVector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const BlockVector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - - -#ifdef DEAL_II_USE_PETSC - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const PETScWrappers::Vector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const PETScWrappers::BlockVector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const PETScWrappers::MPI::Vector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const PETScWrappers::MPI::BlockVector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - -#endif - -#ifdef DEAL_II_USE_TRILINOS - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const TrilinosWrappers::Vector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const TrilinosWrappers::BlockVector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const TrilinosWrappers::MPI::Vector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - - - -template -void -FEValuesBase::TriaCellIterator:: -get_interpolated_dof_values (const TrilinosWrappers::MPI::BlockVector &, - Vector &) const -{ - Assert (false, ExcMessage (message_string)); -} - -#endif - +#include "fe_values.impl.2.inst" diff --git a/deal.II/deal.II/source/fe/fe_values.decl.1.inst.in b/deal.II/deal.II/source/fe/fe_values.decl.1.inst.in new file mode 100644 index 0000000000..6646733e1f --- /dev/null +++ b/deal.II/deal.II/source/fe/fe_values.decl.1.inst.in @@ -0,0 +1,30 @@ +//----------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 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. +// +//----------------------------------------------------------------------- + + +// Declarations of member functions of FEValuesBase::CellIteratorBase +// and derived classes + +for (VEC : SERIAL_VECTORS) + { + /** + * Call + * @p get_interpolated_dof_values + * of the iterator with the + * given arguments. + */ + virtual + void + get_interpolated_dof_values (const VEC &in, + Vector &out) const = 0; + } diff --git a/deal.II/deal.II/source/fe/fe_values.decl.2.inst.in b/deal.II/deal.II/source/fe/fe_values.decl.2.inst.in new file mode 100644 index 0000000000..6e86304766 --- /dev/null +++ b/deal.II/deal.II/source/fe/fe_values.decl.2.inst.in @@ -0,0 +1,30 @@ +//----------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 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. +// +//----------------------------------------------------------------------- + + +// Declarations of member functions of FEValuesBase::CellIteratorBase +// and derived classes + +for (VEC : SERIAL_VECTORS) + { + /** + * Call + * @p get_interpolated_dof_values + * of the iterator with the + * given arguments. + */ + virtual + void + get_interpolated_dof_values (const VEC &in, + Vector &out) const; + } diff --git a/deal.II/deal.II/source/fe/fe_values.impl.2.inst.in b/deal.II/deal.II/source/fe/fe_values.impl.2.inst.in new file mode 100644 index 0000000000..0304e045f0 --- /dev/null +++ b/deal.II/deal.II/source/fe/fe_values.impl.2.inst.in @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 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 (VEC : SERIAL_VECTORS) + { + template + void + FEValuesBase::TriaCellIterator:: + get_interpolated_dof_values (const VEC &, + Vector &) const + \{ + Assert (false, ExcMessage (message_string)); + \} + } diff --git a/deal.II/deal.II/source/fe/fe_values.impl.inst.in b/deal.II/deal.II/source/fe/fe_values.impl.inst.in new file mode 100644 index 0000000000..ef05984ca9 --- /dev/null +++ b/deal.II/deal.II/source/fe/fe_values.impl.inst.in @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 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 (VEC : SERIAL_VECTORS) + { + template + template + void + FEValuesBase::CellIterator:: + get_interpolated_dof_values (const VEC &in, + Vector &out) const + \{ + cell->get_interpolated_dof_values (in, out); + \} + }