- Main Page
- Namespaces
- Data Structures
- Files

- Search for |

- File List
- Globals

# HydroSDL/hydro_source/get_file_arguments.cpp File Reference

`#include "get_file_arguments.h"`

Include dependency graph for get_file_arguments.cpp:

Go to the source code of this file.

## Data Structures
struct | readStruct
## Defines
#define | pi 3.141592653589793
## Functions
void | initParameters (struct parameters *P)
| Initialise parameters struct.
void | initJoyParameters (struct joy_parameters *jP)
| Initialise joystick struct.
void | print_arguments_values (struct parameters *P, struct joy_parameters *jP, double *state, double *time)
| Print parameters and initial conditions.
void | copy_to_arg (readStruct *rd, struct parameters *P, struct joy_parameters *jP, double *state, double *time)
| Copy readed values to their "destination".
int | read_arguments_from_file (struct parameters *P, struct joy_parameters *jP, double *state, double *time)
| Read arguments from file.

## Detailed Description

Author:
  basile.graf@epfl.ch

Functions to read the input parameters from the input parameters file. This file is in the program folder or is generated by MATLAB

Definition in file get_file_arguments.cpp.

## Define Documentation

#define PI 3.141592653589793

Definition at line 14 of file get_file_arguments.cpp.

#define pi 3.141592653589793

Definition at line 13 of file get_file_arguments.cpp.

## Function Documentation

void copy_to_arg | ( | readStruct * | rd,
|  | struct parameters * | P,
|  | struct joy_parameters * | jP,
|  | double * | state,
|  | double * | time |
| ) |  |  |

Copy readed values to their "destination".

Copy readed values (from file) to their "destination"

Parameters:

  | *rd | : pointer to the stuct containing readed values
  | *P | : pointer to the parameters struct
  | *jP | : pointer to the joy_parameters struct
  | *state | : pointer to the state vector
  | *time | : pointer to the time parameter

Definition at line 110 of file get_file_arguments.cpp.

References readStruct::abstol, parameters::abstol, readStruct::dirDo, joy_parameters::dirR, joy_parameters::dirX, joy_parameters::dirY, joy_parameters::dirZ, joy_parameters::doR, joy_parameters::doX, joy_parameters::doY, joy_parameters::doZ, readStruct::param, parameters::param, PARAMNUM, readStruct::reltol, parameters::reltol, readStruct::SimTime, STATENUM, and readStruct::X0.

Referenced by read_arguments_from_file().

void initJoyParameters | ( | struct joy_parameters * | jP | ) |

Initialise joystick struct.

Set joystick values to default

Parameters:

  | *jP | : pointer to the joy_parameters struct to be initialized

Definition at line 49 of file get_file_arguments.cpp.

References joy_parameters::dirR, joy_parameters::dirX, joy_parameters::dirY, joy_parameters::dirZ, joy_parameters::doR, joy_parameters::doX, joy_parameters::doY, and joy_parameters::doZ.

Referenced by read_arguments_from_file().

void initParameters | ( | struct parameters * | P | ) |

Initialise parameters struct.

Set parameters values to default/0

Parameters:

  | *P | : pointer to the parameterss struct to be initialized

Definition at line 34 of file get_file_arguments.cpp.

References parameters::abstol, parameters::param, PARAMNUM, parameters::reltol, and STATENUM.

Referenced by read_arguments_from_file().

void print_arguments_values | ( | struct parameters * | P,
|  | struct joy_parameters * | jP,
|  | double * | state,
|  | double * | time |
| ) |  |  |

Print parameters and initial conditions.

Print parameters and initial conditions to the standard error

Parameters:

  | *P | : pointer to the parameters struct
  | *jP | : pointer to the joy_parameters struct
  | *state | : pointer to the state vector
  | *time | : pointer to the time parameter

Definition at line 71 of file get_file_arguments.cpp.

References parameters::abstol, joy_parameters::dirR, joy_parameters::dirX, joy_parameters::dirY, joy_parameters::dirZ, joy_parameters::doR, joy_parameters::doX, joy_parameters::doY, joy_parameters::doZ, parameters::param, PARAMNUM, parameters::reltol, and STATENUM.

Referenced by read_arguments_from_file().

int read_arguments_from_file | ( | struct parameters * | P,
|  | struct joy_parameters * | jP,
|  | double * | state,
|  | double * | time |
| ) |  |  |

Read arguments from file.

Global function to get the arguments values from the file (the one to use from outside this scope)

Parameters:

  | *P | : pointer to the parameters struct
  | *jP | : pointer to the joy_parameters struct
  | *state | : pointer to the state vector
  | *time | : pointer to the time parameter

Definition at line 138 of file get_file_arguments.cpp.

References readStruct::abstol, copy_to_arg(), readStruct::dirDo, initJoyParameters(), initParameters(), readStruct::param, PARAMNUM, print_arguments_values(), readStruct::reltol, readStruct::SimTime, STATENUM, and readStruct::X0.

Referenced by main().