Files
katrin-plasma/docs/vortraege/christian/colab19/tex/pics/particle.tex
T

101 lines
3.7 KiB
TeX

% http://www.texample.net/tikz/examples/flexible-flow-chart/
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,chains}
\begin{document}
% -------------------------------------------------
% Color definition
\definecolor{myblue}{HTML}{2B86C0}
\definecolor{myred}{HTML}{C14400}
\definecolor{myyellow}{HTML}{FFD700}
\definecolor{mygreen}{HTML}{3F681C}
%https://www.schemecolor.com/cute-lights.php
\definecolor{startstopcolor}{HTML}{FF555E}
\definecolor{testcolor}{HTML}{FFE981}
\definecolor{proccolor}{HTML}{83B2FF}
% -------------------------------------------------
% 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}
}
% -------------------------------------------------
% 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=5mm and 55mm, % Global setup of box spacing
every join/.style={arrow}, % Default linetype for connecting boxes
]
% -------------------------------------------------
% Box styles
\tikzset{
base/.style={draw, on chain, on grid, align=center, minimum height=4ex, font=\sffamily, draw=none},
proc/.style={base, rectangle, text width=10em, fill=proccolor},
test/.style={base, diamond, aspect=3, text width=5em, fill=testcolor},
startstop/.style={proc, minimum height=6ex, fill=startstopcolor},
%base/.style={draw, on chain, on grid, align=center, minimum height=4ex, font=\sffamily},
%proc/.style={base, rectangle, text width=10em},
%test/.style={base, diamond, aspect=3, text width=5em},
%startstop/.style={proc, minimum height=6ex},
% Debug styles
coord/.style={coordinate, on chain, on grid, node distance=6mm and 25mm},
nmark/.style={draw, cyan, circle, font={\sffamily}},
% Line styles
arrow/.style={->, draw, black},
slabel/.style={near start, xshift=1em, font=\sffamily},
welabel/.style={near start, yshift=-0.8em, font=\sffamily},
}
% -------------------------------------------------
% Nodes
\node [startstop] (start) {Start};
\node [proc, join] (move) {Move by MFP
\begin{flushleft}
$\rightarrow$ Update densities \\
$\rightarrow$ Log at barrier \\
\end{flushleft}
};
\node [test, join] (terminate1) {Termination?};
\node [proc, right=of terminate1] (interaction) {Do Interaction
\begin{flushleft}
$\rightarrow$ New part. to PQ \\
\end{flushleft}
};
\node [test, right=of interaction, join] (terminate2) {Termination?};
\node [startstop] (end) {End};
%% -------------------------------------------------
%% Coordinate markers
\node [coord, right=of terminate1] (c0) {}; \cmark{0}
\node [coord, below= of terminate1] (c1) {}; \cmark{1}
\node [coord, above= of terminate2] (c2) {}; \cmark{2}
%% -------------------------------------------------
%% West east connectors
\path (terminate1.east) to node [welabel] {no} (c0);
\draw [arrow] (terminate1.east) -- (interaction);
%% -------------------------------------------------
%% -------------------------------------------------
%% North south connectors
\path (terminate2.south) to node [slabel] {yes} (end);
\draw [arrow] (terminate2.south) -- (end);
%% -------------------------------------------------
%% Complicated connectors
\path (terminate1.south) to node [slabel] {yes} (c1);
\draw [arrow] (terminate1.south) -- (c1) |- (end);
\path (terminate2.north) to node [slabel] {no} (c2);
\draw [arrow] (terminate2.north) -- (c2) |- (move.east);
\node [anchor=west] at (8, 0) {PQ: particle queue};
\end{tikzpicture}
\end{document}