seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
interface_order.hpp
Go to the documentation of this file.
1//-----------------------------------------------------------------------------------
2// d-SEAMS - Deferred Structural Elucidation Analysis for Molecular Simulations
3//
4// Copyright (c) d-SEAMS developers
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_INTERFACE_ORDER_H_
16#define SEAMS_INTERFACE_ORDER_H_
17
18#include <mol_sys.hpp>
19
20#include <cstdint>
21#include <string>
22#include <vector>
23
44
45namespace iface {
46
47enum class Cause { agree = 0, neighbour = 1, q3Shell = 2, openEdge = 3, mixed = 4 };
48
49enum class Kind { slab = 0, nucleus = 1 };
50
51struct Front {
52 double position = 0;
53 double width = 0;
54 bool defined = false;
55};
56
57struct Profile {
58 double crystal = 0;
59 double interfacial = 0;
60 double solid = 0;
61 double thickness = 0;
62 std::vector<Front> fronts;
63 bool defined = false;
64};
65
66struct Bin {
67 double mid = 0;
68 int n = 0;
69 int disagree = 0;
70 double crystalPub = 0;
71 double solidPub = 0;
72 double crystalOvi = 0;
73 double solidOvi = 0;
74};
75
76struct Study {
77 int n = 0;
78 int nDisagree = 0;
79 int causeCount[5] = {};
80 int countPub[9] = {};
81 int countOvi[9] = {};
82 int transition[9][9] = {};
83 int shellDisagree[8] = {};
84 int shellAgree[8] = {};
85 int ringDisagree[3] = {};
86 int ringAgree[3] = {};
87 int prismAtoms = 0;
88 int prismBlocks = 0;
89 int bilayerAtoms = 0;
90 int polygonAtoms = 0;
91 int thinSheets = 0;
92 int diamondOther = 0;
93 int diamondCubic = 0;
94 int diamondHex = 0;
95 int cnaOther = 0;
96 int cnaCrystal = 0;
97 int ptmPass = 0;
99 double q6Disagree = 0;
100 double q6Agree = 0;
101 double depthDisagree = 0;
102 double depthAgree = 0;
104 int depthAgreeN = 0;
106 int axis = 2;
111 std::vector<Bin> bins;
112};
113
118[[nodiscard]] Study studyCloud(
119 molSys::PointCloud<molSys::Point<double>, double> cloud, double cutoff = 3.5,
120 double binWidth = 1.0, bool census = true);
121
122[[nodiscard]] Study studyDump(const std::string &path, int frame, double cutoff = 3.5,
123 double binWidth = 1.0, bool census = true);
124
125[[nodiscard]] std::string formatStudy(const Study &study, const std::string &tag);
126
128[[nodiscard]] double slope(const std::vector<double> &x, const std::vector<double> &y);
129
131 int frame = 0;
132 double timePs = 0;
134};
135
136struct Growth {
137 std::vector<GrowthFrame> frames;
138 double rateSolidPub = 0;
139 double rateSolidOvi = 0;
140 double rateCrystalPub = 0;
141 double rateCrystalOvi = 0;
142};
143
145[[nodiscard]] Growth studyTrajectory(const std::string &path, double dumpEveryPs,
146 double cutoff = 3.5);
147
148[[nodiscard]] std::string formatGrowth(const Growth &growth);
149
155[[nodiscard]] std::string formatQ6Growth(const std::string &path, double dumpEveryPs,
156 double cutoff = 3.5);
157
161[[nodiscard]] molSys::PointCloud<molSys::Point<double>, double>
162nanotube(int ring, int stacks, double bond = 2.75);
163
164[[nodiscard]] molSys::PointCloud<molSys::Point<double>, double>
165honeycombSheet(int nx, int ny, int layers, double bond = 2.75);
166
169[[nodiscard]] double gaussianStepWidth(double xi);
170
172 double mean = 0;
173 double lo = 0;
174 double hi = 0;
175 bool excludesZero = false;
176};
177
179[[nodiscard]] BootstrapInterval bootstrapMean(const std::vector<double> &samples, int nDraw,
180 std::uint64_t seed);
181
183[[nodiscard]] BootstrapInterval pairedDifference(const std::vector<double> &a,
184 const std::vector<double> &b, int nDraw,
185 std::uint64_t seed);
186
188 double xi = 2.4;
189 double meanRadius = 0;
190 double surfaceRms = 0;
191 double densityWidth = 0;
192 double solidWidthPub = 0;
193 double solidWidthOvi = 0;
194 int nRays = 0;
195 bool defined = false;
196};
197
203 molSys::PointCloud<molSys::Point<double>, double> cloud, double xi = 2.4);
204
205[[nodiscard]] std::string formatWillardChandler(const WillardChandler &surface);
206
207} // namespace iface
208
209#endif
The main molecular system handler.
Functions for bond-related analyses.
Definition bond.hpp:73
WillardChandler willardChandler(molSys::PointCloud< molSys::Point< double >, double > cloud, double xi=2.4)
BootstrapInterval bootstrapMean(const std::vector< double > &samples, int nDraw, std::uint64_t seed)
Percentile bootstrap of the mean. nDraw samples with replacement.
std::string formatWillardChandler(const WillardChandler &surface)
std::string formatStudy(const Study &study, const std::string &tag)
Study studyDump(const std::string &path, int frame, double cutoff=3.5, double binWidth=1.0, bool census=true)
molSys::PointCloud< molSys::Point< double >, double > nanotube(int ring, int stacks, double bond=2.75)
Growth studyTrajectory(const std::string &path, double dumpEveryPs, double cutoff=3.5)
Every frame of a dump. time of frame i is (i - 1) * dumpEveryPs.
std::string formatGrowth(const Growth &growth)
double slope(const std::vector< double > &x, const std::vector< double > &y)
Ordinary least squares slope. Empty or a single point returns 0.
BootstrapInterval pairedDifference(const std::vector< double > &a, const std::vector< double > &b, int nDraw, std::uint64_t seed)
Mean of a[i] - b[i], resampled by shared index.
double gaussianStepWidth(double xi)
std::string formatQ6Growth(const std::string &path, double dumpEveryPs, double cutoff=3.5)
Study studyCloud(molSys::PointCloud< molSys::Point< double >, double > cloud, double cutoff=3.5, double binWidth=1.0, bool census=true)
molSys::PointCloud< molSys::Point< double >, double > honeycombSheet(int nx, int ny, int layers, double bond=2.75)
Topological network criteria functions.
double hi
2.5 percentile, Hyndman-Fan type 7
bool excludesZero
97.5 percentile
bool defined
10-90 width along the same path
double width
0.5 crossing, or the nucleus radius
std::vector< GrowthFrame > frames
double rateSolidOvi
d(thickness)/dt in A/ps
double interfacial
(cubic + hexagonal) / N
double thickness
crystal + interfacial, over N
double solid
interfacial / N
std::vector< Front > fronts
ice span between the two 0.5 crossings, or 2 R
int transition[9][9]
double depthAgree
mean distance to the nearest front
Profile solidOvi
cubic + hexagonal
Profile crystalPub
cubic + hexagonal + interfacial
int shellAgree[8]
0..6 and 7 meaning 7 or more
int ptmPass
FCC, HCP, icosahedral or BCC under adaptive CNA.
std::vector< Bin > bins
int ringAgree[3]
atoms in at least one ring of size 4, 5, 6
double solidWidthOvi
10-90 of the 2015 solid fraction on the same coordinate
double solidWidthPub
10-90 of the coarse density normal to that surface
double densityWidth
rms of the instantaneous surface about its mean
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