From c805a784b3089f426302da77d6f692d9de6337fc Mon Sep 17 00:00:00 2001 From: kanschat Date: Thu, 1 Dec 2011 21:43:44 +0000 Subject: [PATCH] new perl script for instatiating templates git-svn-id: https://svn.dealii.org/trunk@24784 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/common/dealiitemplates.pm.in | 93 ++++++++++++++++++++++++++++ deal.II/configure | 3 +- deal.II/configure.in | 3 +- 3 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 deal.II/common/dealiitemplates.pm.in diff --git a/deal.II/common/dealiitemplates.pm.in b/deal.II/common/dealiitemplates.pm.in new file mode 100644 index 0000000000..126d598c0f --- /dev/null +++ b/deal.II/common/dealiitemplates.pm.in @@ -0,0 +1,93 @@ +###################################################################### +# Definitions for vectors of common template instantiations +###################################################################### +package dealiitemplates; + +use strict; +use warnings; + +BEGIN { + use Exporter(); + our @ISA = qw(Exporter); + our @EXPORT = qw(@dimensions @dofhandlers @dofhandler_templates + @real_scalars @complex_scalars @all_scalars + @deal_vector_templates @deal_vectors @deal_real_vectors @deal_complex_vectors + @trilinos_vectors @petsc_vectors + @sequential_vectors @parallel_vectors + @sparsity_patterns); +} +our @EXPORT; +our $t; + +# Dimensions +our @dimensions = (1,2,3); + +# DoFHandlers +our @dofhandler_templates = qw(DoFHandler hp::DoFHandler MGDoFHandler); +our @dofhandlers = map { $t = $_ ; map { "$_<$t>" } @dofhandler_templates } @dimensions; + +# All possible number types +our @real_scalars = ('float', 'double', 'long double'); +our @complex_scalars = map { "std::complex<$_>" } @real_scalars; +our @all_scalars = (@real_scalars, @complex_scalars); + +# The vectors built into deal.II +our @deal_vector_templates = qw(Vector BlockVector); +our @deal_real_vectors = map { $t = $_ ; map { "$_<$t >" } @deal_vector_templates } @real_scalars; +our @deal_complex_vectors = map { $t = $_ ; map { "$_<$t >" } @deal_vector_templates } @complex_scalars; +our @deal_vectors = (@deal_real_vectors, @deal_complex_vectors); + +### Array of all sequential vectors, which includes deal.II vectors. +our @sequential_vectors = @deal_real_vectors; + +### Array of all parallel vectors. None of those yet. +our @parallel_vectors; + +###################################################################### +# Configured arrays start here. +###################################################################### +# For each of those, first set up a temporary array with parameters +# replaced by autoconf. Then, copy into the actual array, omitting all +# empty strings. +###################################################################### +our @tmp; + +@tmp = ('@DEAL_II_EXPAND_TRILINOS_VECTOR@', + '@DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR@', + ''); +our @trilinos_vectors = grep {!/^$/} @tmp; +push(@sequential_vectors, @trilinos_vectors); + +@tmp = ('@DEAL_II_EXPAND_TRILINOS_MPI_VECTOR@', + '@DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR@', + ''); +push (@trilinos_vectors, grep {!/^$/} @tmp); +push (@parallel_vectors, grep {!/^$/} @tmp); + +###################################################################### + +@tmp = ('@DEAL_II_EXPAND_PETSC_VECTOR@', + '@DEAL_II_EXPAND_PETSC_BLOCKVECTOR@', + ''); +our @petsc_vectors = grep {!/^$/} @tmp; +push(@sequential_vectors, @petsc_vectors); + +@tmp = ('@DEAL_II_EXPAND_PETSC_MPI_VECTOR@', + '@DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR@', + ''); +push (@petsc_vectors, grep {!/^$/} @tmp); +push (@parallel_vectors, grep {!/^$/} @tmp); + +###################################################################### + +@tmp = qw(SparsityPattern + CompressedSparsityPattern + CompressedSetSparsityPattern + CompressedSimpleSparsityPattern + @DEAL_II_EXPAND_TRILINOS_SPARSITY_PATTERN@ + BlockSparsityPattern + BlockCompressedSparsityPattern + BlockCompressedSetSparsityPattern + BlockCompressedSimpleSparsityPattern + @DEAL_II_EXPAND_TRILINOS_BLOCK_SPARSITY_PATTERN@); +our @sparsity_patterns = grep {!/^$/} @tmp; diff --git a/deal.II/configure b/deal.II/configure index ebb640e383..e36ff27349 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -13884,7 +13884,8 @@ process_files="common/Make.global_options common/scripts/make_dependencies.pl common/scripts/make_todo.pl Version - common/template-arguments" + common/template-arguments + common/dealiitemplates.pm" if test -d doc ; then process_files="${process_files} diff --git a/deal.II/configure.in b/deal.II/configure.in index 90dec2dfdb..af6240b628 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -873,7 +873,8 @@ process_files="common/Make.global_options common/scripts/make_dependencies.pl common/scripts/make_todo.pl Version - common/template-arguments" + common/template-arguments + common/dealiitemplates.pm" dnl Also replace stuff in the doc/ files, but we can't rely on dnl their presence because we package the .nodoc.tar.gz files -- 2.39.5