\hypertarget{f_8cpp}{
\section{D:/Basile/Visual\-Cpp\-Projects/hydro\-MEX3/hydro\-MEX3/f.cpp File Reference}
\label{f_8cpp}\index{D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/f.cpp@{D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/f.cpp}}
}
{\tt \#include \char`\"{}math.h\char`\"{}}\par
{\tt \#include \char`\"{}mex.h\char`\"{}}\par
{\tt \#include \char`\"{}string.h\char`\"{}}\par
{\tt \#include \char`\"{}hydro\_\-source/hydro\_\-includes.h\char`\"{}}\par
{\tt \#include \char`\"{}CVODEincludes.h\char`\"{}}\par
{\tt \#include \char`\"{}f.h\char`\"{}}\par


Include dependency graph for f.cpp:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=256pt]{f_8cpp__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{f_8cpp_1daf785e3f68d293c7caa1c756d5cb74}{pi}~3.141592653589793
\item 
\#define \hyperlink{f_8cpp_598a3330b3c21701223ee0ca14316eca}{PI}~3.141592653589793
\item 
\#define \hyperlink{f_8cpp_07521380e95cb0bd9c30b37bf54089eb}{Ith}(v, i)~NV\_\-Ith\_\-S(v,i-1)
\item 
\#define \hyperlink{f_8cpp_8411c7c4b6e3b6c2848d50803031205e}{IJth}(A, i, j)~DENSE\_\-ELEM(A,i-1,j-1)
\item 
\#define \hyperlink{f_8cpp_2b6ba3ea1fe3e8cc970ad05cd05d703b}{NEQ}~12
\item 
\#define \hyperlink{f_8cpp_d41b89d4eb6d63a0def5e5fd2a5ab326}{T0}~RCONST(0.0)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static int \hyperlink{f_8cpp_1fef977d88f69785269a54b9229e6a33}{f} (realtype t, N\_\-Vector y, N\_\-Vector ydot, void $\ast$f\_\-data)
\begin{CompactList}\small\item\em Wrap function for solver f for computing of $ f $ in $ \frac{\partial\vec{q}}{\partial t}=f(\vec{q}, \vec{Q}, \vec{p}) $. \item\end{CompactList}\item 
void \hyperlink{f_8cpp_24102a4d62e2b51baee103e790570cc5}{solver\_\-init} (\hyperlink{struct_o_d_e__data}{ODE\_\-data} $\ast$f\_\-dat)
\begin{CompactList}\small\item\em Solver initialisation. \item\end{CompactList}\item 
void \hyperlink{f_8cpp_60226ceb6bc6fc436c4b9cf34340f070}{solve\_\-ODE} (\hyperlink{struct_o_d_e__data}{ODE\_\-data} $\ast$f\_\-dat, realtype tout)
\begin{CompactList}\small\item\em ODE solving. \item\end{CompactList}\item 
void \hyperlink{f_8cpp_f6088f75e5ffd83c522018dbbf1e5c9f}{solver\_\-free} (\hyperlink{struct_o_d_e__data}{ODE\_\-data} $\ast$f\_\-dat)
\begin{CompactList}\small\item\em Free solver memory. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
\begin{Desc}
\item[Author:]\href{mailto:basile.graf@epfl.ch}{\tt basile.graf@epfl.ch}\end{Desc}
This file contains stuff related to evaluation of $ f $ in $ \frac{\partial\vec{q}}{\partial t}=f(\vec{q}, \vec{Q}, \vec{p}) $ and stuff related to the ODE solver (initialisation, solving, closing) 

Definition in file \hyperlink{f_8cpp-source}{f.cpp}.

\subsection{Define Documentation}
\hypertarget{f_8cpp_8411c7c4b6e3b6c2848d50803031205e}{
\index{f.cpp@{f.cpp}!IJth@{IJth}}
\index{IJth@{IJth}!f.cpp@{f.cpp}}
\subsubsection[IJth]{\setlength{\rightskip}{0pt plus 5cm}\#define IJth(A, i, j)~DENSE\_\-ELEM(A,i-1,j-1)}}
\label{f_8cpp_8411c7c4b6e3b6c2848d50803031205e}




Definition at line 40 of file f.cpp.\hypertarget{f_8cpp_07521380e95cb0bd9c30b37bf54089eb}{
\index{f.cpp@{f.cpp}!Ith@{Ith}}
\index{Ith@{Ith}!f.cpp@{f.cpp}}
\subsubsection[Ith]{\setlength{\rightskip}{0pt plus 5cm}\#define Ith(v, i)~NV\_\-Ith\_\-S(v,i-1)}}
\label{f_8cpp_07521380e95cb0bd9c30b37bf54089eb}




Definition at line 39 of file f.cpp.

Referenced by f(), solver\_\-init(), and store\_\-state().\hypertarget{f_8cpp_2b6ba3ea1fe3e8cc970ad05cd05d703b}{
\index{f.cpp@{f.cpp}!NEQ@{NEQ}}
\index{NEQ@{NEQ}!f.cpp@{f.cpp}}
\subsubsection[NEQ]{\setlength{\rightskip}{0pt plus 5cm}\#define NEQ~12}}
\label{f_8cpp_2b6ba3ea1fe3e8cc970ad05cd05d703b}




Definition at line 44 of file f.cpp.

Referenced by solver\_\-init().\hypertarget{f_8cpp_598a3330b3c21701223ee0ca14316eca}{
\index{f.cpp@{f.cpp}!PI@{PI}}
\index{PI@{PI}!f.cpp@{f.cpp}}
\subsubsection[PI]{\setlength{\rightskip}{0pt plus 5cm}\#define PI~3.141592653589793}}
\label{f_8cpp_598a3330b3c21701223ee0ca14316eca}




Definition at line 33 of file f.cpp.\hypertarget{f_8cpp_1daf785e3f68d293c7caa1c756d5cb74}{
\index{f.cpp@{f.cpp}!pi@{pi}}
\index{pi@{pi}!f.cpp@{f.cpp}}
\subsubsection[pi]{\setlength{\rightskip}{0pt plus 5cm}\#define pi~3.141592653589793}}
\label{f_8cpp_1daf785e3f68d293c7caa1c756d5cb74}




Definition at line 32 of file f.cpp.

Referenced by aero\_\-coeff\_\-control(), data\_\-init(), data\_\-update\_\-param(), fill\-Wave\-Luts(), wave\_\-z\_\-compute(), Wcos(), and Wsin().\hypertarget{f_8cpp_d41b89d4eb6d63a0def5e5fd2a5ab326}{
\index{f.cpp@{f.cpp}!T0@{T0}}
\index{T0@{T0}!f.cpp@{f.cpp}}
\subsubsection[T0]{\setlength{\rightskip}{0pt plus 5cm}\#define T0~RCONST(0.0)}}
\label{f_8cpp_d41b89d4eb6d63a0def5e5fd2a5ab326}




Definition at line 45 of file f.cpp.

\subsection{Function Documentation}
\hypertarget{f_8cpp_1fef977d88f69785269a54b9229e6a33}{
\index{f.cpp@{f.cpp}!f@{f}}
\index{f@{f}!f.cpp@{f.cpp}}
\subsubsection[f]{\setlength{\rightskip}{0pt plus 5cm}static int f (realtype {\em t}, N\_\-Vector {\em y}, N\_\-Vector {\em ydot}, void $\ast$ {\em f\_\-data})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{f_8cpp_1fef977d88f69785269a54b9229e6a33}


Wrap function for solver f for computing of $ f $ in $ \frac{\partial\vec{q}}{\partial t}=f(\vec{q}, \vec{Q}, \vec{p}) $. 

This function makes the bridge between the Sundials ODE-solver and the evaluation function \hyperlink{compute__state__dot_8cpp_60cfec47058582dd72696849d65b57e5}{compute\_\-state\_\-dot()} \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em t}]: time \item[{\em y}]: state ($ \vec{q} $) in the datatype needed by the solver \item[{\em ydot}]: evaluation output ($ \frac{\partial\vec{q}}{\partial t} $) \item[{\em $\ast$f\_\-data,:}]pointer of type void, pointing on the \hyperlink{struct_o_d_e__data}{ODE\_\-data} type struct containing all the model's data \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]: 0 (no meaning yet $<$=$>$ no integration error handling yet!!!) \end{Desc}


Definition at line 63 of file f.cpp.

References compute\_\-state\_\-dot(), ODE\_\-data::d, data\_\-update\_\-state(), datas::ddq, datas::dphi, datas::dpsi, datas::dtheta, datas::dx, datas::dy, datas::dz, Ith, ODE\_\-data::P, and ODE\_\-data::state.

Referenced by Draw\_\-sea(), Draw\-GLScene(), fill\-Wave\-Luts(), Girouette\_\-draw(), HSlider\_\-draw(), Init\-GL(), joystick\_\-get\-XYZR(), one\_\-normal(), Relative\-Wind\_\-draw(), Re\-Size\-GLScene(), Sail\_\-create\_\-and\_\-draw(), Target\_\-draw(), toc(), VSlider\_\-draw(), wave\_\-z\_\-compute(), and Wsin().\hypertarget{f_8cpp_60226ceb6bc6fc436c4b9cf34340f070}{
\index{f.cpp@{f.cpp}!solve_ODE@{solve\_\-ODE}}
\index{solve_ODE@{solve\_\-ODE}!f.cpp@{f.cpp}}
\subsubsection[solve\_\-ODE]{\setlength{\rightskip}{0pt plus 5cm}void solve\_\-ODE (\hyperlink{struct_o_d_e__data}{ODE\_\-data} $\ast$ {\em f\_\-dat}, realtype {\em tout})}}
\label{f_8cpp_60226ceb6bc6fc436c4b9cf34340f070}


ODE solving. 

Solve the ODE from current time up to $ t_{out} $ \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em $\ast$f\_\-dat,:}]pointer to structure of type \hyperlink{struct_o_d_e__data}{ODE\_\-data} \item[{\em tout,:}]output time \end{description}
\end{Desc}


Definition at line 233 of file f.cpp.

References ODE\_\-data::Cumul\-Num\-Of\-Steps, ODE\_\-data::cvode\_\-mem, ODE\_\-data::d, ODE\_\-data::flag, store\_\-state(), datas::t, ODE\_\-data::time\_\-param, and ODE\_\-data::y.

Referenced by mex\-Function().\hypertarget{f_8cpp_f6088f75e5ffd83c522018dbbf1e5c9f}{
\index{f.cpp@{f.cpp}!solver_free@{solver\_\-free}}
\index{solver_free@{solver\_\-free}!f.cpp@{f.cpp}}
\subsubsection[solver\_\-free]{\setlength{\rightskip}{0pt plus 5cm}void solver\_\-free (\hyperlink{struct_o_d_e__data}{ODE\_\-data} $\ast$ {\em f\_\-dat})}}
\label{f_8cpp_f6088f75e5ffd83c522018dbbf1e5c9f}


Free solver memory. 

Free solver memory \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em $\ast$f\_\-dat,:}]pointer to structure of type \hyperlink{struct_o_d_e__data}{ODE\_\-data} \end{description}
\end{Desc}


Definition at line 255 of file f.cpp.

References ODE\_\-data::cvode\_\-mem, and ODE\_\-data::y.

Referenced by mex\-Function().\hypertarget{f_8cpp_24102a4d62e2b51baee103e790570cc5}{
\index{f.cpp@{f.cpp}!solver_init@{solver\_\-init}}
\index{solver_init@{solver\_\-init}!f.cpp@{f.cpp}}
\subsubsection[solver\_\-init]{\setlength{\rightskip}{0pt plus 5cm}void solver\_\-init (\hyperlink{struct_o_d_e__data}{ODE\_\-data} $\ast$ {\em f\_\-dat})}}
\label{f_8cpp_24102a4d62e2b51baee103e790570cc5}


Solver initialisation. 

Solver initialisation \par
 Don't forgett to call \hyperlink{f_8cpp_f6088f75e5ffd83c522018dbbf1e5c9f}{solver\_\-free()}! \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em $\ast$f\_\-dat,:}]pointer to structure of type \hyperlink{struct_o_d_e__data}{ODE\_\-data} \end{description}
\end{Desc}


Definition at line 154 of file f.cpp.

References ODE\_\-data::abstol, ODE\_\-data::cvode\_\-mem, Ith, NEQ, ODE\_\-data::state, and ODE\_\-data::y.

Referenced by mex\-Function().