Functions
diagnostics.hpp File Reference

Contains function that write simulation data to a file. More...

#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include "hdsim2d.hpp"
#include "../../misc/utils.hpp"
#include "../../tessellation/ConvexHull.hpp"
#include "physical_geometry.hpp"
Include dependency graph for diagnostics.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void BinOutput (string location, hdsim const &sim, Tessellation const &V, bool floatprecision=true)
 Outputs the simulation data into a binary file (float precision) as follows: 1) Int - Number of cells=n 2) For each cell it's x and y coordinate (2 floats)*n 3) Pressure (n floats) 4) Density (n floats) 5) For each cell an int=N, stating the number of vertices and then the vertices(2*N floats) 6) The time - float 7) The number of cells with tracers - int 8) The number of tracers - int 9) The passive tracers written cell by cell (float) More...
 
Extensive total_conserved (hdsim const &sim)
 Calculates the total extensive conserved variables of the entire computational domain. More...
 
double total_tracer (const hdsim &sim, const int index)
 Calculates the total amount of tracer in computational domain. More...
 
void DisplayError (UniversalError const &eo)
 Displays the UniversalError information. More...
 
void write_error (const string &fname, const UniversalError &eo)
 Writes all the error information to a file. More...
 
void WriteVector2DToFile (vector< Vector2D > const &vec, string filename)
 Writes a vector of Vector2D to a binary file. More...
 
vector< Vector2DReadVector2DFromFile (string filename)
 Reads a vector of Vector2D from a binary file. More...
 

Detailed Description

Contains function that write simulation data to a file.

Author
Almog Yalinewich

Definition in file diagnostics.hpp.

Function Documentation

◆ BinOutput()

void BinOutput ( string  location,
hdsim const &  sim,
Tessellation const &  V,
bool  floatprecision = true 
)

Outputs the simulation data into a binary file (float precision) as follows: 1) Int - Number of cells=n 2) For each cell it's x and y coordinate (2 floats)*n 3) Pressure (n floats) 4) Density (n floats) 5) For each cell an int=N, stating the number of vertices and then the vertices(2*N floats) 6) The time - float 7) The number of cells with tracers - int 8) The number of tracers - int 9) The passive tracers written cell by cell (float)

Parameters
locationThe output file's location
simThe hydro sim
VThe tessellation
floatprecisionA flag to choose output in float/double precision

◆ DisplayError()

void DisplayError ( UniversalError const &  eo)

Displays the UniversalError information.

Parameters
eoTh UniversalError

Definition at line 9 of file diagnostics.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadVector2DFromFile()

vector<Vector2D> ReadVector2DFromFile ( string  filename)

Reads a vector of Vector2D from a binary file.

Returns
The vector that was read
Parameters
filenameThe path to the output file

Definition at line 58 of file diagnostics.cpp.

◆ total_conserved()

Extensive total_conserved ( hdsim const &  sim)

Calculates the total extensive conserved variables of the entire computational domain.

Parameters
simHydrodynamic simulation
Returns
The total conserved of the simulation

Definition at line 52 of file diagnostics.cpp.

Here is the call graph for this function:

◆ total_tracer()

double total_tracer ( const hdsim sim,
const int  index 
)

Calculates the total amount of tracer in computational domain.

Parameters
simHydrodynamic simulation
indexIndex of tracer
Returns
Total amount of certain tracer

◆ write_error()

void write_error ( const string &  fname,
const UniversalError eo 
)

Writes all the error information to a file.

Parameters
fnameFile name
eoError object

Definition at line 17 of file diagnostics.cpp.

Here is the call graph for this function:

◆ WriteVector2DToFile()

void WriteVector2DToFile ( vector< Vector2D > const &  vec,
string  filename 
)

Writes a vector of Vector2D to a binary file.

Parameters
vecThe vector to write
filenameThe path to the output file

Definition at line 77 of file diagnostics.cpp.