seams_input.hpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------------
2 // d-SEAMS - Deferred Structural Elucidation Analysis for Molecular Simulations
3 //
4 // Copyright (c) 2018--present d-SEAMS core team
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the MIT License as published by
8 // the Open Source Initiative.
9 //
10 // A copy of the MIT License is included in the LICENSE file of this repository.
11 // You should have received a copy of the MIT License along with this program.
12 // If not, see <https://opensource.org/licenses/MIT>.
13 //-----------------------------------------------------------------------------------
14 
15 #ifndef __SEAMS_INPUT_H_
16 #define __SEAMS_INPUT_H_
17 
18 #include <iostream>
19 #include <memory>
20 #include <mol_sys.hpp>
21 #include <ring.hpp>
22 #include <string>
23 
25 #include "boost/filesystem/operations.hpp"
26 #include "boost/filesystem/path.hpp"
27 
50 namespace sinp {
51 
54 
58 readLammpsTrj(std::string filename, int targetFrame,
60  bool isSlice = false,
61  std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
62  std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
63 
67  std::string filename, int targetFrame,
68  molSys::PointCloud<molSys::Point<double>, double> *yCloud, int typeO,
69  bool isSlice = false,
70  std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
71  std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
72 
76  std::string filename, int targetFrame,
77  molSys::PointCloud<molSys::Point<double>, double> *yCloud, int typeI,
78  bool isSlice = false,
79  std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
80  std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
81 
84 
87 
88 inline bool atomInSlice(double x, double y, double z,
89  std::array<double, 3> coordLow,
90  std::array<double, 3> coordHigh) {
91  int flag = 0;
92 
93  if (((x >= coordLow[0]) && (x <= coordHigh[0])) ||
94  coordLow[0] == coordHigh[0]) {
95  flag++;
96  }
97  if (((y >= coordLow[1]) && (y <= coordHigh[1])) ||
98  coordLow[1] == coordHigh[1]) {
99  flag++;
100  }
101  if (((z >= coordLow[2]) && (z <= coordHigh[2])) ||
102  coordLow[2] == coordHigh[2]) {
103  flag++;
104  }
105 
106  if (flag == 3) {
107  return true;
108  } else {
109  return false;
110  }
111 }
112 
113 } // namespace sinp
114 
115 #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})
molSys::PointCloud< molSys::Point< double >, double > readXYZ(std::string filename)
Function for reading in atom coordinates from an XYZ file.
Definition: seams_input.cpp:73
bool atomInSlice(double x, double y, double z, std::array< double, 3 > coordLow, std::array< double, 3 > coordHigh)
Definition: seams_input.hpp:88
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:24
The main molecular system handler.
Functions for the d-SEAMS readers.
Definition: seams_input.hpp:50
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:170
This contains per-particle information.
Definition: mol_sys.hpp:149