VERB_code_2.3
Parameters.cpp File Reference
#include "Parameters.h"
#include "../VariousFunctions/variousFunctions.h"
#include "../Exceptions/error.h"
#include "../Logging/Output.h"
#include "../VariousFunctions/erf.h"
#include <iostream>
#include <iomanip>

Go to the source code of this file.

Functions

template<typename T >
bool ReadFromFile (T &variable, ifstream &parameters_file, string variable_name, string default_value="")
 
void StrToVal (string input, double &place)
 
void StrToVal (string input, int &place)
 
void StrToVal (string input, string &place)
 
void StrToVal (string input, bool &place)
 
bool str2bool (string str)
 
string bool2str (bool b)
 
void load_1d (Matrix1D< double > &var, string filename, double dt, int var_size)
 
void load_2d (Matrix2D< double > &var, string filename, double dt, int var_size_x, int var_size_y)
 
double & T_2d_double_vector_add (T_2d_double_vector &v, size_t x, size_t y)
 

Detailed Description

Loads parameters. Loads parameters from file into map, then use parameters-structure related functions to get parameters values from the map and store them into the parameters structures.

Author
Developed under supervision of the PI Yuri Shprits

Definition in file Parameters.cpp.

Function Documentation

string bool2str ( bool  b)

Converting boolean to string.

Definition at line 591 of file Parameters.cpp.

void load_1d ( Matrix1D< double > &  var,
string  filename,
double  dt,
int  var_size 
)

Read 1d matrix_array from txt-file and interpolate to out time-axis.

Definition at line 598 of file Parameters.cpp.

void load_2d ( Matrix2D< double > &  var,
string  filename,
double  dt,
int  var_size_x,
int  var_size_y 
)

Read 2d matrix_array from txt-file and interpolate to out time-axis. NEED TO BE TESTED

Definition at line 642 of file Parameters.cpp.

template<typename T >
bool ReadFromFile ( T &  variable,
ifstream &  parameters_file,
string  variable_name,
string  default_value = "" 
)

Read each parameter from parameters file

Definition at line 25 of file Parameters.cpp.

bool str2bool ( string  str)

Converting string to boolean.

Definition at line 583 of file Parameters.cpp.

void StrToVal ( string  input,
double &  place 
)

Converting string to double.

Definition at line 550 of file Parameters.cpp.

void StrToVal ( string  input,
int &  place 
)

Converting string to int.

Definition at line 558 of file Parameters.cpp.

void StrToVal ( string  input,
string &  place 
)

Converting string to string. Function StrToVal is used in template, so we need thad function to make template function works in case of string.

Definition at line 566 of file Parameters.cpp.

void StrToVal ( string  input,
bool &  place 
)

Converting string to bool.

Definition at line 574 of file Parameters.cpp.

double& T_2d_double_vector_add ( T_2d_double_vector v,
size_t  x,
size_t  y 
)

function needs to operate with 2d vectors (add value) resizes vector to parameter length, return value at proper indices

Parameters
&v- typedef 2D vector of vector of doubles
x- length x
y- length y

Definition at line 723 of file Parameters.cpp.