From: bangerth Date: Sun, 9 Dec 2007 16:58:11 +0000 (+0000) Subject: Provide the infrastructure to generate some of the template instantiations in this... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8203e016c6490220bebdf1d1fe9a4eb86e00d116;p=dealii-svn.git Provide the infrastructure to generate some of the template instantiations in this directory automatically using the new script. Don't use it right away, we'll do this in a second step. git-svn-id: https://svn.dealii.org/trunk@15572 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/common/template-arguments b/deal.II/common/template-arguments new file mode 100644 index 0000000000..88e7b4be1f --- /dev/null +++ b/deal.II/common/template-arguments @@ -0,0 +1,6 @@ +REAL_SCALARS := { double; float; long double } +COMPLEX_SCALARS := { std::complex; + std::complex; + std::complex } + +DEAL_II_VEC_TEMPLATES := { Vector; BlockVector } diff --git a/deal.II/lac/Makefile b/deal.II/lac/Makefile index c548e3bf82..3b7189f5ba 100644 --- a/deal.II/lac/Makefile +++ b/deal.II/lac/Makefile @@ -40,6 +40,10 @@ $(LIBDIR)/lac/%.$(OBJEXT) : @echo "=====lac==============optimized==$(MT)== $( $@ + # rules lib: $(LIBDIR)/liblac.g$(lib-suffix) $(LIBDIR)/liblac$(lib-suffix) @@ -116,11 +120,17 @@ clean: # of this file. # # If the command fails, then remove Makefile.dep again and fail -Makefile.dep: $(cc-files) $(h-files) Makefile $D/common/Make.global_options +Makefile.dep: $(cc-files) $(h-files) \ + $(shell echo source/*.inst.in) \ + Makefile $D/common/Make.global_options @echo ============================ Remaking lac/Makefile @$D/common/scripts/make_dependencies $(INCLUDE) "-B$(LIBDIR)/lac" $(cc-files) \ > $@ \ || (rm -f $@ ; false) + @for i in source/*inst.in ; do \ + echo "$${i}.x : $${i}" | \ + $(PERL) -pi -e 's/\.inst\.in\.x/.inst/g;' ; \ + done >> $@ # include all the dependencies diff --git a/deal.II/lac/source/full_matrix.inst.in b/deal.II/lac/source/full_matrix.inst.in new file mode 100644 index 0000000000..e1e0e89a83 --- /dev/null +++ b/deal.II/lac/source/full_matrix.inst.in @@ -0,0 +1,191 @@ +//--------------------------------------------------------------------------- +// $Id: full_matrix.double.cc 15518 2007-11-18 22:31:00Z bangerth $ +// Version: $Name$ +// +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 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 (S : REAL_SCALARS) + { + template class FullMatrix; + + template void FullMatrix::print( + LogStream&, const unsigned int, const unsigned int) const; + template void FullMatrix::print( + std::ostream&, const unsigned int, const unsigned int) const; + } + +for (S1, S2 : REAL_SCALARS) + { + template + void FullMatrix::fill ( + const FullMatrix&, unsigned, unsigned, unsigned, unsigned); + template + void FullMatrix::add (const S1, const FullMatrix&); + template + void FullMatrix::add (const S1, const FullMatrix&, + const S1, const FullMatrix&); + template + void FullMatrix::add (const S1, const FullMatrix&, + const S1, const FullMatrix&, + const S1, const FullMatrix&); + template + void FullMatrix::add ( + const FullMatrix&, S1, unsigned, unsigned,unsigned, unsigned); + template + void FullMatrix::Tadd (const S1, const FullMatrix&); + template + void FullMatrix::Tadd ( + const FullMatrix&, S1, unsigned, unsigned, unsigned, unsigned); + template + void FullMatrix::equ (const S1, const FullMatrix&); + template + void FullMatrix::equ (const S1, const FullMatrix&, + const S1, const FullMatrix&); + template + void FullMatrix::equ (const S1, const FullMatrix&, + const S1, const FullMatrix&, + const S1, const FullMatrix&); + template + void FullMatrix::mmult (FullMatrix&, const FullMatrix&, const bool) const; + template + void FullMatrix::Tmmult (FullMatrix&, const FullMatrix&, const bool) const; + template + void FullMatrix::invert (const FullMatrix&); + + template + void FullMatrix::fill_permutation ( + const FullMatrix&, + const std::vector&, + const std::vector&); + template + void FullMatrix::vmult( + Vector&, const Vector&, bool) const; + template + void FullMatrix::Tvmult( + Vector&, const Vector&, bool) const; + template + S2 FullMatrix::matrix_norm_square ( + const Vector &) const; + template + S2 FullMatrix::matrix_scalar_product( + const Vector&, const Vector&) const; + template + void FullMatrix::forward( + Vector&, const Vector&) const; + template + void FullMatrix::backward( + Vector&, const Vector&) const; + + template + void FullMatrix::precondition_Jacobi ( + Vector &, const Vector &, const S1) const; + } + +for (S1, S2, S3 : REAL_SCALARS) + { + template + S1 + FullMatrix::residual(Vector&, + const Vector&, + const Vector&) const; + } + + + + + +// same for complex scalars + +for (S : COMPLEX_SCALARS) + { + template class FullMatrix; + + template void FullMatrix::print( + LogStream&, const unsigned int, const unsigned int) const; + template void FullMatrix::print( + std::ostream&, const unsigned int, const unsigned int) const; + } + +for (S1, S2 : COMPLEX_SCALARS) + { + template + void FullMatrix::fill ( + const FullMatrix&, unsigned, unsigned, unsigned, unsigned); + template + void FullMatrix::add (const S1, const FullMatrix&); + template + void FullMatrix::add (const S1, const FullMatrix&, + const S1, const FullMatrix&); + template + void FullMatrix::add (const S1, const FullMatrix&, + const S1, const FullMatrix&, + const S1, const FullMatrix&); + template + void FullMatrix::add ( + const FullMatrix&, S1, unsigned, unsigned,unsigned, unsigned); + template + void FullMatrix::Tadd (const S1, const FullMatrix&); + template + void FullMatrix::Tadd ( + const FullMatrix&, S1, unsigned, unsigned, unsigned, unsigned); + template + void FullMatrix::equ (const S1, const FullMatrix&); + template + void FullMatrix::equ (const S1, const FullMatrix&, + const S1, const FullMatrix&); + template + void FullMatrix::equ (const S1, const FullMatrix&, + const S1, const FullMatrix&, + const S1, const FullMatrix&); + template + void FullMatrix::mmult (FullMatrix&, const FullMatrix&, const bool) const; + template + void FullMatrix::Tmmult (FullMatrix&, const FullMatrix&, const bool) const; + template + void FullMatrix::invert (const FullMatrix&); + + template + void FullMatrix::fill_permutation ( + const FullMatrix&, + const std::vector&, + const std::vector&); + template + void FullMatrix::vmult( + Vector&, const Vector&, bool) const; + template + void FullMatrix::Tvmult( + Vector&, const Vector&, bool) const; + template + S2 FullMatrix::matrix_norm_square ( + const Vector &) const; + template + S2 FullMatrix::matrix_scalar_product( + const Vector&, const Vector&) const; + template + void FullMatrix::forward( + Vector&, const Vector&) const; + template + void FullMatrix::backward( + Vector&, const Vector&) const; + + template + void FullMatrix::precondition_Jacobi ( + Vector &, const Vector &, const S1) const; + } + +for (S1, S2, S3 : COMPLEX_SCALARS) + { + template + S1 + FullMatrix::residual(Vector&, + const Vector&, + const Vector&) const; + } diff --git a/deal.II/lac/source/sparse_matrix.inst.in b/deal.II/lac/source/sparse_matrix.inst.in new file mode 100644 index 0000000000..bf128b0eb0 --- /dev/null +++ b/deal.II/lac/source/sparse_matrix.inst.in @@ -0,0 +1,116 @@ +//---------------------------- sparse_matrix.inst.in --------------------------- +// $Id: sparse_matrix_matrix.in.h 15011 2007-08-22 16:59:41Z kanschat $ +// Version: $Name$ +// +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007 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. +// +//---------------------------- sparse_matrix.inst.in --------------------------- + + +for (S : REAL_SCALARS) + { + template class SparseMatrix; + } + + + +for (S1, S2 : REAL_SCALARS) + { + template SparseMatrix & + SparseMatrix::copy_from (const SparseMatrix &); + + template + void SparseMatrix::copy_from (const FullMatrix &); + + template void SparseMatrix::add (const S1, + const SparseMatrix &); + } + + +for (S1, S2 : SCALARS) + { + template S2 + SparseMatrix:: + matrix_norm_square (const Vector &) const; + + template S2 + SparseMatrix:: + matrix_scalar_product (const Vector &, + const Vector &) const; + + template S2 SparseMatrix:: + residual (Vector &, + const Vector &, + const Vector &) const; + + template void SparseMatrix:: + precondition_SSOR (Vector &, + const Vector &, + const S1) const; + + template void SparseMatrix:: + precondition_SOR (Vector &, + const Vector &, + const S1) const; + + template void SparseMatrix:: + precondition_TSOR (Vector &, + const Vector &, + const S1) const; + + template void SparseMatrix:: + precondition_Jacobi (Vector &, + const Vector &, + const S1) const; + + template void SparseMatrix:: + SOR (Vector &, + const S1) const; + template void SparseMatrix:: + TSOR (Vector &, + const S1) const; + template void SparseMatrix:: + SSOR (Vector &, + const S1) const; + template void SparseMatrix:: + PSOR (Vector &, + const std::vector&, + const std::vector&, + const S1) const; + template void SparseMatrix:: + TPSOR (Vector &, + const std::vector&, + const std::vector&, + const S1) const; + template void SparseMatrix:: + SOR_step (Vector &, + const Vector &, + const S1) const; + template void SparseMatrix:: + TSOR_step (Vector &, + const Vector &, + const S1) const; + template void SparseMatrix:: + SSOR_step (Vector &, + const Vector &, + const S1) const; + } + + +for (S1, S2, S3 : SCALARS; + V1, V2 : DEAL_II_VEC_TEMPLATES) + { + template void SparseMatrix:: + vmult (V1 &, const V2 &) const; + template void SparseMatrix:: + Tvmult (V1 &, const V2 &) const; + template void SparseMatrix:: + vmult_add (V1 &, const V2 &) const; + template void SparseMatrix:: + Tvmult_add (V1 &, const V2 &) const; + } diff --git a/deal.II/lac/source/vector.inst.in b/deal.II/lac/source/vector.inst.in new file mode 100644 index 0000000000..096d3a7462 --- /dev/null +++ b/deal.II/lac/source/vector.inst.in @@ -0,0 +1,61 @@ +//--------------------------------------------------------------------------- +// $Id: vector.cc 15443 2007-11-05 03:43:52Z bangerth $ +// Version: $Name$ +// +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 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 (SCALAR : REAL_SCALARS) + { + template class Vector; + } + +for (S1, S2 : REAL_SCALARS) + { + template + bool + Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST + operator==(const Vector&) const; + template + S1 + Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST + operator*(const Vector&) const; + template + void Vector::reinit(const Vector&, const bool); + template + void Vector::equ(const S1, const Vector&); + template + void Vector::scale(const Vector&); + } + + + +for (SCALAR : COMPLEX_SCALARS) + { + template class Vector; + } + +for (S1, S2 : COMPLEX_SCALARS) + { + template + bool + Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST + operator==(const Vector&) const; + template + S1 + Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST + operator*(const Vector&) const; + template + void Vector::reinit(const Vector&, const bool); + template + void Vector::equ(const S1, const Vector&); + template + void Vector::scale(const Vector&); + }