D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/f.cpp File Reference

#include "math.h"
#include "mex.h"
#include "string.h"
#include "hydro_source/hydro_includes.h"
#include "CVODEincludes.h"
#include "f.h"

Include dependency graph for f.cpp:

Go to the source code of this file.

Defines

#define pi   3.141592653589793
#define PI   3.141592653589793
#define Ith(v, i)   NV_Ith_S(v,i-1)
#define IJth(A, i, j)   DENSE_ELEM(A,i-1,j-1)
#define NEQ   12
#define T0   RCONST(0.0)

Functions

static int f (realtype t, N_Vector y, N_Vector ydot, void *f_data)
 Wrap function for solver f for computing of $ f $ in $ \frac{\partial\vec{q}}{\partial t}=f(\vec{q}, \vec{Q}, \vec{p}) $.
void solver_init (ODE_data *f_dat)
 Solver initialisation.
void solve_ODE (ODE_data *f_dat, realtype tout)
 ODE solving.
void solver_free (ODE_data *f_dat)
 Free solver memory.


Detailed Description

Author:
basile.graf@epfl.ch
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 f.cpp.


Define Documentation

#define IJth A,
i,
 )     DENSE_ELEM(A,i-1,j-1)
 

Definition at line 40 of file f.cpp.

#define Ith v,
 )     NV_Ith_S(v,i-1)
 

Definition at line 39 of file f.cpp.

Referenced by f(), solver_init(), and store_state().

#define NEQ   12
 

Definition at line 44 of file f.cpp.

Referenced by solver_init().

#define PI   3.141592653589793
 

Definition at line 33 of file f.cpp.

#define pi   3.141592653589793
 

Definition at line 32 of file f.cpp.

Referenced by aero_coeff_control(), data_init(), data_update_param(), fillWaveLuts(), wave_z_compute(), Wcos(), and Wsin().

#define T0   RCONST(0.0)
 

Definition at line 45 of file f.cpp.


Function Documentation

static int f realtype  t,
N_Vector  y,
N_Vector  ydot,
void *  f_data
[static]
 

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 compute_state_dot()

Parameters:
t : time
y : state ($ \vec{q} $) in the datatype needed by the solver
ydot : evaluation output ($ \frac{\partial\vec{q}}{\partial t} $)
*f_data,: pointer of type void, pointing on the ODE_data type struct containing all the model's data
Returns:
: 0 (no meaning yet <=> no integration error handling yet!!!)

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(), DrawGLScene(), fillWaveLuts(), Girouette_draw(), HSlider_draw(), InitGL(), joystick_getXYZR(), one_normal(), RelativeWind_draw(), ReSizeGLScene(), Sail_create_and_draw(), Target_draw(), toc(), VSlider_draw(), wave_z_compute(), and Wsin().

void solve_ODE ODE_data f_dat,
realtype  tout
 

ODE solving.

Solve the ODE from current time up to $ t_{out} $

Parameters:
*f_dat,: pointer to structure of type ODE_data
tout,: output time

Definition at line 233 of file f.cpp.

References ODE_data::CumulNumOfSteps, ODE_data::cvode_mem, ODE_data::d, ODE_data::flag, store_state(), datas::t, ODE_data::time_param, and ODE_data::y.

Referenced by mexFunction().

void solver_free ODE_data f_dat  ) 
 

Free solver memory.

Free solver memory

Parameters:
*f_dat,: pointer to structure of type ODE_data

Definition at line 255 of file f.cpp.

References ODE_data::cvode_mem, and ODE_data::y.

Referenced by mexFunction().

void solver_init ODE_data f_dat  ) 
 

Solver initialisation.

Solver initialisation
Don't forgett to call solver_free()!

Parameters:
*f_dat,: pointer to structure of type ODE_data

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 mexFunction().


Generated on Fri Jun 9 19:10:25 2006 for hydroMex3 by  doxygen 1.4.6-NO