PAPRECA hybrid off-lattice kMC/MD simulator  2.0.0 (17 September 2024)
utilities.h File Reference

Utility functions (e.g., for arrays, strings etc.) and typedefs used in papreca.cpp main and in the other header files. More...

#include <iostream>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <vector>
#include <string>
#include <algorithm>
#include <cctype>
#include <mpi.h>
#include "pointers.h"
#include "papreca_error.h"
Include dependency graph for utilities.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PAPRECA::PairHash
 Utility hash function (struct) for custom typedefs. More...
 

Namespaces

 PAPRECA
 

Typedefs

typedef std::pair< int, int > PAPRECA::INT_PAIR
 
typedef std::unordered_set< INT_PAIR, PairHash > PAPRECA::PAIR_SET
 
typedef std::unordered_map< INT_PAIR, double, PairHash > PAPRECA::INTPAIR2DOUBLE_MAP
 
typedef std::unordered_map< INT_PAIR, int, PairHash > PAPRECA::INTPAIR2INT_MAP
 
typedef std::unordered_map< int, int > PAPRECA::INT2INT_MAP
 
typedef std::unordered_map< int, INT2INT_MAP > PAPRECA::INT2INTSMAP_MAP
 
typedef std::unordered_set< int > PAPRECA::INT_SET
 
typedef std::unordered_set< LAMMPS_NS::tagint > PAPRECA::TAGINT_SET
 
typedef std::array< double, 3 > PAPRECA::ARRAY3D
 
typedef std::pair< double, int > PAPRECA::DOUBLE2INTPAIR
 
typedef std::vector< DOUBLE2INTPAIR > PAPRECA::DOUBLE2INTPAIR_VEC
 

Functions

double PAPRECA::doubleArrSum (double *arr, const int &size)
 
void PAPRECA::copyDoubleArray3D (double *copy, const double *source, const int start, const int end)
 
template<typename T >
PAPRECA::getSumOfVecElements (const std::vector< T > &vec)
 
template<typename T , size_t N>
void PAPRECA::pushArrayToVector (const T *arr, std::vector< T > &vec)
 
template<typename T >
std::vector< T > PAPRECA::getSubVectorFromVector (const std::vector< T > &vec, size_t start, size_t end)
 
template<typename T , typename Hash >
bool PAPRECA::elementIsInUnorderedSet (const std::unordered_set< T, Hash > &set, const T &element)
 
template<typename KeyType , typename ValueType , typename Hash >
bool PAPRECA::mappingExists (const std::unordered_map< KeyType, ValueType, Hash > &map, const KeyType &key)
 
template<typename T >
bool PAPRECA::elementIsInVector (const std::vector< T > &vec, const T &element)
 
const std::string PAPRECA::getConcatenatedStringFromStringsVector (const std::vector< std::string > &strings, size_t start=-1, size_t end=-1)
 
const std::string PAPRECA::getConcatenatedStringWithSpacesFromStringsVector (const std::vector< std::string > &strings, size_t start=-1, size_t end=-1)
 
const int PAPRECA::getStringPosInStringVec (const std::string &string2check, const std::vector< std::string > &strings)
 
bool PAPRECA::stringIsNumber (const std::string &string)
 
bool PAPRECA::stringIsIntNumber (const std::string &string)
 
const bool PAPRECA::stringIsBool (const std::string &string)
 
const unsigned long int PAPRECA::string2UnsignedLongInt (std::string &string)
 
const int PAPRECA::string2Int (std::string &string)
 
const double PAPRECA::string2Double (std::string &string)
 
const bool PAPRECA::string2Bool (std::string &string)
 
const int PAPRECA::boolString2Int (std::string &string)
 

Detailed Description

Utility functions (e.g., for arrays, strings etc.) and typedefs used in papreca.cpp main and in the other header files.