Loading...
Searching...
No Matches
seams_output.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_OUTPUT_H_
16#define SEAMS_SEAMS_OUTPUT_H_
17
18#include <bond.hpp>
19#include <cage.hpp>
20#include <generic.hpp>
21#include <iostream>
22#include <memory>
23#include <mol_sys.hpp>
24
25#include <filesystem>
26namespace fs = std::filesystem;
27
28namespace sout {
29
36[[nodiscard]] inline int makePath(const std::string &path) {
37 std::error_code ec;
38 if (fs::is_directory(path)) {
39 return 0;
40 }
41 if (fs::create_directories(path, ec)) {
42 return 0;
43 }
44 return ec ? 1 : 0;
45}
46
48[[nodiscard]] int writeRings(const std::vector<std::vector<int>> &rings,
49 std::string filename = "rings.dat");
50
53[[nodiscard]] int writePrismNum(std::string path, const std::vector<int> &nPrisms,
54 const std::vector<int> &nDefPrisms,
55 const std::vector<double> &heightPercent, int maxDepth,
56 int currentFrame, int firstFrame);
57
60[[nodiscard]] int writeRingNum(std::string path, int currentFrame, const std::vector<int> &nRings,
61 const std::vector<double> &coverageAreaXY,
62 const std::vector<double> &coverageAreaXZ,
63 const std::vector<double> &coverageAreaYZ, int maxDepth,
64 int firstFrame);
65
68[[nodiscard]] int writeRingNumBulk(std::string path, int currentFrame, const std::vector<int> &nRings, int maxDepth,
69 int firstFrame);
70
72[[nodiscard]] int printRDF(std::string fileName, std::vector<double> &rdfValues,
73 double binwidth, int nbin);
74
77[[nodiscard]] int writeTopoBulkData(std::string path, int currentFrame, int numHC, int numDDC,
78 int mixedRings, int basalRings, int prismaticRings,
79 int firstFrame);
80
82[[nodiscard]] int writePrisms(std::vector<int> &basal1, std::vector<int> &basal2,
83 int prismNum,
84 const molSys::PointCloud<molSys::Point<double>, double> &yCloud);
85
87[[nodiscard]] int writeClusterStats(std::string path, int currentFrame, int largestCluster,
88 int numOfClusters, int smallestCluster,
89 double avgClusterSize, int firstFrame);
90
93[[nodiscard]] int writeMoleculeIDsInSlice(std::string path, const molSys::PointCloud<molSys::Point<double>, double> &yCloud);
94
97[[nodiscard]] int writeMoleculeIDsExpressionSelectOVITO(std::string path, const molSys::PointCloud<molSys::Point<double>, double> &yCloud);
98
100[[nodiscard]] int writeLAMMPSdata(const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
101 std::vector<std::vector<int>> rings,
102 std::vector<std::vector<int>> bonds,
103 std::string filename = "system-rings.data");
104
106[[nodiscard]] int writeLAMMPSdumpINT(
107 const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
108 const std::vector<double> &rmsdPerAtom, const std::vector<int> &atomTypes, int maxDepth,
109 std::string path);
110
113[[nodiscard]] int writeLAMMPSdumpSlice(
114 const molSys::PointCloud<molSys::Point<double>, double> &yCloud, std::string path);
115
117[[nodiscard]] int writeLAMMPSdumpCages(
118 const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
119 const std::vector<double> &rmsdPerAtom, const std::vector<int> &atomTypes,
120 std::string path, int firstFrame);
121
123[[nodiscard]] int writeLAMMPSdataAllPrisms(
124 const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
125 const std::vector<std::vector<int>> &nList, const std::vector<int> &atomTypes,
126 int maxDepth, std::string path, bool doShapeMatching = false);
127
129[[nodiscard]] int writeLAMMPSdataAllRings(
130 const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
131 const std::vector<std::vector<int>> &nList, const std::vector<int> &atomTypes,
132 int maxDepth, std::string path, bool isMonolayer = true);
133
136[[nodiscard]] int writeLAMMPSdataTopoBulk(
137 const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
138 const std::vector<std::vector<int>> &nList, const std::vector<cage::iceType> &atomTypes,
139 std::string path, bool bondsBetweenDummy = false);
140
142[[nodiscard]] int writeLAMMPSdataPrisms(
143 const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
144 const std::vector<std::vector<int>> &rings, bool useBondFile, std::string bondFile,
145 const std::vector<int> &listPrism, const std::vector<std::vector<int>> &nList,
146 std::string filename = "system-prisms.data");
147
150[[nodiscard]] int writeLAMMPSdataCages(
151 const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
152 const std::vector<std::vector<int>> &rings, std::vector<cage::Cage> &cageList,
153 cage::cageType type, int numCages,
154 std::string filename = "system-cages.data");
155
158[[nodiscard]] int writeAllCages(std::string path, std::vector<cage::Cage> &cageList,
159 const std::vector<std::vector<int>> &rings,
160 const std::vector<std::vector<int>> &nList,
161 const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
162 int currentFrame);
163
165[[nodiscard]] int writeEachCage(const std::vector<int> &currentCage, int cageNum,
166 cage::cageType type, const std::vector<std::vector<int>> &rings,
167 const molSys::PointCloud<molSys::Point<double>, double> &yCloud);
168
170[[nodiscard]] int writeBasalRingsHex(const std::vector<int> &currentCage, int cageNum,
171 const std::vector<std::vector<int>> &nList,
172 const std::vector<std::vector<int>> &rings);
173
175[[nodiscard]] int writeBasalRingsPrism(
176 std::vector<int> &basal1, std::vector<int> &basal2, int prismNum,
177 const std::vector<std::vector<int>> &nList,
178 const molSys::PointCloud<molSys::Point<double>, double> &yCloud, bool isDeformed);
179
181[[nodiscard]] int writeDump(const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
182 std::string path, std::string outFile);
183
186[[nodiscard]] int writeHisto(const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
187 const std::vector<std::vector<int>> &nList, const std::vector<double> &avgQ6);
188
190[[nodiscard]] int writeCluster(const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
191 std::string fileName = "cluster.txt", bool isSlice = false,
192 int largestIceCluster = 0);
193
195[[nodiscard]] int writeXYZcluster(std::string path,
196 const molSys::PointCloud<molSys::Point<double>, double> &yCloud,
197 const std::vector<int> &atoms, int clusterID, cage::cageType type);
198} // namespace sout
199#endif // SEAMS_SEAMS_OUTPUT_H_
File for bond-related analyses (hydrogen bonds, bonded atoms for data file write-outs etc....
File for cage types for topological network criteria.
File for containing generic or common functions.
cageType
Definition cage.hpp:54
The main molecular system handler.
int writeLAMMPSdataTopoBulk(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, const std::vector< cage::iceType > &atomTypes, std::string path, bool bondsBetweenDummy=false)
int writeLAMMPSdumpCages(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< double > &rmsdPerAtom, const std::vector< int > &atomTypes, std::string path, int firstFrame)
Write out a LAMMPS dump file containing the RMSD per atom for bulk ice.
int writeHisto(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, const std::vector< double > &avgQ6)
int writeXYZcluster(std::string path, const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< int > &atoms, int clusterID, cage::cageType type)
Function for writing out the XYZ files for each cluster.
int writeBasalRingsHex(const std::vector< int > &currentCage, int cageNum, const std::vector< std::vector< int > > &nList, const std::vector< std::vector< int > > &rings)
Write out the basal rings of a particular Hexagonal cage.
int makePath(const std::string &path)
Inline function for creating the desired directory (and parents).
int writeLAMMPSdumpINT(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< double > &rmsdPerAtom, const std::vector< int > &atomTypes, int maxDepth, std::string path)
Write out a LAMMPS dump file containing the RMSD per atom.
int writeLAMMPSdumpSlice(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, std::string path)
int writeLAMMPSdataAllPrisms(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, const std::vector< int > &atomTypes, int maxDepth, std::string path, bool doShapeMatching=false)
Write a data file for prisms of every type.
int writeRingNum(std::string path, int currentFrame, const std::vector< int > &nRings, const std::vector< double > &coverageAreaXY, const std::vector< double > &coverageAreaXZ, const std::vector< double > &coverageAreaYZ, int maxDepth, int firstFrame)
int writeLAMMPSdata(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, std::vector< std::vector< int > > rings, std::vector< std::vector< int > > bonds, std::string filename="system-rings.data")
Write a data file for rings.
int writePrisms(std::vector< int > &basal1, std::vector< int > &basal2, int prismNum, const molSys::PointCloud< molSys::Point< double >, double > &yCloud)
Function for writing out each prism.
int writeTopoBulkData(std::string path, int currentFrame, int numHC, int numDDC, int mixedRings, int basalRings, int prismaticRings, int firstFrame)
int writeMoleculeIDsInSlice(std::string path, const molSys::PointCloud< molSys::Point< double >, double > &yCloud)
int writeDump(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, std::string path, std::string outFile)
Generic function for writing out to a dump file.
int writePrismNum(std::string path, const std::vector< int > &nPrisms, const std::vector< int > &nDefPrisms, const std::vector< double > &heightPercent, int maxDepth, int currentFrame, int firstFrame)
int printRDF(std::string fileName, std::vector< double > &rdfValues, double binwidth, int nbin)
Function for printing out the RDF, given the filename.
int writeRingNumBulk(std::string path, int currentFrame, const std::vector< int > &nRings, int maxDepth, int firstFrame)
int writeEachCage(const std::vector< int > &currentCage, int cageNum, cage::cageType type, const std::vector< std::vector< int > > &rings, const molSys::PointCloud< molSys::Point< double >, double > &yCloud)
Write out a particular cage to a file.
int writeRings(const std::vector< std::vector< int > > &rings, std::string filename="rings.dat")
Function for printing out ring info, when there is no volume slice.
int writeAllCages(std::string path, std::vector< cage::Cage > &cageList, const std::vector< std::vector< int > > &rings, const std::vector< std::vector< int > > &nList, const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int currentFrame)
int writeBasalRingsPrism(std::vector< int > &basal1, std::vector< int > &basal2, int prismNum, const std::vector< std::vector< int > > &nList, const molSys::PointCloud< molSys::Point< double >, double > &yCloud, bool isDeformed)
Write out the basal rings for a particular prism.
int writeLAMMPSdataAllRings(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, const std::vector< int > &atomTypes, int maxDepth, std::string path, bool isMonolayer=true)
Write a data file for rings of every type for a monolayer.
int writeCluster(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, std::string fileName="cluster.txt", bool isSlice=false, int largestIceCluster=0)
Function for printing the largest ice cluster.
int writeClusterStats(std::string path, int currentFrame, int largestCluster, int numOfClusters, int smallestCluster, double avgClusterSize, int firstFrame)
Function for writing out cluster statistics.
int writeLAMMPSdataPrisms(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &rings, bool useBondFile, std::string bondFile, const std::vector< int > &listPrism, const std::vector< std::vector< int > > &nList, std::string filename="system-prisms.data")
Write a data file for prisms of a single type.
int writeMoleculeIDsExpressionSelectOVITO(std::string path, const molSys::PointCloud< molSys::Point< double >, double > &yCloud)
int writeLAMMPSdataCages(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &rings, std::vector< cage::Cage > &cageList, cage::cageType type, int numCages, std::string filename="system-cages.data")
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