seams_input.hpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------------
2 // d-SEAMS is free software: you can redistribute it and/or modify
3 // it under the terms of the GNU General Public License as published by
4 // the Free Software Foundation, either version 3 of the License, or
5 // (at your option) any later version.
6 //
7 // A copy of the GNU General Public License is available at
8 // http://www.gnu.org/licenses/
9 //-----------------------------------------------------------------------------------
10 
11 #ifndef __SEAMS_INPUT_H_
12 #define __SEAMS_INPUT_H_
13 
14 #include <iostream>
15 #include <memory>
16 #include <mol_sys.hpp>
17 #include <ring.hpp>
18 #include <string>
19 
21 #include "boost/filesystem/operations.hpp"
22 #include "boost/filesystem/path.hpp"
23 
46 namespace sinp {
47 
50 
54 readLammpsTrj(std::string filename, int targetFrame,
56  bool isSlice = false,
57  std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
58  std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
59 
63  std::string filename, int targetFrame,
64  molSys::PointCloud<molSys::Point<double>, double> *yCloud, int typeO,
65  bool isSlice = false,
66  std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
67  std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
68 
72  std::string filename, int targetFrame,
73  molSys::PointCloud<molSys::Point<double>, double> *yCloud, int typeI,
74  bool isSlice = false,
75  std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
76  std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
77 
79 int readXYZ(std::string filename,
80  molSys::PointCloud<molSys::Point<double>, double> *yCloud);
81 
84 
85 inline bool atomInSlice(double x, double y, double z,
86  std::array<double, 3> coordLow,
87  std::array<double, 3> coordHigh) {
88  int flag = 0;
89 
90  if (((x >= coordLow[0]) && (x <= coordHigh[0])) ||
91  coordLow[0] == coordHigh[0]) {
92  flag++;
93  }
94  if (((y >= coordLow[1]) && (y <= coordHigh[1])) ||
95  coordLow[1] == coordHigh[1]) {
96  flag++;
97  }
98  if (((z >= coordLow[2]) && (z <= coordHigh[2])) ||
99  coordLow[2] == coordHigh[2]) {
100  flag++;
101  }
102 
103  if (flag == 3) {
104  return true;
105  } else {
106  return false;
107  }
108 }
109 
110 } // namespace sinp
111 
112 #endif
std::vector< std::string > getInpFileList(std::string inputFolder)
Get file list inside the input folder.
molSys::PointCloud< molSys::Point< double >, double > readLammpsTrj(std::string filename, int targetFrame, molSys::PointCloud< molSys::Point< double >, double > *yCloud, bool isSlice=false, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
molSys::PointCloud< molSys::Point< double >, double > readLammpsTrjreduced(std::string filename, int targetFrame, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int typeI, bool isSlice=false, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
molSys::PointCloud< molSys::Point< double >, double > readLammpsTrjO(std::string filename, int targetFrame, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int typeO, bool isSlice=false, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
int readXYZ(std::string filename, molSys::PointCloud< molSys::Point< double >, double > *yCloud)
Function for reading in atom coordinates from an XYZ file.
Definition: seams_input.cpp:69
bool atomInSlice(double x, double y, double z, std::array< double, 3 > coordLow, std::array< double, 3 > coordHigh)
Definition: seams_input.hpp:85
std::vector< std::vector< int > > readBonds(std::string filename)
Reads bonds into a vector of vectors from a file with a specific format.
Definition: seams_input.cpp:20
The main molecular system handler.
Functions for the d-SEAMS readers.
Definition: seams_input.hpp:46
File containing common functions used by bulk and confined topological network critera.
This contains a collection of points; contains information for a particular frame.
Definition: mol_sys.hpp:166
This contains per-particle information.
Definition: mol_sys.hpp:145