From 8ea20be886528a8068a544ace5ed77365bc4cd21 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 11 Mar 2013 15:15:41 +0000 Subject: [PATCH] Use the generic instantiation scheme instead of manually listing the number types. git-svn-id: https://svn.dealii.org/trunk@28853 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/lac/CMakeLists.txt | 2 + deal.II/source/lac/lapack_full_matrix.cc | 24 +------ deal.II/source/lac/lapack_full_matrix.inst.in | 25 +++++++ deal.II/source/lac/trilinos_sparse_matrix.cc | 67 ++----------------- .../source/lac/trilinos_sparse_matrix.inst.in | 38 +++++++++++ 5 files changed, 74 insertions(+), 82 deletions(-) create mode 100644 deal.II/source/lac/lapack_full_matrix.inst.in create mode 100644 deal.II/source/lac/trilinos_sparse_matrix.inst.in diff --git a/deal.II/source/lac/CMakeLists.txt b/deal.II/source/lac/CMakeLists.txt index 7244f645ff..b460e66faa 100644 --- a/deal.II/source/lac/CMakeLists.txt +++ b/deal.II/source/lac/CMakeLists.txt @@ -81,12 +81,14 @@ SET(inst_in_files chunk_sparse_matrix.inst.in constraint_matrix.inst.in full_matrix.inst.in + lapack_full_matrix.inst.in operator.inst.in parallel_vector.inst.in precondition_block.inst.in relaxation_block.inst.in sparse_matrix_ez.inst.in sparse_matrix.inst.in + trilinos_sparse_matrix.inst.in trilinos_vector_base.inst.in vector.inst.in vector_memory.inst.in diff --git a/deal.II/source/lac/lapack_full_matrix.cc b/deal.II/source/lac/lapack_full_matrix.cc index 5582ef2b5a..f61fcbd94a 100644 --- a/deal.II/source/lac/lapack_full_matrix.cc +++ b/deal.II/source/lac/lapack_full_matrix.cc @@ -891,27 +891,7 @@ PreconditionLU::Tvmult(BlockVector &dst, -template class LAPACKFullMatrix; -template LAPACKFullMatrix & -LAPACKFullMatrix::operator = (const FullMatrix &M); -template LAPACKFullMatrix & -LAPACKFullMatrix::operator = (const FullMatrix &M); - -template class LAPACKFullMatrix; -template LAPACKFullMatrix & -LAPACKFullMatrix::operator = (const FullMatrix &M); -template LAPACKFullMatrix & -LAPACKFullMatrix::operator = (const FullMatrix &M); - -template class LAPACKFullMatrix; -template LAPACKFullMatrix & -LAPACKFullMatrix::operator = (const FullMatrix &M); -template LAPACKFullMatrix & -LAPACKFullMatrix::operator = (const FullMatrix &M); -template LAPACKFullMatrix & -LAPACKFullMatrix::operator = (const FullMatrix &M); - -template class PreconditionLU; -template class PreconditionLU; +#include "lapack_full_matrix.inst" + DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/source/lac/lapack_full_matrix.inst.in b/deal.II/source/lac/lapack_full_matrix.inst.in new file mode 100644 index 0000000000..ddde87b7cc --- /dev/null +++ b/deal.II/source/lac/lapack_full_matrix.inst.in @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2013 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 LAPACKFullMatrix; + template class PreconditionLU; + } + +for (S1, S2 : REAL_SCALARS) + { + template LAPACKFullMatrix & + LAPACKFullMatrix::operator = (const FullMatrix &M); + } diff --git a/deal.II/source/lac/trilinos_sparse_matrix.cc b/deal.II/source/lac/trilinos_sparse_matrix.cc index f01ada3dcc..29030f6e47 100644 --- a/deal.II/source/lac/trilinos_sparse_matrix.cc +++ b/deal.II/source/lac/trilinos_sparse_matrix.cc @@ -1388,12 +1388,17 @@ namespace TrilinosWrappers sizeof(int)*local_size() + static_memory); } +} + +// explicit instantiations +#include "trilinos_sparse_matrix.inst" - // explicit instantiations - // +// TODO: put these instantiations into generic file +namespace TrilinosWrappers +{ template void SparseMatrix::reinit (const dealii::SparsityPattern &); template void @@ -1442,64 +1447,6 @@ namespace TrilinosWrappers const CompressedSetSparsityPattern &, const bool); - template void - SparseMatrix::reinit (const dealii::SparseMatrix &, - const double, - const bool, - const dealii::SparsityPattern *); - template void - SparseMatrix::reinit (const dealii::SparseMatrix &, - const double, - const bool, - const dealii::SparsityPattern *); - template void - SparseMatrix::reinit (const dealii::SparseMatrix &, - const double, - const bool, - const dealii::SparsityPattern *); - - template void - SparseMatrix::reinit (const Epetra_Map &, - const dealii::SparseMatrix &, - const double, - const bool, - const dealii::SparsityPattern *); - template void - SparseMatrix::reinit (const Epetra_Map &, - const dealii::SparseMatrix &, - const double, - const bool, - const dealii::SparsityPattern *); - template void - SparseMatrix::reinit (const Epetra_Map &, - const dealii::SparseMatrix &, - const double, - const bool, - const dealii::SparsityPattern *); - - template void - SparseMatrix::reinit (const Epetra_Map &, - const Epetra_Map &, - const dealii::SparseMatrix &, - const double, - const bool, - const dealii::SparsityPattern *); - template void - SparseMatrix::reinit (const Epetra_Map &, - const Epetra_Map &, - const dealii::SparseMatrix &, - const double, - const bool, - const dealii::SparsityPattern *); - template void - SparseMatrix::reinit (const Epetra_Map &, - const Epetra_Map &, - const dealii::SparseMatrix &, - const double, - const bool, - const dealii::SparsityPattern *); - - } DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/source/lac/trilinos_sparse_matrix.inst.in b/deal.II/source/lac/trilinos_sparse_matrix.inst.in new file mode 100644 index 0000000000..32fc182ad8 --- /dev/null +++ b/deal.II/source/lac/trilinos_sparse_matrix.inst.in @@ -0,0 +1,38 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2013 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) + { + namespace TrilinosWrappers + \{ + template void + SparseMatrix::reinit (const dealii::SparseMatrix &, + const double, + const bool, + const dealii::SparsityPattern *); + template void + SparseMatrix::reinit (const Epetra_Map &, + const dealii::SparseMatrix &, + const double, + const bool, + const dealii::SparsityPattern *); + template void + SparseMatrix::reinit (const Epetra_Map &, + const Epetra_Map &, + const dealii::SparseMatrix &, + const double, + const bool, + const dealii::SparsityPattern *); + \} + } -- 2.39.5