Skip to content
Snippets Groups Projects
Commit 4a206aa1 authored by Timo Koch's avatar Timo Koch
Browse files

[doxygen] Move external tools section from handbook to doxygen

parent 40ccb4a4
No related branches found
No related tags found
1 merge request!3580[doc] Feature/doc dissolve handbook (partial)
......@@ -198,14 +198,50 @@ The example above is taken from `test/porousmediumflow/1pnc/implicit/1p2c/noniso
There is support for reading data and grids from VTK files, see Dumux::VTKReader.
## Gnuplot interface
DuMux provides a small interface to GNUPlot, which can be used to plot results and generate
image files (e.g., png). To use the gnuplot, gnuplot has to be installed.
For more information see Dumux::GnuplotInterface.
DuMux provides a small interface to [Gnuplot](http://www.gnuplot.info/),
which can be used to plot results and generate
image files (e.g. `.png`). To use the gnuplot, gnuplot has to be installed.
The following is a brief introduction. For the class documentation, see Dumux::GnuplotInterface.
A Gnuplot interface is available to plot or visualize results during a simulation run.
To use the gnuplot interface you have to make some modifications in your file, e.g., your main file.
First, you have to include the corresponding header file for the gnuplot interface.
```cpp
#include <dumux/io/gnuplotinterface.hh
```
Second, you have to create an instance of the class
Dumux::GnuplotInterface (e.g. called `gnuplot`).
```cpp
Dumux::GnuplotInterface<double> gnuplot;
```
As an example, to plot the mole fraction of nitrogen (`y`) over time (`x`),
extract the variables after each time step in the time loop.
The actual plotting is done using the method of the Gnuplot interface:
```cpp
gnuplot.resetPlot(); // reset the plot
gnuplot.setXRange(0.0, 72000.0); // specify xmin and xmax
gnuplot.setYRange(0.0, 1.0); // specify ymin and ymax
gnuplot.setXlabel("time [s]"); // set xlabel
gnuplot.setYlabel("mole fraction mol/mol"); // set ylabel
// set x-values, y-values, the name of the data file and the Gnuplot options
gnuplot.addDataSetToPlot(x, y, "N2.dat", options);
gnuplot.plot("mole_fraction_N2"); // set the name of the output file
```
It is also possible to add several data sets to one plot by calling Dumux::GnuplotInterface::addDataSetToPlot more than once.
For more information have a look into a test including the gnuplot interface header file, the class documentation
of Dumux::GnuplotInterface, or the header file itself `dumux/io/gnuplotinterface.hh`.
## Container I/O
DuMux supports writing to file from and reading
into some STL containers like `std::vector<double>` or `std::vector<Dune::FieldVector>`.
If you want to read and write simple vectors, have a look at the header dumux/io/container.hh.
If you want to read and write simple vectors, have a look at the header `dumux/io/container.hh`.
## Matrix and Vector I/O
......
......@@ -127,7 +127,6 @@ concepts (\ref{sc_linearsystem}).
\input{5_newfoldersetup}
\input{5_restartsimulations}
\input{5_developingdumux}
\input{5_externaltools}
\input{5_scripts}
\input{5_assemblinglinearsystem}
......
% SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
% SPDX-License-Identifier: CC-BY-4.0
\section{External Tools}
\label{sc_externaltools}
\subsection{Git}
Git is a version control tool which we use.
The basic Git commands are:
\begin{itemize}
\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
repository with your local copy
\item \texttt{git push}: push committed changes to the repository; synchronizes
your local copy with the repository
\item \texttt{git status}: to check which files/folders have been changed
\item \texttt{git gui}: graphical user interface, helps selecting changes for
a commit
\end{itemize}
\subsection{Gnuplot}
\label{gnuplot}
A gnuplot interface is available to plot or visualize results during a simulation run.
This is achieved with the help of the \texttt{Dumux::GnuplotInterface} class provided in \texttt{io/gnuplotinterface.hh}.
To use the gnuplot interface you have to make some modifications in your file, e.g., your main file.
First, you have to include the corresponding header file for the gnuplot interface.
\begin{lstlisting}[style=DumuxCode]
#include <dumux/io/gnuplotinterface.hh
\end{lstlisting}
Second, you have to define an instance of the class \texttt{Dumux::GnuplotInterface} (e.g. called \texttt{gnuplot}).
\begin{lstlisting}[style=DumuxCode]
Dumux::GnuplotInterface<double> gnuplot;
\end{lstlisting}
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:
\begin{lstlisting}[style=DumuxCode]
gnuplot.resetPlot(); // reset the plot
gnuplot.setXRange(0.0, 72000.0); // specify xmin and xmax
gnuplot.setYRange(0.0, 1.0); // specify ymin and ymax
gnuplot.setXlabel("time [s]"); // set xlabel
gnuplot.setYlabel("mole fraction mol/mol"); // set ylabel
// set x-values, y-values, the name of the data file and the Gnuplot options
gnuplot.addDataSetToPlot(x, y, "N2.dat", options);
gnuplot.plot("mole_fraction_N2"); // set the name of the output file
\end{lstlisting}
It is also possible to add several data sets to one plot by calling \texttt{addDataSetToPlot()} more than once.
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}).
\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.py} from your \Dumux root
directory or download, unpack and install the tarball from the gstat-website.
Then, rerun cmake (in the second case set \texttt{GSTAT\_ROOT} in your input file to the
path where gstat is installed).
\subsection{ParaView} \label{ssec:paraview}
To visualize the simulation data you have produced using \Dumux, we recommend using \href{https://www.paraview.org/}{Paraview}.
This open-source software supports \Dumux~'s standard data formats, and can be operated either with a GUI or with batching tools.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment