- Main Page
- Namespaces
- Data Structures
- Files

- Search for |

- File List
- Globals

# HydroSDL/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 | 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 in .
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 in and stuff related to the ODE solver (initialisation, solving, closing)

Definition in file f.cpp.

## Define Documentation

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

Definition at line 40 of file f.cpp.

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

Definition at line 39 of file f.cpp.

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

#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 46 of file f.cpp.

Referenced by solver_init().

## 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 in .

This function makes the bridge between the Sundials ODE-solver and the evaluation function compute_state_dot()

Parameters:

  | t | : time
  | y | : state () in the datatype needed by the solver
  | ydot | : evaluation output ()
  | *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 64 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, f_dat, Ith, ODE_data::P, and ODE_data::state.

Referenced by draw_panorama(), Draw_sea(), DrawGLScene(), fillWaveLuts(), Girouette_draw(), HSlider_draw(), joystick_getXYZR(), one_normal(), RelativeWind_draw(), Sail_create_and_draw(), SDL_GL_RenderText(), setup_opengl(), solver_init(), 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

Parameters:

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

Definition at line 234 of file f.cpp.

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

Referenced by main().

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 256 of file f.cpp.

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

Referenced by quit_tutorial().

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 155 of file f.cpp.

References ODE_data::abstol, parameters::abstol, ODE_data::cvode_mem, f(), f_dat, ODE_data::flag, Ith, NEQ, ODE_data::P, ODE_data::reltol, parameters::reltol, ODE_data::state, T0, and ODE_data::y.

Referenced by main().