MolSys

Data Structures

struct  molSys::Result
 This contains the bond classifier of enum type bond_type, and the bond correlation factor. More...
 
struct  molSys::Point< T >
 This contains per-particle information. More...
 
struct  molSys::PointCloud< S, T >
 This contains a collection of points; contains information for a particular frame. More...
 

Enumerations

enum  molSys::bond_type { molSys::staggered , molSys::eclipsed , molSys::out_of_range }
 
enum  molSys::atom_state_type {
  molSys::cubic , molSys::hexagonal , molSys::water , molSys::interfacial ,
  molSys::clathrate , molSys::interClathrate , molSys::unclassified , molSys::reCubic ,
  molSys::reHex
}
 

Functions

std::unordered_map< int, int > molSys::createIDMolIDmap (molSys::PointCloud< molSys::Point< double >, double > *yCloud)
 
std::vector< std::vector< int > > molSys::hAtomMolList (molSys::PointCloud< molSys::Point< double >, double > *hCloud, molSys::PointCloud< molSys::Point< double >, double > *oCloud)
 
int molSys::searchMolList (std::vector< std::vector< int >> molList, int molIDtoFind)
 
molSys::PointCloud< molSys::Point< double >, double > molSys::clearPointCloud (molSys::PointCloud< molSys::Point< double >, double > *yCloud)
 //! Function for clearing vectors in PointCloud after multiple usage More...
 

Variables

bond_type molSys::Result::classifier
 
double molSys::Result::c_value
 Classifier according to CHILL, CHILL+ etc. More...
 
int molSys::Point< T >::type
 
int molSys::Point< T >::molID
 
int molSys::Point< T >::atomID
 
molSys::Point< T >::x
 type ID, molID, atomID More...
 
molSys::Point< T >::y
 
molSys::Point< T >::z
 
std::vector< ResultmolSys::Point< T >::c_ij
 coordinates More...
 
atom_state_type molSys::Point< T >::iceType
 Results (contains bond correlation type) More...
 
bool molSys::Point< T >::inSlice = true
 Type of ice/water etc based on cij. More...
 
std::vector< S > molSys::PointCloud< S, T >::pts
 
int molSys::PointCloud< S, T >::currentFrame
 Collection of points. More...
 
int molSys::PointCloud< S, T >::nop
 Current frame number. More...
 
std::vector< T > molSys::PointCloud< S, T >::box
 Number of atoms. More...
 
std::vector< T > molSys::PointCloud< S, T >::boxLow
 Periodic box lengths. More...
 
std::unordered_map< int, int > molSys::PointCloud< S, T >::idIndexMap
 xlo, ylo, zlo More...
 

Detailed Description

Enumeration Type Documentation

◆ atom_state_type

Enumerator
cubic 

Ic, or particle type signifying Cubic Ice.

hexagonal 

Ih, or particle type signifying Hexagonal Ice.

water 

Liquid/amorphous phase.

interfacial 

Interfacial ice: ice-like molecules which do not fulfill the strict criteria of the Ic or Ih phases.

clathrate 

Clathrate ice phase.

interClathrate 

Interfacial clathrate ice phase.

unclassified 

Not classified into any other category.

reCubic 

Reclassified as cubic ice, according to the \(q_6\) order parameter.

reHex 

Reclassified as hexagonal ice, according to the \(q_6\) order parameter.

Definition at line 109 of file mol_sys.hpp.

109  {
110  cubic,
111  hexagonal,
112  water,
113  interfacial,
114  clathrate,
116  unclassified,
117  reCubic,
118  reHex
119 };
@ cubic
Ic, or particle type signifying Cubic Ice.
Definition: mol_sys.hpp:110
@ hexagonal
Ih, or particle type signifying Hexagonal Ice.
Definition: mol_sys.hpp:111
@ interClathrate
Interfacial clathrate ice phase.
Definition: mol_sys.hpp:115
@ interfacial
Interfacial ice: ice-like molecules which do not fulfill the strict criteria of the Ic or Ih phases.
Definition: mol_sys.hpp:113
@ reCubic
Reclassified as cubic ice, according to the order parameter.
Definition: mol_sys.hpp:117
@ clathrate
Clathrate ice phase.
Definition: mol_sys.hpp:114
@ water
Liquid/amorphous phase.
Definition: mol_sys.hpp:112
@ reHex
Reclassified as hexagonal ice, according to the order parameter.
Definition: mol_sys.hpp:118
@ unclassified
Not classified into any other category.
Definition: mol_sys.hpp:116

◆ bond_type

Enumerator
staggered 

The bond is a staggered bond, according to the \(a(i,j)\) or \(c(i,j)\) value.

eclipsed 

The bond is an eclipsed bond.

out_of_range 

The bond cannot be classified as either staggered or eclipsed.

Definition at line 71 of file mol_sys.hpp.

@ eclipsed
The bond is an eclipsed bond.
Definition: mol_sys.hpp:71
@ out_of_range
The bond cannot be classified as either staggered or eclipsed.
Definition: mol_sys.hpp:71
@ staggered
The bond is a staggered bond, according to the or value.
Definition: mol_sys.hpp:71

Function Documentation

◆ clearPointCloud()

molSys::PointCloud< molSys::Point< double >, double > molSys::clearPointCloud ( molSys::PointCloud< molSys::Point< double >, double > *  yCloud)

//! Function for clearing vectors in PointCloud after multiple usage

Function for clearing PointCloud if it is already filled. This should be called before every frame is read in.

Parameters
[out]yCloudThe cleared PointCloud

Definition at line 20 of file mol_sys.cpp.

21  {
22  //
24  std::vector<double> tempBox;
25  //
26  std::vector<double> tempBox1;
27 
28  tempPts.swap(yCloud->pts);
29  tempBox.swap(yCloud->box);
30  tempBox1.swap(yCloud->boxLow);
31  yCloud->idIndexMap.clear();
32 
33  return *yCloud;
34 }
T clear(T... args)
std::vector< S > pts
Definition: mol_sys.hpp:167
std::unordered_map< int, int > idIndexMap
xlo, ylo, zlo
Definition: mol_sys.hpp:172
std::vector< T > box
Number of atoms.
Definition: mol_sys.hpp:170
std::vector< T > boxLow
Periodic box lengths.
Definition: mol_sys.hpp:171
T swap(T... args)

◆ createIDMolIDmap()

std::unordered_map< int, int > molSys::createIDMolIDmap ( molSys::PointCloud< molSys::Point< double >, double > *  yCloud)

Creates an unordered map, with the atomIDs as keys and molecular IDs as the values

Function for creating an unordered map with the atomIDs in the pointCloud as the keys and the molecular IDs as the values

Definition at line 40 of file mol_sys.cpp.

41  {
43  idMolIDmap; // atom IDs as keys and mol IDs as values
44  int iatomMolID; // molID of the current iatom
45  int iatomID; // atom ID of the current iatom
46 
47  // Loop through the atoms in yCloud
48  for (int iatom = 0; iatom < yCloud->nop; iatom++) {
49  iatomID = yCloud->pts[iatom].atomID; // atom ID
50  iatomMolID = yCloud->pts[iatom].molID; // molecular ID
51  // Update the unordered map
52  idMolIDmap[iatomID] = iatomMolID;
53  } // end of loop through every iatom in pointCloud
54 
55  return idMolIDmap;
56 }
int nop
Current frame number.
Definition: mol_sys.hpp:169

◆ hAtomMolList()

std::vector< std::vector< int > > molSys::hAtomMolList ( molSys::PointCloud< molSys::Point< double >, double > *  hCloud,
molSys::PointCloud< molSys::Point< double >, double > *  oCloud 
)

Returns a vector of vectors, which contains the molIDs in the first column, and the hydrogen atom indices (not atom IDs) in the row

Function that returns a vector of vectors, which contains the hydrogen atoms for each molID in the oxygen atom pointCloud

Definition at line 62 of file mol_sys.cpp.

64  {
66  hMolList; // the first column contains the molecular IDs, and the next
67  // two elements in the row are the hydrogen bond atoms in the
68  // molecule
69  int iMolID; // Current molecular ID
70  int nHatoms; // No. of h atoms found for a particular molID.
71 
72  for (int iatom = 0; iatom < oCloud->nop; iatom++) {
73  // Get the molID
74  iMolID = oCloud->pts[iatom].molID;
75 
76  hMolList.push_back(std::vector<int>()); // Empty vector for the index iatom
77  // Fill the first element with the molecular ID
78  hMolList[iatom].push_back(iMolID);
79 
80  nHatoms = 0; // init (no. of h atoms for the particular molID)
81 
82  // Now search through the hydrogen atom pointCloud for this particular molID
83  for (int jatom = 0; jatom < hCloud->nop; jatom++) {
84  if (hCloud->pts[jatom].molID == iMolID) {
85  hMolList[iatom].push_back(jatom); // fill the hatom index
86  nHatoms++;
87  // If the two hydrogens have been found, break out of the loop
88  if (nHatoms == 2) {
89  break;
90  } // end of break
91  } // end of check to see if jatom is part of iMolID
92  } // end of loop through the hydrogen atom pointCloud
93  } // end of looping through every oxygen atom
94 
95  return hMolList;
96 } // end of function
T push_back(T... args)

◆ searchMolList()

int molSys::searchMolList ( std::vector< std::vector< int >>  molList,
int  molIDtoFind 
)

This function searches a vector of vectors molList, for a particular molecular ID, and returns the index in molList

Function for searching a vector of vectors for a particular molecular ID, and

Returns
the index found in molList
-1 if not found

Definition at line 104 of file mol_sys.cpp.

105  {
106  int index = -1; // init invalid index
107 
108  for (int iatom = 0; iatom < molList.size(); iatom++) {
109  // If the molecular ID is equal, return the index in the array
110  if (molList[iatom][0] == molIDtoFind) {
111  index = iatom;
112  return index;
113  } // end of check
114  } // end of looping through iatom
115 
116  return index;
117 }
T size(T... args)

Variable Documentation

◆ atomID

template<typename T >
int molSys::Point< T >::atomID

Definition at line 146 of file mol_sys.hpp.

◆ box

template<typename S , typename T >
std::vector<T> molSys::PointCloud< S, T >::box

Number of atoms.

Definition at line 170 of file mol_sys.hpp.

◆ boxLow

template<typename S , typename T >
std::vector<T> molSys::PointCloud< S, T >::boxLow

Periodic box lengths.

Definition at line 171 of file mol_sys.hpp.

◆ c_ij

template<typename T >
std::vector<Result> molSys::Point< T >::c_ij

coordinates

Definition at line 148 of file mol_sys.hpp.

◆ c_value

double molSys::Result::c_value

Classifier according to CHILL, CHILL+ etc.

Definition at line 130 of file mol_sys.hpp.

◆ classifier

bond_type molSys::Result::classifier

Definition at line 129 of file mol_sys.hpp.

◆ currentFrame

template<typename S , typename T >
int molSys::PointCloud< S, T >::currentFrame

Collection of points.

Definition at line 168 of file mol_sys.hpp.

◆ iceType

template<typename T >
atom_state_type molSys::Point< T >::iceType
Initial value:

Results (contains bond correlation type)

Definition at line 149 of file mol_sys.hpp.

◆ idIndexMap

template<typename S , typename T >
std::unordered_map<int, int> molSys::PointCloud< S, T >::idIndexMap

xlo, ylo, zlo

Definition at line 172 of file mol_sys.hpp.

◆ inSlice

template<typename T >
bool molSys::Point< T >::inSlice = true

Type of ice/water etc based on cij.

Definition at line 151 of file mol_sys.hpp.

◆ molID

template<typename T >
int molSys::Point< T >::molID

Definition at line 146 of file mol_sys.hpp.

◆ nop

template<typename S , typename T >
int molSys::PointCloud< S, T >::nop

Current frame number.

Definition at line 169 of file mol_sys.hpp.

◆ pts

template<typename S , typename T >
std::vector<S> molSys::PointCloud< S, T >::pts

Definition at line 167 of file mol_sys.hpp.

◆ type

template<typename T >
int molSys::Point< T >::type

Definition at line 146 of file mol_sys.hpp.

◆ x

template<typename T >
T molSys::Point< T >::x

type ID, molID, atomID

Definition at line 147 of file mol_sys.hpp.

◆ y

template<typename T >
T molSys::Point< T >::y

Definition at line 147 of file mol_sys.hpp.

◆ z

template<typename T >
T molSys::Point< T >::z

Definition at line 147 of file mol_sys.hpp.