Hex  2.2
Hydrogen-electron collision solver
Functions
utils.h File Reference
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include "hex-arrays.h"
#include "hex-vec3d.h"
#include "db.h"
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double change_units (eUnit A, eUnit B)
 Energy units change. More...
 
double change_units (lUnit A, lUnit B)
 Lengths units change. More...
 
double change_units (aUnit A, aUnit B)
 Angular units change. More...
 
std::string unit_name (eUnit u)
 Energy unit name. More...
 
std::string unit_name (lUnit u)
 Length unit name. More...
 
std::string unit_name (aUnit u)
 Length unit name. More...
 
std::ostream & operator<< (std::ostream &os, std::pair< geom::vec3d, geom::vec3d > const &p)
 
std::istream & operator>> (std::istream &is, std::pair< geom::vec3d, geom::vec3d > &p)
 
std::istream & operator>> (std::istream &is, iArray &p)
 
template<typename T >
std::vector< T > readStandardInput ()
 
template<typename T >
Conv (std::map< std::string, std::string > const &dict, std::string const &keyword, std::string const &name)
 Convert dictionary entry to a numeric type. More...
 

Function Documentation

◆ change_units() [1/3]

double change_units ( eUnit  A,
eUnit  B 
)

Returns factor that can be used to transform from the unit system A to the unit system B.

◆ change_units() [2/3]

double change_units ( lUnit  A,
lUnit  B 
)

Returns factor that can be used to transform from the unit system A to the unit system B.

◆ change_units() [3/3]

double change_units ( aUnit  A,
aUnit  B 
)

Returns factor that can be used to transform from the unit system A to the unit system B.

◆ Conv()

template<typename T >
T Conv ( std::map< std::string, std::string > const &  dict,
std::string const &  keyword,
std::string const &  name 
)

Being given a dictionary (= string-string map) and a keyword, the function finds a correct entry and returns its value converted to the template datatype.

Parameters
dictDictionary to search in.
keywordEntry to look for.
nameIdentification of the calling authority for use in error message if the entry is not find.

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
std::pair< geom::vec3d, geom::vec3d > const &  p 
)
inline

Write out std::pair.

◆ operator>>() [1/2]

std::istream& operator>> ( std::istream &  is,
std::pair< geom::vec3d, geom::vec3d > &  p 
)
inline

Read in std::pair.

◆ operator>>() [2/2]

std::istream& operator>> ( std::istream &  is,
iArray &  p 
)
inline

Read in std::vector<int>. Allowed are comma-separated values and integer ranges.

◆ readStandardInput()

template<typename T >
std::vector<T> readStandardInput ( )

Read data from standard input.

◆ unit_name() [1/3]

std::string unit_name ( eUnit  u)

Return energy unit name as string.

◆ unit_name() [2/3]

std::string unit_name ( lUnit  u)

Return length unit name as string.

◆ unit_name() [3/3]

std::string unit_name ( aUnit  u)

Return length unit name as string.