commit ba1023e37e7aad060ff3507ddb0efa6bea9624d0
parent b219bcc3ce769589c0d392fef7331cbed4e18c1a
Author: Ivan Gankevich <igankevich@ya.ru>
Date: Sat, 23 Mar 2019 15:21:59 +0300
Main loop figure.
Diffstat:
main.tex | | | 103 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------- |
references.bib | | | 9 | +++++++++ |
2 files changed, 93 insertions(+), 19 deletions(-)
diff --git a/main.tex b/main.tex
@@ -1,7 +1,9 @@
\documentclass[runningheads]{llncs}
-\usepackage{graphicx}
\usepackage{amsmath}
+\usepackage{graphicx}
+\usepackage{tikz}
+\usetikzlibrary{arrows.meta}
\newcommand{\WaveVector}{\vec{k}}
\newcommand{\WaveNumber}{\lvert\smash[b]{\WaveVector}\rvert}
@@ -11,6 +13,25 @@
% properly aligned version of sqrt for \zeta_y^2
\newcommand{\SqrtZeta}[1]{\sqrt{\vphantom{\zeta_x^2}\smash[b]{#1}}}
\newcommand{\SqrtZetaXY}{\SqrtZeta{1 + \zeta_x^2 + \zeta_y^2}}
+\newcommand{\InertiaMatrix}{\mathcal{I}}
+
+\definecolor{spbuWhite2}{RGB}{230,231,230}
+\definecolor{spbuDarkGray}{HTML}{404040}
+\tikzstyle{Block} = [
+ rectangle,
+ draw=spbuDarkGray,
+ thick,
+ text width=1.4cm,
+ align=center,
+ fill=spbuWhite2,
+ font=\footnotesize\linespread{1}\selectfont,
+ inner sep=1mm,
+]
+\tikzstyle{Arrow} = [
+ very thick,
+ arrows={-Triangle[length=0.25cm,width=0.125cm]},
+ draw=spbuDarkGray
+]
\begin{document}
@@ -132,11 +153,7 @@ uses OpenMP or OpenCL to perform computations on each processor or graphical
core. In other words, Virtual testbed follows BSP model~\cite{valiant1990bsp}
for organising parallel computations, in which a programme consists of
sequential steps each of which is internally parallel
-(fig.~\ref{fig:architecture}).
-
-\begin{figure}
-\caption{Virtual testbed \texttt{core} module components.\label{fig:architecture}}
-\end{figure}
+(fig.~\ref{fig:loop}).
\subsection{Wavy surface generation}
@@ -202,10 +219,10 @@ where
\begin{align*}
f(x,y,t)&=\zeta_t(x,y,t) / \left( i f_1(x,y) + i f_2(x,y) - f_3(x,y) \right),\\
f_1(x,y)&={\zeta_x}/{\SqrtZetaXY}-\zeta_x,
- \quad
+ \qquad
\Fourier{\mathcal{D}_3\left(x,y,z\right)}{u,v}=\Cosh{\smash{2\pi\WaveNumber{}z}},\\
f_2(x,y)&={\zeta_y}/{\SqrtZetaXY}-\zeta_y,
- \quad
+ \qquad
\WaveNumber = \sqrt{u^2+v^2},\\
f_3(x,y)&=1/\SqrtZetaXY.
\end{align*}
@@ -277,7 +294,7 @@ processor is fast, copying the results to accelerator's main memory proved to
be inefficient as there are four arrays (one for each dimension) that need to
be allocated and transferred. Simply rewriting code for OpenCL proved to be
even more inefficient due to irregular memory access pattern for different
-array dimensions. So, we resorted to implementing algorithm described
+array dimensions. So, we resorted to implementing the algorithm described
in~\cite{micikevicius2009derivative}, that stores intermediate results in the
local memory of the accelerator. Using this algorithm allowed us to store
arrays of derivatives entirely in graphical accelerator's main memory and
@@ -285,22 +302,70 @@ eliminate data transfer altogether.
\subsection{Translational and angular motion computation}
-\section{Results}
-
-
-\section{Vessel}
-
-Compare load time to iges.
+In order to compute ship position, translational velocity, angular displacement
+and angular velocity each time step we solve equations motion (adapted
+from~\cite{matusiak2013}) using pressure force computed for each panel. The
+equation of translational motion
+\begin{equation*}
+ \dot{\vec{v}} = \frac{\vec{F}}{m} + g\vec{\tau}
+ - \vec{\Omega}\times\vec{v} - \lambda\vec{v},
+ \qquad
+ \dot{\vec{h}} = \vec{G} - \vec{\Omega}\times\vec{h},
+ \qquad
+ \vec{h} = \InertiaMatrix \cdot \vec{\Omega},
+\end{equation*}
+where
+\(\vec{\tau}=\left(-\sin\theta,\cos\theta\sin\phi,-\cos\theta\cos\phi\right)\)
+is a vector that transforms \(g\) into body-fixed coordinate system,
+\(\vec{v}\)~--- translational velocity vector, \(g\)~--- gravitational
+acceleration, \(\vec{\Omega}\)~--- angular velocity vector, \(\vec{F}\)~---
+vector of external forces, \(m\)~--- ship mass, \(\lambda\)~--- damping
+coefficient, \(h\)~--- angular momentum and \(\vec{G}\)~--- the moment of
+external forces, and \(\InertiaMatrix\)~--- inertia matrix.
+
+We compute total force \(\vec{F}\) and momentum \(\vec{G}\) acting on a ship
+hull by adding forces acting on each panel. Then we solve the system of
+equations using numerical Runge---Kutta---Fehlberg method~\cite{mathews2004}.
+The vector of values determined by the method consists of all components of the
+following vectors: ship position, translational velocity, angular displacement
+and angular velocity (twelve variables in total). Since we are not interested
+in angular momentum, we use inertia matrix to obtain it from angular velocity
+and inverse inertia matrix to convert it back. Twelve vector components are too
+few to efficiently execute this method on a graphical accelerator and there is
+no other way of making iterative method parallel, so we execute it on a
+processor.
+\section{Results}
-\section{GPGPU}
+\begin{figure}
+ \centering
+ \begin{tikzpicture}[x=2.2cm,y=-1.5cm]
+ \node[Block] (s1) at (0,0) {\strut{}Wavy surface};
+ \node[Block] (s2) at (1,0) {\strut{}Autoreg. model};
+ \node[Block] (s3) at (2,0) {\strut{}Wave numbers};
+ \node[Block] (s4) at (3,0) {\strut{}Velocity potential};
+ \node[Block] (s5) at (4,0) {\strut{}Wave pressure};
+ \node[Block] (s6) at (4,1) {\strut{}Wetted surface};
+ \node[Block] (s7) at (3,1) {\strut{}Elevation deriv.};
+ \node[Block] (s8) at (2,1) {\strut{}Pressure force};
+ \node[Block] (s9) at (1,1) {\strut{}Ship velocities};
+ \path[Arrow] (s1) -- (s2);
+ \path[Arrow] (s2) -- (s3);
+ \path[Arrow] (s3) -- (s4);
+ \path[Arrow] (s4) -- (s5);
+ \path[Arrow] (s5.east) -- ++(0.2,0) |- (s6.east);
+ \path[Arrow] (s6) -- (s7);
+ \path[Arrow] (s7) -- (s8);
+ \path[Arrow] (s8) -- (s9);
+ \path[Arrow] (s9) -| (s1);
+ \end{tikzpicture}
+ \caption{Virtual testbed main loop.\label{fig:loop}}
+\end{figure}
-Compare CPU to GPU.
\section{Discussion}
-
-\section{Conclusion and future work}
+\section{Conclusion}
Wind simulation, rudder and propeller, compartment flooding and fire,
trochoidal waves.
diff --git a/references.bib b/references.bib
@@ -30,6 +30,15 @@
publisher = {Society of Naval Architects and Marine Engineers}
}
+@Book{ mathews2004,
+ address = {London},
+ edition = {4\textsuperscript{th}},
+ title = {Numerical methods using MATLAB},
+ publisher = {Pearson Prentice Hall},
+ author = {Mathews, John H. and Fink, Kurtis D.},
+ year = {2004}
+}
+
@Article{ ueng2008,
author = {Ueng, Shyh-Kuang and Lin, David and Liu, Chieh-Hong},
title = {A ship motion simulation system},