h-files := $(sort $(shell echo $D/include/deal.II/*/*.h))
inst-in-files := $(shell echo */*.inst.in)
-inst-files := $(inst-in-files:%.in=%)
+pl-files := $(shell echo */*.pl)
+inst-files := $(inst-in-files:%.in=%) $(pl-files:%.pl=%.inst)
# build unique object file names
@echo "===================================== $(@F)"
@$D/common/scripts/expand_instantiations $D/common/template-arguments < $< > $@ || exit 1
+%.inst : %.pl $D/common/dealiitemplates.pm
+ @echo "===================================== $(@F)"
+ @perl -I $D/common/ $< > $@ || exit 1
+
# there are extra .o file for the function parser and umfpack that we
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2011 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
DEAL_II_NAMESPACE_OPEN
-// explicit instantiations
-template class BlockSparseMatrix<double>;
-template class BlockSparseMatrix<float>;
+#include "block_sparse_matrix.inst"
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+######################################################################
+# $Id$
+######################################################################
+#
+# Copyright (C) 2011 by the deal.II authors
+#
+######################################################################
+
+use strict;
+use warnings;
+
+use dealiitemplates;
+
+my $scalar_functions = <<'EOT'
+template class BlockSparseMatrix<S1>;
+EOT
+ ;
+
+######################################################################
+# End of definitions, now come the loops
+######################################################################
+
+foreach my $r1 (@real_scalars)
+{
+ my $t = $scalar_functions;
+ $t =~ s/S1/$r1/g;
+ print $t;
+}
//---------------------------------------------------------------------------
// $Id$
-// Version: $Name$
//
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors
//
const FullMatrix<double> &) const
-
-VECTOR_FUNCTIONS(Vector<float>);
-VECTOR_FUNCTIONS(Vector<double>);
-VECTOR_FUNCTIONS(Vector<long double>);
-VECTOR_FUNCTIONS(BlockVector<float>);
-VECTOR_FUNCTIONS(BlockVector<double>);
-VECTOR_FUNCTIONS(BlockVector<long double>);
-
// TODO: Can PETSc really do all the operations required by the above
// condense/distribute function etc also on distributed vectors? Trilinos
// can't do that - we have to rewrite those functions by hand if we want to
// use them. The key is to use local ranges etc., which still needs to be
// implemented.
#ifdef DEAL_II_USE_PETSC
-VECTOR_FUNCTIONS(PETScWrappers::Vector);
-VECTOR_FUNCTIONS(PETScWrappers::BlockVector);
VECTOR_FUNCTIONS(PETScWrappers::MPI::Vector);
VECTOR_FUNCTIONS(PETScWrappers::MPI::BlockVector);
#endif
#ifdef DEAL_II_USE_TRILINOS
-VECTOR_FUNCTIONS(TrilinosWrappers::Vector);
-VECTOR_FUNCTIONS(TrilinosWrappers::BlockVector);
PARALLEL_VECTOR_FUNCTIONS(TrilinosWrappers::MPI::Vector);
PARALLEL_VECTOR_FUNCTIONS(TrilinosWrappers::MPI::BlockVector);
#endif
-#define CONDENSE_FUNCTIONS(VectorType, number, MatrixType) \
- template void ConstraintMatrix::condense<number,VectorType >(MatrixType &uncondensed, \
- VectorType &vec) const \
-
-
-CONDENSE_FUNCTIONS(Vector<float>,float,SparseMatrix<float>);
-CONDENSE_FUNCTIONS(Vector<double>,float,SparseMatrix<float>);
-CONDENSE_FUNCTIONS(Vector<double>,double,SparseMatrix<double>);
-CONDENSE_FUNCTIONS(Vector<float>,double,SparseMatrix<double>);
-CONDENSE_FUNCTIONS(BlockVector<double>,float,BlockSparseMatrix<float>);
-CONDENSE_FUNCTIONS(BlockVector<float>,float,BlockSparseMatrix<float>);
-CONDENSE_FUNCTIONS(BlockVector<double>,double,BlockSparseMatrix<double>);
-CONDENSE_FUNCTIONS(BlockVector<float>,double,BlockSparseMatrix<double>);
-
-
-template
-void
-ConstraintMatrix::condense<float>(const SparseMatrix<float> &uncondensed,
- SparseMatrix<float> &condensed) const;
-template
-void
-ConstraintMatrix::condense<float>(SparseMatrix<float> &uncondensed) const;
-
-template
-void
-ConstraintMatrix::condense<double>(const SparseMatrix<double> &uncondensed,
- SparseMatrix<double> &condensed) const;
-
-template
-void
-ConstraintMatrix::condense<double>(SparseMatrix<double> &uncondensed) const;
-
-
-// block sparse matrices are only implemented for one of the two matrix
-// functions (the single-argument, in-place function)
-template
-void
-ConstraintMatrix::condense<double>(BlockSparseMatrix<double> &uncondensed) const;
-
-template
-void
-ConstraintMatrix::condense<float>(BlockSparseMatrix<float> &uncondensed) const;
-
-
#define MATRIX_VECTOR_FUNCTIONS(MatrixType, VectorType) \
template void ConstraintMatrix:: \
distribute_local_to_global<MatrixType,VectorType > (const FullMatrix<double> &, \
ONLY_MATRIX_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix);
#endif
+#include "constraint_matrix.inst"
+
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+######################################################################
+# $Id$
+######################################################################
+#
+# Copyright (C) 2011 by the deal.II authors
+#
+######################################################################
+
+use strict;
+use warnings;
+
+use dealiitemplates;
+
+my $vector_functions = <<'EOT'
+
+template void ConstraintMatrix::condense<V1 >(const V1 &, V1&) const;
+template void ConstraintMatrix::condense<V1 >(V1 &vec) const;
+template void ConstraintMatrix::set_zero<V1 >(V1&) const;
+template void ConstraintMatrix::distribute_local_to_global<V1 > (
+ const Vector<double>&, const std::vector<unsigned int> &, V1&, const FullMatrix<double>&) const;
+template void ConstraintMatrix::distribute<V1 >(const V1 &, V1&) const;
+template void ConstraintMatrix::distribute<V1 >(V1 &) const;
+EOT
+ ;
+
+my $scalar_vector_functions = <<'EOT'
+
+EOT
+ ;
+
+my $scalar_functions = <<'EOT'
+
+template void ConstraintMatrix::condense<S1>(const SparseMatrix<S1>&, SparseMatrix<S1> &) const;
+template void ConstraintMatrix::condense<S1>(SparseMatrix<S1>&) const;
+template void ConstraintMatrix::condense<S1>(BlockSparseMatrix<S1>&) const;
+EOT
+ ;
+
+my $scalar_scalar_functions = <<'EOT'
+template void ConstraintMatrix::condense<S1,Vector<S2> >(SparseMatrix<S1>&, Vector<S2>&) const;
+template void ConstraintMatrix::condense<S1,BlockVector<S2> >(BlockSparseMatrix<S1>&, BlockVector<S2>&) const;
+template void ConstraintMatrix::condense<S1,Vector<S2> >(
+ const SparseMatrix<S1>&, const Vector<S2>&, SparseMatrix<S1> &, Vector<S2>&) const;
+template void ConstraintMatrix::condense<S1,BlockVector<S2> >(
+ const SparseMatrix<S1>&, const BlockVector<S2>&, SparseMatrix<S1> &, BlockVector<S2>&) const;
+EOT
+ ;
+
+######################################################################
+# End of definitions, now come the loops
+######################################################################
+
+foreach my $v (@sequential_vectors)
+{
+ my $t = $vector_functions;
+ $t =~ s/V1/$v/g;
+ print $t;
+
+}
+
+foreach my $r1 (@real_scalars)
+{
+ my $t = $scalar_functions;
+ $t =~ s/S1/$r1/g;
+ print $t;
+
+ foreach my $r2 (@real_scalars)
+ {
+ my $t = $scalar_scalar_functions;
+ $t =~ s/S1/$r1/g;
+ $t =~ s/S2/$r2/g;
+ print $t
+ }
+}