Friday, 9 August 2013

how to plot an arrow in a matrix structure

how to plot an arrow in a matrix structure

I would like how to do a particular arrow in this scheme. I don´t know if
it´s possible. With this code I need to make an arrow from (rombo1.south)
to the middle arrow from (momentum) -- (pressure). Is it possible? I´m not
sure about it because is inside a matrix structure.
\documentclass[spanish,a4paper,12pt]{book}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{arrows,snakes,backgrounds}
\usetikzlibrary{shapes.geometric}
\begin{document}
\thispagestyle{empty}
\begin{center}
\begin{tikzpicture}
\large
\tikzstyle{block} = [rectangle, draw=blue, thick, fill=blue!20, text
centered,minimum height=2em];
\tikzstyle{line} = [draw, thick, -latex',shorten >=0pt];
\tikzstyle{linwit} = [draw, thick, shorten >=0pt];
\tikzstyle{rombo}=[diamond, aspect=2, draw=blue, thick, fill=blue!20, text
centered, minimum height=3em];
\matrix [column sep=10mm,row sep=10mm]
{
% row 1
& \node [block,text width=3cm] (t) {$t=t+n\:\Delta t$}; \\
% row 2
&
\node [block,text width=4cm,minimum height=3em] (momentum) {Solve U, V,
W\\ equations};
& \node [rombo,text width=2cm] (rombo1) {Converged?};\\
% row 3
& \node [block,text width=4cm] (pressure) {Solve pressure\\ correction}; \\
% row 4
& \node [block,text width=4.5cm] (correct) {Correct velocity,\\ pressure,
fluxes}; \\
% row 5
& \node [block, text width=3.2cm] (scalars) {Solve k and $\varepsilon$};
& \node [rombo,text width=2cm] (rombo2) {Converged?};\\
% row 6
& \node [block,text width=5cm] (converged) {Solve other scalars};\\
% row 7
& \node [block,text width=4cm] (advance) {Advance to\\ next time step};\\
};
\tikzstyle{every path}=[line]
\path (t) -- (momentum);
\path (momentum) -- (pressure);
\path (pressure) -- (correct);
\path (correct) -- (scalars);
\path (scalars) -- (converged);
\path (converged) -- (advance);
\path (advance.west) -- ++(-2,0) |- (t);
\path (rombo1.west) -- node [above,]{No}(momentum);
\path (rombo1.south) -- ++(0,-1) -- (correct);
\path (rombo2.west) -- node [above,]{No}(scalars);
\end{tikzpicture}
\end{center}
\end{document}

No comments:

Post a Comment