Loading...
Searching...
No Matches
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_SEAMS_INPUT_H_
16#define SEAMS_SEAMS_INPUT_H_
17
18#include <functional>
19#include <iostream>
20#include <memory>
21#include <mol_sys.hpp>
22#include <ring.hpp>
23#include <string>
24
25#include <filesystem>
26
30
35
48
49namespace sinp {
50
52std::vector<std::string> getInpFileList(std::string inputFolder);
53
59int nLammpsFrames(const std::string &filename);
60
62void dropLammpsDumpIndex(const std::string &filename);
63
71 const std::string &filename, int first, int last, int typeFilter,
72 const std::function<void(
73 int, molSys::PointCloud<molSys::Point<double>, double> &)> &fn,
74 int nThreads = 0);
75
79readLammpsTrj(std::string filename, int targetFrame,
81 bool isSlice = false,
82 std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
83 std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
84
90 std::string filename, int targetFrame,
91 molSys::PointCloud<molSys::Point<double>, double> &yCloud, int typeO,
92 bool isSlice = false,
93 std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
94 std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
95
100 std::string filename, int targetFrame,
101 molSys::PointCloud<molSys::Point<double>, double> &yCloud, int typeI,
102 bool isSlice = false,
103 std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
104 std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
105
108
110std::vector<std::vector<int>> readBonds(std::string filename);
111
112#ifdef SEAMS_HAS_CHEMFILES
115readChemfiles(std::string filename, int targetFrame,
117 int typeFilter = -1);
118#endif
119
120#ifdef SEAMS_HAS_READCON
123readCon(std::string filename, int targetFrame,
125#endif
126
129inline bool atomInSlice(double x, double y, double z,
130 std::array<double, 3> coordLow,
131 std::array<double, 3> coordHigh) {
132 int flag = 0;
133
134 if (((x >= coordLow[0]) && (x <= coordHigh[0])) ||
135 coordLow[0] == coordHigh[0]) {
136 flag++;
137 }
138 if (((y >= coordLow[1]) && (y <= coordHigh[1])) ||
139 coordLow[1] == coordHigh[1]) {
140 flag++;
141 }
142 if (((z >= coordLow[2]) && (z <= coordHigh[2])) ||
143 coordLow[2] == coordHigh[2]) {
144 flag++;
145 }
146
147 if (flag == 3) {
148 return true;
149 } else {
150 return false;
151 }
152}
153
154} // namespace sinp
155
156#endif
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})
int nLammpsFrames(const std::string &filename)
void forEachLammpsFrame(const std::string &filename, int first, int last, int typeFilter, const std::function< void(int, molSys::PointCloud< molSys::Point< double >, double > &)> &fn, int nThreads=0)
molSys::PointCloud< molSys::Point< double >, double > readXYZ(std::string filename)
Function for reading in atom coordinates from an XYZ file.
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})
std::vector< std::string > getInpFileList(std::string inputFolder)
Get file list inside the input folder.
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})
bool atomInSlice(double x, double y, double z, std::array< double, 3 > coordLow, std::array< double, 3 > coordHigh)
std::vector< std::vector< int > > readBonds(std::string filename)
Reads bonds into a vector of vectors from a file with a specific format.
void dropLammpsDumpIndex(const std::string &filename)
Drop a cached dump session (tests that rewrite a path in place).
The main molecular system handler.
Functions for the d-SEAMS readers.
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:173
This contains per-particle information.
Definition mol_sys.hpp:152