Commit 86eb7eee authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'cleanup/deprecation-warnings-for-translated-shell-scripts' into 'master'

Deprecate the shell scripts

Closes #883

See merge request !2905
parents eae4788e 16c846f7
......@@ -64,6 +64,9 @@ for (const auto& element : elements(gridGeometry.gridView()))
- `update()` functions of grid geometries, which do not receive the `gridView`, are deprecated, use `update(gridView)` instead.
- `enum class DiscretizationMethod` and associated functions, to be replaced by tags
- `test_dumux.sh` is deprecated.
- `compareparameters.sh` is deprecated, use `getparameterlist.py` instead.
- `replace_property_macros.sh` is removed.
### New experimental features (possibly subject to backwards-incompatible changes in the future)
......
#!/bin/sh
echo "DeprecationWarning: This script will be removed after 3.5!!!"
echo "Use instead getparameterlist.py"
# 1. obtain a list new_parameters.csv of all current parameters
# retrieve all occurrences of GET_PARAM and GET_RUNTIME_PARAM
find dumux/ -name '*.[ch][ch]' -exec awk '/getParam</,/;/' {} \; >new_parameters.csv
......
#! /bin/bash
if [ $# -eq 0 ]
then
echo "No arguments supplied."
echo "Usage: bash ./replace_property_macros.sh file1 [file2 ...]"
fi
for TMP in $@; do
echo "File: $TMP"
sed -i \
"
s/typename[ ]*GET_PROP_TYPE[ ]*(\([^,]*\),[ ]*\([^)]*\))::/typename GetPropType<\1, Properties::\2>::/g;
s/typename[ ]*GET_PROP_TYPE[ ]*(\([^,]*\),[ ]*\([^)]*\))/GetPropType<\1, Properties::\2>/g;
s/GET_PROP_TYPE[ ]*(\([^,]*\),[ ]*\([^)]*\))/GetPropType<\1, Properties::\2>/g;
s/NEW_TYPE_TAG[ ]*(\([^,]*\),[ ]*INHERITS_FROM[ ]*(\([^)]*\)).*/struct TTag::\1 { using InheritsFrom = std::tuple<\2>; };/g;
s/using InheritsFrom = std::tuple<\([^,]*\),[ ]*\([^>]*\)>/using InheritsFrom = std::tuple<\2, \1>/g;
" \
$TMP
gawk -i inplace '/struct TTag::/ && !x {print "// Create new type tags\nnamespace TTag {"; x=1} 1' $TMP
gawk -i inplace '/struct TTag::/{seen++} seen && !/struct TTag::/{print "} // end namespace TTag"; seen=0} 1' $TMP
sed -i \
"
s/struct TTag::/struct /g;
s/GET_PROP_VALUE[ ]*(\([^,]*\),[ ]*\([^)]*\))/getPropValue<\1, Properties::\2>()/g;
s/SET_BOOL_PROP[ ]*(\([^,]*\),[ ]*\([^,]*\),[ ]*\([^)]*\))/template<class TypeTag>\nstruct \2<TypeTag, TTag::\1> { static constexpr bool value = \3; }/g;
s/SET_INT_PROP[ ]*(\([^,]*\),[ ]*\([^,]*\),[ ]*\([^)]*\))/template<class TypeTag>\nstruct \2<TypeTag, TTag::\1> { static constexpr int value = \3; }/g;
s/SET_TYPE_PROP[ ]*(\([^,]*\),[ ]*\([^,]*\),[ ]*\([^)]*\))/template<class TypeTag>\nstruct \2<TypeTag, TTag::\1> { using type = \3; }/g;
s/SET_PROP[ ]*(\([^,]*\),[ ]*\([^)]*\))/template<class TypeTag>\nstruct \2<TypeTag, TTag::\1>/g;
s/NEW_PROP_TAG[ ]*(\([^)]*\))/template<class TypeTag, class MyTypeTag>\nstruct \1 { using type = UndefinedProperty; }/g;
s/TTAG[ ]*(\([^)]*\))/Properties::TTag::\1/g;
" \
$TMP
done
echo "Property macros have been removed."
echo "Manual tweaking might be necessary, especially if"
echo ""
echo "- NEW_TYPE_TAG uses have not been one line after another. In this case,"
echo " . remove superfluous lines \"} // end namespace TTag\" and/or"
echo " . add additional lines \"namespace TTag {\"."
echo ""
echo "- Usages of SET_TYPE_PROP or other macros extend over more than one line."
echo " In this case, replace the usages manually."
echo ""
echo "- Macros have been used outside of the namespace Dumux and without a"
echo " corresponding alias. In this case, prepend things with a \"Dumux::\"."
# Test to see if the download and configuration worked properly
cd DUMUX/dumux/build-cmake/test/porousmediumflow/1p/isothermal
echo "DeprecationWarning: This script will be removed after 3.5!!!"
echo "The commands can be found in the handbook and are printed after installation"
echo "via installdumux.py"
cd dumux/dumux/build-cmake/test/porousmediumflow/1p/isothermal
make test_1p_tpfa
./test_1p_tpfa params.input
paraview *pvd
......@@ -59,12 +59,4 @@ paraview *pvd
(green double arrow on top right) to admire the colorful pressure distribution.
\end{enumerate}
These commands are compiled into \texttt{test\_dumux.sh}, which you can download and run
from the same directory from which you ran \texttt{installdumux.py}.
\begin{lstlisting}[style=Bash,escapechar=\%]
$ wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/raw/releases/%\DumuxVersion%/bin/util/test_dumux.sh
$ wget sh test_dumux.sh
\end{lstlisting}
For further information on how to get started with dumux, see section \ref{chp:tutorial}.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment