Files
katrin-plasma/docs/masters/creiling/LaTeX/pics/code/logic.tex
T
2019-12-09 10:29:31 +01:00

66 lines
2.4 KiB
TeX

% http://www.texample.net/tikz/examples/flexible-flow-chart/
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,chains}
\begin{document}
% -------------------------------------------------
% Start the picture
\begin{tikzpicture}[%
>=triangle 60, % Nice arrows; your taste may be different
start chain=going below, % General flow is top-to-bottom
node distance=6mm and 60mm, % Global setup of box spacing
every join/.style={arrow}, % Default linetype for connecting boxes
]
% -------------------------------------------------
% Color definition from https://www.schemecolor.com/cute-lights.php
\definecolor{myred}{HTML}{FF555E}
\definecolor{myblue}{HTML}{83B2FF}
\definecolor{myyellow}{HTML}{FFE981}
% -------------------------------------------------
% Debugging Layer
% top
\pgfdeclarelayer{marx}
\pgfsetlayers{main,marx}
% A macro for marking coordinates (specific to the coordinate naming
% scheme used here). Swap the following 2 definitions to deactivate
% marks.
\providecommand{\cmark}[2][]{\relax}
\providecommand{\cmark}[2][]{%
\begin{pgfonlayer}{marx}
\node [nmark] at (c#2#1) {#2};
\end{pgfonlayer}{marx}
}
% -------------------------------------------------
% Box styles
\tikzset{
base/.style={draw, on chain, on grid, align=center, minimum height=0.7cm, font=\sffamily, draw=none},
code/.style={base, rectangle, text width=10em, fill=myred},
pass/.style={base, rectangle, text width=10em, fill=myblue},
% Debug styles
coord/.style={coordinate, on chain, on grid, node distance=6mm and 25mm},
nmark/.style={draw, cyan, circle, font={\sffamily}},
% Line styles
line/.style={-, draw, very thick, black},
arrow/.style={line, ->},
}
% -------------------------------------------------
% Nodes
\node [code] (karl) {\textbf{KARL} \\
Electron and ion distribution calculation};
\node [code, right= 7cm of karl.north, anchor=north] (pic) {\textbf{PIC} \\
Electric field calculation};
\node [coord, above=1.3 cm of karl.north] (c0) {}; \cmark{0}
\node [coord, below=1 cm of karl.south] (c1) {}; \cmark{1}
\node [pass, right= 3.5cm of c0, anchor=north] (karlpass) {Electron distribution, \\
Ion currents};
\node [pass, right= 3.5cm of c1, anchor=south] (picpass) {Electric fields};
% Lines
\draw [line] (karl.north) |- (karlpass.west);
\draw [arrow] (karlpass.east) -| (pic.north);
\draw [line] (pic.south) |- (picpass.east);
\draw [arrow] (picpass.west) -| (karl.south);
\end{tikzpicture}
\end{document}