Debian Codegraph @

packages/muelu/src/Headers/gen_UseShortNames.sh

raw
1 #!/bin/bash
2
3 #
4 # Ordinal
5 #
6
7 classListDir=../Utils/ClassList/
8
9 echo "// @HEADER" > MueLu_UseShortNamesOrdinal.hpp
10 echo "// *****************************************************************************" >> MueLu_UseShortNamesOrdinal.hpp
11 echo "// MueLu: A package for multigrid based preconditioning" >> MueLu_UseShortNamesOrdinal.hpp
12 echo "//" >> MueLu_UseShortNamesOrdinal.hpp
13 echo "// Copyright 2012 NTESS and the MueLu contributors." >> MueLu_UseShortNamesOrdinal.hpp
14 echo "// SPDX-License-Identifier: BSD-3-Clause" >> MueLu_UseShortNamesOrdinal.hpp
15 echo "// *****************************************************************************" >> MueLu_UseShortNamesOrdinal.hpp
16 echo "// @HEADER" >> MueLu_UseShortNamesOrdinal.hpp
17 echo "" >> MueLu_UseShortNamesOrdinal.hpp
18 echo "// Type definitions for templated classes (generally graph-related) that do not require a scalar." >> MueLu_UseShortNamesOrdinal.hpp
19 echo >> MueLu_UseShortNamesOrdinal.hpp
20 echo "#include <Xpetra_UseShortNamesOrdinal.hpp>" >> MueLu_UseShortNamesOrdinal.hpp
21 echo >> MueLu_UseShortNamesOrdinal.hpp
22
23 for i in LO-GO-NO Non-Templated
24 do
25
26 classList=$classListDir/$i.classList
27 tmpl=$i.tmpl
28
29 for className in `cat $classList | grep -v ^\# | cut -d "-" -f1 | sed 's/ //'`
30 do
31 uppercaseClassName=$(echo $className | tr '[a-z]' '[A-Z]')
32 cat $tmpl | sed "s/\$TMPL_UPPERCASECLASS/$uppercaseClassName/g" | sed "s/\$TMPL_CLASS/$className/g" >> MueLu_UseShortNamesOrdinal.hpp
33 done
34 done
35
36 #
37 # Scalar
38 #
39 echo "// @HEADER" > MueLu_UseShortNamesScalar.hpp
40 echo "// *****************************************************************************" >> MueLu_UseShortNamesScalar.hpp
41 echo "// MueLu: A package for multigrid based preconditioning" >> MueLu_UseShortNamesScalar.hpp
42 echo "//" >> MueLu_UseShortNamesScalar.hpp
43 echo "// Copyright 2012 NTESS and the MueLu contributors." >> MueLu_UseShortNamesScalar.hpp
44 echo "// SPDX-License-Identifier: BSD-3-Clause" >> MueLu_UseShortNamesScalar.hpp
45 echo "// *****************************************************************************" >> MueLu_UseShortNamesScalar.hpp
46 echo "// @HEADER" >> MueLu_UseShortNamesScalar.hpp
47 echo "" >> MueLu_UseShortNamesScalar.hpp
48 echo "// New definition of types using the types Scalar, LocalOrdinal, GlobalOrdinal, Node of the current context." >> MueLu_UseShortNamesScalar.hpp
49 echo >> MueLu_UseShortNamesScalar.hpp
50 echo "#include <Xpetra_UseShortNamesScalar.hpp>" >> MueLu_UseShortNamesScalar.hpp
51 echo >> MueLu_UseShortNamesScalar.hpp
52
53 i=SC-LO-GO-NO
54 classList=$classListDir/$i.classList
55 tmpl=$i.tmpl
56
57 for className in `cat $classList | grep -v ^\# | cut -d "-" -f1 | sed 's/ //'`
58 do
59 uppercaseClassName=$(echo $className | tr '[a-z]' '[A-Z]')
60 cat $tmpl | sed "s/\$TMPL_UPPERCASECLASS/$uppercaseClassName/g" | sed "s/\$TMPL_CLASS/$className/g" >> MueLu_UseShortNamesScalar.hpp
61 done
62
63 # AmesosSmoother and IfpackSmoother are special (they need only one template parameter)
64 echo "#ifdef MUELU_AMESOSSMOOTHER_SHORT" >> MueLu_UseShortNamesOrdinal.hpp
65 echo "typedef MueLu::AmesosSmoother<Node> AmesosSmoother;" >> MueLu_UseShortNamesOrdinal.hpp
66 echo "#endif" >> MueLu_UseShortNamesOrdinal.hpp
67 echo "#ifdef MUELU_IFPACKSMOOTHER_SHORT" >> MueLu_UseShortNamesOrdinal.hpp
68 echo "typedef MueLu::IfpackSmoother<Node> IfpackSmoother;" >> MueLu_UseShortNamesOrdinal.hpp
69 echo "#endif" >> MueLu_UseShortNamesOrdinal.hpp