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 <cstdint>
19#include <functional>
20#include <iostream>
21#include <memory>
22#include <mol_sys.hpp>
23#include <ring.hpp>
24#include <string>
25
26#include <filesystem>
27
31
36
49
50namespace sinp {
51
53std::vector<std::string> getInpFileList(std::string inputFolder);
54
60int nLammpsFrames(const std::string &filename);
61
63void dropLammpsDumpIndex(const std::string &filename);
64
75 const std::string &filename, int first, int last, int typeFilter,
76 const std::function<void(
77 int, molSys::PointCloud<molSys::Point<double>, double> &)> &fn,
78 int nThreads = 0, int part = 0, int parts = 1);
79
83readLammpsTrj(std::string filename, int targetFrame,
85 bool isSlice = false,
86 std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
87 std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
88
94 std::string filename, int targetFrame,
95 molSys::PointCloud<molSys::Point<double>, double> &yCloud, int typeO,
96 bool isSlice = false,
97 std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
98 std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
99
104 std::string filename, int targetFrame,
105 molSys::PointCloud<molSys::Point<double>, double> &yCloud, int typeI,
106 bool isSlice = false,
107 std::array<double, 3> coordLow = std::array<double, 3>{0, 0, 0},
108 std::array<double, 3> coordHigh = std::array<double, 3>{0, 0, 0});
109
112
114std::vector<std::vector<int>> readBonds(std::string filename);
115
116#ifdef SEAMS_HAS_CHEMFILES
119readChemfiles(std::string filename, int targetFrame,
121 int typeFilter = -1);
122#endif
123
124#ifdef SEAMS_HAS_READCON
129readCon(std::string filename, int targetFrame,
131
132#ifdef SEAMS_HAS_READCON_DB
137int ingestConCorpus(const std::string &corpus, std::uint64_t trajId,
138 const std::string &conPath);
139
145readConCorpus(const std::string &corpus, const std::string &symbol,
146 const std::string &formula, int targetFrame,
148#endif
149#endif
150
153inline bool atomInSlice(double x, double y, double z,
154 std::array<double, 3> coordLow,
155 std::array<double, 3> coordHigh) {
156 int flag = 0;
157
158 if (((x >= coordLow[0]) && (x <= coordHigh[0])) ||
159 coordLow[0] == coordHigh[0]) {
160 flag++;
161 }
162 if (((y >= coordLow[1]) && (y <= coordHigh[1])) ||
163 coordLow[1] == coordHigh[1]) {
164 flag++;
165 }
166 if (((z >= coordLow[2]) && (z <= coordHigh[2])) ||
167 coordLow[2] == coordHigh[2]) {
168 flag++;
169 }
170
171 if (flag == 3) {
172 return true;
173 } else {
174 return false;
175 }
176}
177
178} // namespace sinp
179
180#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, int part=0, int parts=1)
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