seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
brine_front.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_BRINE_FRONT_H_
16#define SEAMS_BRINE_FRONT_H_
17
18#include <mol_sys.hpp>
19#include <site.hpp>
20
21#include <vector>
22
30
31namespace site {
32
33inline constexpr double kWaterMolarMassKg = 0.01801528;
34
36 double zLo = 0;
37 double zHi = 0;
38 double zMid = 0;
39 int nWater = 0;
40 int nIceWater = 0;
41 int nIon = 0;
42 double iceFraction = 0;
43 double molality = 0;
44};
45
47 std::vector<ConcentrationBin> bins;
48 double binWidth = 0;
49 double zOrigin = 0;
50 double length = 0;
51};
52
56struct FrontPair {
57 double zEnter = 0;
58 double zExit = 0;
59 double thickness = 0;
60 bool wrapped = false;
61 bool found = false;
62};
63
68 double cIce = 0;
69 double cLiquid = 0;
70 double k = 0;
71 int nIceWater = 0;
72 int nLiquidWater = 0;
73 int nIceIon = 0;
74 int nLiquidIon = 0;
75 bool defined = false;
76};
77
78struct LinearFit {
79 double slope = 0;
80 double intercept = 0;
81 double slopeStdErr = 0;
82 int n = 0;
83};
84
86 std::vector<int> waters;
87 int nIons = 0;
88};
89
91 std::vector<BrinePocket> pockets;
92 std::vector<int> sizes;
94 int nPockets = 0;
95};
96
103 std::vector<int> waters;
104 std::vector<int> ringCensus;
105 std::vector<int> coordination;
106 int nDefect = 0;
107 int nFour = 0;
108 int nHexagonal = 0;
109 int nCubic = 0;
111 int nClathrate = 0;
113};
114
120
122 int nBins = 20;
123 int axis = 2;
124 double frontCut = 0.5;
125 double bulkIce = 0.85;
126 double bulkLiquid = 0.15;
128 double shellCutoff = 3.5;
129 double layerHalfWidth = 3.5;
130 int maxRing = 6;
131 int coordHist = 8;
132};
133
142
144 const molSys::PointCloud<molSys::Point<double>, double> &cloud,
145 const std::vector<bool> &iceFlag, const std::vector<int> &waterIndices,
146 const std::vector<int> &ionIndices, int nBins, int axis = 2,
147 int ionsPerFormula = 2);
148
149FrontPair locateFronts(const ConcentrationProfile &profile, double cut = 0.5);
150
152 double bulkIce = 0.85,
153 double bulkLiquid = 0.15);
154
155LinearFit linearFit(const std::vector<double> &time,
156 const std::vector<double> &value);
157
159 const molSys::PointCloud<molSys::Point<double>, double> &cloud,
160 const std::vector<bool> &iceFlag, const std::vector<int> &waterIndices,
161 const std::vector<int> &ionIndices, double cutoff);
162
164 const molSys::PointCloud<molSys::Point<double>, double> &cloud,
165 const std::vector<int> &waterIndices, const FrontPair &fronts, double halfWidth,
166 double cutoff, int maxRing, int axis = 2);
167
171std::vector<TrapEvent> trappingTransitions(const IonEnvironment &before,
172 const IonEnvironment &after);
173
175 const molSys::PointCloud<molSys::Point<double>, double> &cloud,
176 const std::vector<bool> &iceFlag, const std::vector<int> &waterIndices,
177 const std::vector<int> &ionIndices, const FrontOptions &options = {});
178
179} // namespace site
180
181#endif
The main molecular system handler.
FrontPair locateFronts(const ConcentrationProfile &profile, double cut=0.5)
PocketCensus brinePockets(const molSys::PointCloud< molSys::Point< double >, double > &cloud, const std::vector< bool > &iceFlag, const std::vector< int > &waterIndices, const std::vector< int > &ionIndices, double cutoff)
FrontSnapshot analyseFront(const molSys::PointCloud< molSys::Point< double >, double > &cloud, const std::vector< bool > &iceFlag, const std::vector< int > &waterIndices, const std::vector< int > &ionIndices, const FrontOptions &options={})
FrontLayerReport frontLayer(const molSys::PointCloud< molSys::Point< double >, double > &cloud, const std::vector< int > &waterIndices, const FrontPair &fronts, double halfWidth, double cutoff, int maxRing, int axis=2)
RejectionCoefficient rejectionCoefficient(const ConcentrationProfile &profile, double bulkIce=0.85, double bulkLiquid=0.15)
IonState
Ions read against a per-atom ice assignment.
Definition site.hpp:86
constexpr double kWaterMolarMassKg
LinearFit linearFit(const std::vector< double > &time, const std::vector< double > &value)
ConcentrationProfile concentrationProfile(const molSys::PointCloud< molSys::Point< double >, double > &cloud, const std::vector< bool > &iceFlag, const std::vector< int > &waterIndices, const std::vector< int > &ionIndices, int nBins, int axis=2, int ionsPerFormula=2)
std::vector< TrapEvent > trappingTransitions(const IonEnvironment &before, const IonEnvironment &after)
A trapping event is a change of IonState into ice.
Per-atom site chemistry, separate from CHILL ice labels.
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
std::vector< int > waters
double molality
formula units per kg of water in the bin
std::vector< ConcentrationBin > bins
Waters within halfWidth of either front, their primitive-ring census, and the coordination defects (a...
std::vector< int > waters
std::vector< int > coordination
std::vector< int > ringCensus
Two planar fronts of one ice slab in a periodic box.
ConcentrationProfile profile
RejectionCoefficient rejection
IonEnvironment ions
FrontLayerReport layer
double slopeStdErr
standard error of the slope (not stderr, a macro on musl)
std::vector< BrinePocket > pockets
not including the liquid reservoir
std::vector< int > sizes
pocket water counts, ascending
k = c_ice / c_liquid, both molalities of formula units.
int ion
index into the ion list, not the cloud