- Main Page
- Namespaces
- Data Structures
- Files

- Search for |

- File List
- Globals

# HydroSDL/hydro_source/return_results_to_file.cpp File Reference

`#include <vector>`
`#include "Datas.h"`
`#include "return_results_to_file.h"`
`#include "../CVODEincludes.h"`
`#include <stdio.h>`

Include dependency graph for return_results_to_file.cpp:

Go to the source code of this file.

## Namespaces
namespace | std
## Defines
#define | pi 3.141592653589793
#define | Ith(v, i) NV_Ith_S(v,i)
## Functions
void | store_state_for_file (double time, N_Vector state_at_t)
| Store state vector and time at each integration step.
int | write_results_to_file ()
| Write simulation results to file.
## Variables
vector< double > | sout00
vector< double > | sout01
vector< double > | sout02
vector< double > | sout03
vector< double > | sout04
vector< double > | sout05
vector< double > | sout06
vector< double > | sout07
vector< double > | sout08
vector< double > | sout09
vector< double > | sout10
vector< double > | sout11
vector< double > | timev

## Define Documentation

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

Definition at line 28 of file return_results_to_file.cpp.

#define PI 3.141592653589793

Definition at line 25 of file return_results_to_file.cpp.

#define pi 3.141592653589793

Definition at line 24 of file return_results_to_file.cpp.

## Function Documentation

void store_state_for_file | ( | double | time,
|  | N_Vector | state_at_t |
| ) |  |  |

Store state vector and time at each integration step.

If the programm has to return simulation results to file (see get_time()), the state vector and the time has to be stored at each integration step. They are stored in dynamic C++ vectors of type vector.

Parameters:

  | time |
  | state_at_t | in the data format used by the SUNDIALS ODE solver CVODE

Definition at line 47 of file return_results_to_file.cpp.

References Ith, sout00, sout01, sout02, sout03, sout04, sout05, sout06, sout07, sout08, sout09, sout10, sout11, and timev.

Referenced by solve_ODE().

int write_results_to_file | ( |  | ) |

Write simulation results to file.

Write simulation results to file. The file is called "SimResults.sim" and is in binary format to save disc space.

Returns:
  0 : write OK. 1: write error (abort)

Definition at line 65 of file return_results_to_file.cpp.

References sout00, sout01, sout02, sout03, sout04, sout05, sout06, sout07, sout08, sout09, sout10, sout11, and timev.

Referenced by main().

## Variable Documentation

vector<double> sout00

Definition at line 33 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout01

Definition at line 34 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout02

Definition at line 35 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout03

Definition at line 36 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout04

Definition at line 37 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout05

Definition at line 38 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout06

Definition at line 39 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout07

Definition at line 40 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout08

Definition at line 41 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout09

Definition at line 42 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout10

Definition at line 43 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> sout11

Definition at line 44 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().

vector<double> timev

Definition at line 45 of file return_results_to_file.cpp.

Referenced by store_state_for_file(), and write_results_to_file().