5_externaltools.tex 3.63 KB
Newer Older
Thomas Fetzer's avatar
Thomas Fetzer committed
1
2
3
4
\section{External Tools}
\label{sc_externaltools}

\subsection{Git}
5
Git is a version control tool which we use.
Thomas Fetzer's avatar
Thomas Fetzer committed
6
7
The basic Git commands are:
\begin{itemize}
8
9
10
11
  \item \texttt{git checkout}: receive a specified branch from the repository
  \item \texttt{git clone}: clone a repository; creates a local copy
  \item \texttt{git diff}: to see the actual changes compared to your last commit
  \item \texttt{git pull}: pull changes from the repository; synchronizes the
12
  repository with your local copy
13
  \item \texttt{git push}: push comitted changes to the repository;  synchronizes
14
  your local copy with the repository
15
16
  \item \texttt{git status}: to check which files/folders have been changed
  \item \texttt{git gui}: graphical user interface, helps selecting changes for
17
  a commit
Thomas Fetzer's avatar
Thomas Fetzer committed
18
19
\end{itemize}

20
21

\subsection{Gnuplot}
Utz's avatar
Utz committed
22
\label{gnuplot}
23
A gnuplot interface is available to plot or visualize results during a simulation run.
24
This is achieved with the help of the \texttt{Dumux::GnuplotInterface} class provided in \texttt{io/gnuplotinterface.hh}.
Utz's avatar
Utz committed
25

Beatrix Becker's avatar
Beatrix Becker committed
26
To use the gnuplot interface you have to make some modifications in your file, e.g., your main file.
Utz's avatar
Utz committed
27

28
First, you have to include the corresponding header file for the gnuplot interface.
Utz's avatar
Utz committed
29
30
31
32
\begin{lstlisting}[style=DumuxCode]
#include <dumux/io/gnuplotinterface.hh
\end{lstlisting}

33
Second, you have to define an instance of the class \texttt{Dumux::GnuplotInterface} (e.g. called \texttt{gnuplot}).
Utz's avatar
Utz committed
34
\begin{lstlisting}[style=DumuxCode]
Beatrix Becker's avatar
Beatrix Becker committed
35
Dumux::GnuplotInterface<double> gnuplot;
Utz's avatar
Utz committed
36
37
\end{lstlisting}

38
39
40
As an example, to plot the mole fraction of nitrogen (\texttt{y}) over time (\texttt{x}),
extract the variables after each time step in the time loop.
The actual plotting is done using the method of the gnuplot interface:
Utz's avatar
Utz committed
41
42

\begin{lstlisting}[style=DumuxCode]
Beatrix Becker's avatar
Beatrix Becker committed
43
gnuplot.resetPlot();                             // reset the plot
44
gnuplot.setXRange(0.0, 72000.0);                 // specify xmin and xmax
Beatrix Becker's avatar
Beatrix Becker committed
45
46
47
gnuplot.setYRange(0.0, 1.0);                     // specify ymin and ymax
gnuplot.setXlabel("time [s]");                   // set xlabel
gnuplot.setYlabel("mole fraction mol/mol");  // set ylabel
Utz's avatar
Utz committed
48

49
// set x-values, y-values, the name of the data file and the Gnuplot options
50
gnuplot.addDataSetToPlot(x, y, "N2.dat", options);
Utz's avatar
Utz committed
51

Beatrix Becker's avatar
Beatrix Becker committed
52
gnuplot.plot("mole_fraction_N2");                // set the name of the output file
Utz's avatar
Utz committed
53
54
\end{lstlisting}

Beatrix Becker's avatar
Beatrix Becker committed
55
It is also possible to add several data sets to one plot by calling \texttt{addDataSetToPlot()} more than once.
56
57
For more information have a look into a test including the gnuplot interface header file, the doxygen documentation
of \texttt{Dumux::GnuplotInterface}, or the header file itself (\texttt{dumux/io/gnuplotinterface.hh}).
58
59
60
61
62
63


\subsection{Gstat}
Gstat is an open source software tool which generates geostatistical random fields (see \url{www.gstat.org}).
In order to use gstat, execute the \texttt{bin/installexternal.sh} from your \Dumux root
directory or donwload, unpack and install the tarball from the gstat-website.
64
Then, rerun cmake (in the second case set \texttt{GSTAT\_ROOT} in your input file to the
65
66
path where gstat is installed).

Thomas Fetzer's avatar
Thomas Fetzer committed
67
68
69

\subsection{ParaView}
\paragraph{Reload Button:}
70
There are scripts to reload PVD or series of VTU files since ParaView 4.2.
Thomas Fetzer's avatar
Thomas Fetzer committed
71
The scripts can be found
72
\href{http://markmail.org/message/exxynsgishbvtngg#query:+page:1+mid:rxlwxs7uqrfgibyv+state:results}{\texttt{under this link}}.
Thomas Fetzer's avatar
Thomas Fetzer committed
73
74
75
Just save the specific code portion in a file and load it via \texttt{Macros} $\rightarrow$ \texttt{Add new macro}.

\paragraph{Guide:}
76
Since ParaView 4.3.1, The ParaView Guide is partly
Thomas Fetzer's avatar
Thomas Fetzer committed
77
available for free download, see \url{http://www.paraview.org/documentation/}.
78
It contains similar content as the ParaView book.