seams-core v2.6.0
libyodaLib, the C++ engine of d-SEAMS
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
mol_sys.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_MOL_SYS_H_
16
#define SEAMS_MOL_SYS_H_
17
18
#include <algorithm>
19
#include <array>
20
#include <concepts>
21
#include <fstream>
22
#include <iterator>
23
#include <sstream>
24
#include <string>
25
#include <unordered_map>
26
#include <vector>
27
31
36
50
51
namespace
molSys
{
52
53
// Enum type for bond type
54
69
enum class
bond_type
{
staggered
,
eclipsed
,
out_of_range
};
70
107
enum class
atom_state_type
{
108
cubic
,
109
hexagonal
,
110
water
,
111
interfacial
,
112
clathrate
,
113
interClathrate
,
114
unclassified
,
115
reCubic
,
116
reHex
117
};
118
126
struct
Result
{
127
bond_type
classifier
;
128
double
c_value
;
129
};
130
137
template
<
typename
T>
138
concept
CoordinateScalar
= std::floating_point<T>;
139
152
template
<CoordinateScalar T>
struct
Point
{
153
int
type
= 0,
molID
= 0,
atomID
= 0;
154
T
x
= 0,
y
= 0,
z
= 0;
155
std::vector<Result>
c_ij
;
156
atom_state_type
iceType
=
157
atom_state_type::unclassified
;
158
bool
inSlice
=
true
;
159
};
160
161
// Struct for a collection of points; contains information for a particular
162
// frame
173
template
<
typename
S, CoordinateScalar T>
struct
PointCloud
{
174
std::vector<S>
pts
;
175
int
currentFrame
= 0;
176
int
nop
= 0;
177
std::vector<T>
box
;
178
std::vector<T>
boxLow
;
179
std::unordered_map<int, int>
idIndexMap
;
180
};
181
184
std::unordered_map<int, int>
185
createIDMolIDmap
(
molSys::PointCloud
<
molSys::Point<double>
,
double
> &yCloud);
186
189
std::unordered_multimap<int, int>
190
createMolIDAtomIDMultiMap
(
molSys::PointCloud
<
molSys::Point<double>
,
double
> &yCloud);
191
194
std::vector<std::vector<int>>
195
hAtomMolList
(
molSys::PointCloud
<
molSys::Point<double>
,
double
> &hCloud,
196
molSys::PointCloud
<
molSys::Point<double>
,
double
> &oCloud);
197
200
[[nodiscard]]
int
searchMolList
(
const
std::vector<std::vector<int>> &molList,
int
molIDtoFind);
201
203
molSys::PointCloud<molSys::Point<double>
,
double
>
204
clearPointCloud
(
molSys::PointCloud
<
molSys::Point<double>
,
double
> &yCloud);
205
}
// namespace molSys
206
207
#endif
// SEAMS_MOL_SYS_H_
molSys::CoordinateScalar
Definition
mol_sys.hpp:138
molSys::atom_state_type
atom_state_type
Definition
mol_sys.hpp:107
molSys::bond_type
bond_type
Definition
mol_sys.hpp:69
molSys::Point::x
T x
type ID, molID, atomID
Definition
mol_sys.hpp:154
molSys::PointCloud::nop
int nop
Current frame number.
Definition
mol_sys.hpp:176
molSys::Point::y
T y
Definition
mol_sys.hpp:154
molSys::Point::iceType
atom_state_type iceType
Results (contains bond correlation type).
Definition
mol_sys.hpp:156
molSys::Point::z
T z
Definition
mol_sys.hpp:154
molSys::searchMolList
int searchMolList(const std::vector< std::vector< int > > &molList, int molIDtoFind)
molSys::Point::type
int type
Definition
mol_sys.hpp:153
molSys::PointCloud::pts
std::vector< S > pts
Definition
mol_sys.hpp:174
molSys::clearPointCloud
molSys::PointCloud< molSys::Point< double >, double > clearPointCloud(molSys::PointCloud< molSys::Point< double >, double > &yCloud)
//! Function for clearing vectors in PointCloud after multiple usage
molSys::Result::classifier
bond_type classifier
Definition
mol_sys.hpp:127
molSys::Point::inSlice
bool inSlice
Type of ice/water etc based on cij.
Definition
mol_sys.hpp:158
molSys::PointCloud::idIndexMap
std::unordered_map< int, int > idIndexMap
xlo, ylo, zlo
Definition
mol_sys.hpp:179
molSys::Result::c_value
double c_value
Classifier according to CHILL, CHILL+ etc.
Definition
mol_sys.hpp:128
molSys::Point::c_ij
std::vector< Result > c_ij
coordinates
Definition
mol_sys.hpp:155
molSys::PointCloud::box
std::vector< T > box
Number of atoms.
Definition
mol_sys.hpp:177
molSys::hAtomMolList
std::vector< std::vector< int > > hAtomMolList(molSys::PointCloud< molSys::Point< double >, double > &hCloud, molSys::PointCloud< molSys::Point< double >, double > &oCloud)
molSys::PointCloud::boxLow
std::vector< T > boxLow
Periodic box lengths.
Definition
mol_sys.hpp:178
molSys::createIDMolIDmap
std::unordered_map< int, int > createIDMolIDmap(molSys::PointCloud< molSys::Point< double >, double > &yCloud)
molSys::Point::molID
int molID
Definition
mol_sys.hpp:153
molSys::createMolIDAtomIDMultiMap
std::unordered_multimap< int, int > createMolIDAtomIDMultiMap(molSys::PointCloud< molSys::Point< double >, double > &yCloud)
molSys::Point::atomID
int atomID
Definition
mol_sys.hpp:153
molSys::PointCloud::currentFrame
int currentFrame
Collection of points.
Definition
mol_sys.hpp:175
molSys::atom_state_type::hexagonal
@ hexagonal
Ih, or particle type signifying Hexagonal Ice.
Definition
mol_sys.hpp:109
molSys::atom_state_type::reCubic
@ reCubic
Reclassified as cubic ice, according to the order parameter.
Definition
mol_sys.hpp:115
molSys::atom_state_type::interfacial
@ interfacial
Interfacial ice: ice-like molecules which do not fulfill the strict criteria of the Ic or Ih phases.
Definition
mol_sys.hpp:111
molSys::atom_state_type::cubic
@ cubic
Ic, or particle type signifying Cubic Ice.
Definition
mol_sys.hpp:108
molSys::atom_state_type::interClathrate
@ interClathrate
Interfacial clathrate ice phase.
Definition
mol_sys.hpp:113
molSys::atom_state_type::water
@ water
Liquid/amorphous phase.
Definition
mol_sys.hpp:110
molSys::atom_state_type::reHex
@ reHex
Reclassified as hexagonal ice, according to the order parameter.
Definition
mol_sys.hpp:116
molSys::atom_state_type::clathrate
@ clathrate
Clathrate ice phase.
Definition
mol_sys.hpp:112
molSys::atom_state_type::unclassified
@ unclassified
Not classified into any other category.
Definition
mol_sys.hpp:114
molSys::bond_type::eclipsed
@ eclipsed
The bond is an eclipsed bond.
Definition
mol_sys.hpp:69
molSys::bond_type::out_of_range
@ out_of_range
The bond cannot be classified as either staggered or eclipsed.
Definition
mol_sys.hpp:69
molSys::bond_type::staggered
@ staggered
The bond is a staggered bond, according to the or value.
Definition
mol_sys.hpp:69
molSys
Bare-bones structs used throughout the architecture.
Definition
mol_sys.hpp:51
molSys::PointCloud
This contains a collection of points; contains information for a particular frame.
Definition
mol_sys.hpp:173
molSys::Point
This contains per-particle information.
Definition
mol_sys.hpp:152
molSys::Result
This contains the bond classifier of enum class type bond_type, and the bond correlation factor.
Definition
mol_sys.hpp:126
src
include
internal
mol_sys.hpp
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf