STORMM Source Documentation
Loading...
Searching...
No Matches
chemical_features.h
1// -*-c++-*-
2#ifndef STORMM_CHEMICAL_FEATURES_H
3#define STORMM_CHEMICAL_FEATURES_H
4
5#include "copyright.h"
6#include "Accelerator/hybrid.h"
7#include "DataTypes/common_types.h"
8#include "DataTypes/stormm_vector_types.h"
9#include "Math/vector_ops.h"
10#include "Numerics/split_fixed_precision.h"
11#include "Topology/atomgraph.h"
12#include "Synthesis/condensate.h"
13#include "Synthesis/phasespace_synthesis.h"
14#include "Trajectory/coordinateframe.h"
15#include "Trajectory/coordinate_series.h"
16#include "Trajectory/phasespace.h"
17#include "UnitTesting/stopwatch.h"
18#include "chemistry_enumerators.h"
19#include "match_bonding_pattern.h"
20
21namespace stormm {
22namespace chemistry {
23
24using card::Hybrid;
25using card::HybridTargetLevel;
26using data_types::isFloatingPointScalarType;
27using stmath::crossProduct;
28using stmath::dot;
29using stmath::project;
30using stmath::roundUp;
31using synthesis::Condensate;
32using synthesis::CondensateReader;
33using synthesis::PhaseSpaceSynthesis;
34using synthesis::PsSynthesisReader;
35using testing::StopWatch;
36using topology::AtomGraph;
37using topology::ChemicalDetailsKit;
38using topology::NonbondedKit;
39using topology::ValenceKit;
40using trajectory::CoordinateFrame;
41using trajectory::CoordinateFrameReader;
42using trajectory::CoordinateSeries;
43using trajectory::CoordinateSeriesReader;
44using trajectory::PhaseSpace;
45using trajectory::PhaseSpaceReader;
46
48constexpr int max_fused_ring_tree_size = 33554432;
49
54public:
55
57 BondedNode();
58
67 void setBranchPointer(std::vector<int> *vi, size_t pos, size_t max_branches);
68
81 void addToTree(int previous_in, int current_atom, int current_layer,
82 const NonbondedKit<double> &nbk, const std::vector<bool> &valid_atom_mask);
83 void addToTree(int previous_in, int current_atom, int current_layer, int previous_node_in,
84 const NonbondedKit<double> &nbk, const std::vector<bool> &valid_atom_mask);
85
90 void addBondOrder(const ValenceKit<double> &vk, const Hybrid<double> &bond_orders);
91
93 int getPreviousAtom() const;
94
96 int getPreviousNode() const;
97
99 int getAtom() const;
100
102 int getLayer() const;
103
106 int getBranchCount() const;
107
112 int getBranchAtom(int index) const;
113
117 int findBranchAtom(int search_index) const;
118
124 uint getRingCompletion(int branch_index) const;
125
127 double getRootBondOrder() const;
128
133 void setRingCompletion(int partner_index);
134
136 void wipeRingCompletion();
137
138private:
139 int previous_atom_index;
140 int previous_node_index;
141 int atom_index;
142 int layer_index;
144 double root_bond_order;
146 int branch_count;
148 int* branch_atoms;
149 uint rings_completed;
151};
152
156public:
157
168 IsomerPlan(ConformationEdit motion_in, ChiralInversionProtocol chiral_plan_in, int root_atom_in,
169 int pivot_atom_in, const std::vector<int> &moving_atoms_in,
170 const AtomGraph* ag_pointer_in);
171
172 IsomerPlan(ConformationEdit motion_in, int root_atom_in, int pivot_atom_in,
173 const std::vector<int> &moving_atoms_in, const AtomGraph* ag_pointer_in);
174
175 IsomerPlan(ConformationEdit motion_in, ChiralInversionProtocol chiral_plan_in, int root_atom_in,
176 int pivot_atom_in, const AtomGraph* ag_pointer_in);
177
178 IsomerPlan(ConformationEdit motion_in, int root_atom_in, int pivot_atom_in,
179 const AtomGraph* ag_pointer_in);
181
185 IsomerPlan(const IsomerPlan &original) = default;
186 IsomerPlan(IsomerPlan &&original) = default;
187 IsomerPlan& operator=(const IsomerPlan &other) = default;
188 IsomerPlan& operator=(IsomerPlan &&other) = default;
190
192 ConformationEdit getMotion() const;
193
195 ChiralInversionProtocol getChiralPlan() const;
196
198 int getRootAtom() const;
199
201 int getPivotAtom() const;
202
205 int getRootHandle() const;
206
209 int getPivotHandle() const;
210
212 int getMovingAtomCount() const;
213
215 int getRealMovingAtomCount() const;
216
218 double getMovingAtomWeight() const;
219
224 int getMovingAtom(const size_t index) const;
225
228 const std::vector<int>& getMovingAtoms() const;
229
233 void addMovingAtoms(const std::vector<int> &new_atom_idx);
234
236 void eraseMovingAtoms();
237
238private:
239 ConformationEdit motion;
242 ChiralInversionProtocol chiral_plan;
244 int root_atom;
245 int pivot_atom;
247 int root_handle;
252 int pivot_handle;
253 int rotating_real_atom_count;
256 std::vector<int> moving_atoms;
258 double mass_of_rotators;
259 AtomGraph *ag_pointer;
261};
262
269public:
270
274 CoupledEdit();
275 CoupledEdit(ConformationEdit edit_in, int index_in);
276 CoupledEdit(int2 data_in);
278
282 CoupledEdit(const CoupledEdit &original) = default;
283 CoupledEdit(CoupledEdit &&original) = default;
284 CoupledEdit& operator=(const CoupledEdit &other) = default;
285 CoupledEdit& operator=(CoupledEdit &&other) = default;
287
289 CoupledEdit operator=(const int2 &other);
290
291 ConformationEdit edit;
293 int index;
294};
295
299
301 ChemicalFeaturesReader(int atom_count_in, int planar_atom_count_in, int ring_count_in,
302 int fused_ring_count_in, int twistable_ring_count_in,
303 int conjugated_group_count_in, int aromatic_group_count_in,
304 int polar_hydrogen_count_in, int hbond_donor_count_in,
305 int hbond_acceptor_count_in, int chiral_center_count_in,
306 int rotatable_bond_count_in, int cis_trans_bond_count_in,
307 int double_bond_count_in, int triple_bond_count_in,
308 int max_ring_size_in, double temperature_in,
309 bool rotating_groups_mapped_in, bool chiralities_computed_in,
310 const int* planar_centers_in, const int* ring_atoms_in,
311 const int* ring_atom_bounds_in, const int* aromatic_pi_electrons_in,
312 const int* aromatic_groups_in, const int* aromatic_group_bounds_in,
313 const int* polar_hydrogens_in, const int* hydrogen_bond_donors_in,
314 const int* hydrogen_bond_acceptors_in, const int* chiral_centers_in,
315 const int* chiral_inversion_methods_in, const int* rotatable_groups_in,
316 const int* rotatable_group_bounds_in, const int* cis_trans_groups_in,
317 const int* cis_trans_group_bounds_in, const int* invertible_groups_in,
318 const int* invertible_group_bounds_in, const int4* chiral_arm_atoms_in,
319 const double* formal_charges_in, const double* bond_orders_in,
320 const double* free_electrons_in, const ullint* ring_inclusion_in,
321 const AtomGraph *ag_pointer_in);
322
331
332 // Counts of atoms and features (see the parent object for more detailed information)
333 const int atom_count;
335 const int ring_count;
348 const int max_ring_size;
349 const double temperature;
354
355 // Lists of atom indices and atom properties (see the parent object for detailed descriptions)
356 const int* planar_centers;
357 const int* ring_atoms;
359 const int* ring_atom_bounds;
363 const int* aromatic_groups;
366 const int* polar_hydrogens;
370 const int* chiral_centers;
373 const int* rotatable_groups;
376 const int* cis_trans_groups;
379 const int* invertible_groups;
387 const double* formal_charges;
389 const double* bond_orders;
391 const double* free_electrons;
392 const ullint* ring_inclusion;
396};
397
401public:
402
424 ChemicalFeatures(const AtomGraph *ag_in = nullptr,
425 MapRotatableGroups map_groups_in = MapRotatableGroups::NO,
426 double temperature_in = 300.0, StopWatch *timer_in = nullptr);
427
428 ChemicalFeatures(const AtomGraph &ag_in,
429 MapRotatableGroups map_groups_in = MapRotatableGroups::NO,
430 double temperature_in = 300.0, StopWatch *timer_in = nullptr);
431
432 ChemicalFeatures(const AtomGraph *ag_in, const CoordinateFrameReader &cfr,
433 MapRotatableGroups map_groups_in = MapRotatableGroups::NO,
434 double temperature_in = 300.0, StopWatch *timer_in = nullptr);
435
436 ChemicalFeatures(const AtomGraph *ag_in, const CoordinateFrame &cf,
437 MapRotatableGroups map_groups_in = MapRotatableGroups::NO,
438 double temperature_in = 300.0, StopWatch *timer_in = nullptr);
439
440 ChemicalFeatures(const AtomGraph *ag_in, const PhaseSpace &ps,
441 MapRotatableGroups map_groups_in = MapRotatableGroups::NO,
442 double temperature_in = 300.0, StopWatch *timer_in = nullptr);
443
444 ChemicalFeatures(const AtomGraph &ag_in, const CoordinateFrame &cf,
445 MapRotatableGroups map_groups_in = MapRotatableGroups::NO,
446 double temperature_in = 300.0, StopWatch *timer_in = nullptr);
447
448 ChemicalFeatures(const AtomGraph &ag_in, const PhaseSpace &ps,
449 MapRotatableGroups map_groups_in = MapRotatableGroups::NO,
450 double temperature_in = 300.0, StopWatch *timer_in = nullptr);
452
457 ChemicalFeatures(const ChemicalFeatures &original);
460
469
470#ifdef STORMM_USE_HPC
472 void upload();
473
475 void download();
476#endif
477
479 int getAtomCount() const;
480
482 int getPlanarAtomCount() const;
483
485 int getRingCount() const;
486
488 int getFusedRingCount() const;
489
491 int getMutableRingCount() const;
492
494 int getAromaticGroupCount() const;
495
497 int getPolarHydrogenCount() const;
498
500 int getHydrogenBondDonorCount() const;
501
504
506 int getChiralCenterCount() const;
507
509 int getRotatableBondCount() const;
510
512 int getCisTransBondCount() const;
513
516 bool rotatableGroupsMapped() const;
517
519 bool chiralitiesComputed() const;
520
525 std::vector<uint> getRingMask(int min_ring_size, int max_ring_size) const;
526
531 std::vector<uint> getAromaticMask(int min_pi_electrons, int max_pi_electrons) const;
532
534 std::vector<int> getPolarHydrogenList() const;
535
537 std::vector<int> getHydrogenBondDonorList() const;
538
540 std::vector<int> getHydrogenBondAcceptorList() const;
541
544 std::vector<uint> getPolarHydrogenMask() const;
545
548 std::vector<uint> getHydrogenBondDonorMask() const;
549
552 std::vector<uint> getHydrogenBondAcceptorMask() const;
553
557 std::vector<int> getChiralCenters(ChiralOrientation direction = ChiralOrientation::NONE) const;
558
562 std::vector<int4> getChiralArmBaseAtoms() const;
563
575 ChiralOrientation getAtomChirality(int atom_index) const;
576 std::vector<ChiralOrientation> getAtomChirality(int low_index, int high_index) const;
577 std::vector<ChiralOrientation> getAtomChirality() const;
579
583 std::vector<uint> getChiralityMask(ChiralOrientation direction) const;
584
588 std::vector<double> getFormalCharges() const;
589
593 std::vector<double> getBondOrders() const;
594
607 double getFreeElectrons(int atom_index) const;
608 std::vector<double> getFreeElectrons(int low_index, int high_index) const;
609 std::vector<double> getFreeElectrons() const;
611
614 const std::vector<int>& getZeroKelvinFormalCharges() const;
615
618 const std::vector<int>& getZeroKelvinBondOrders() const;
619
622 const std::vector<int>& getZeroKelvinFreeElectrons() const;
623
635 ullint getRingInclusion(int atom_index) const;
636 std::vector<ullint> getRingInclusion(int low_index, int high_index) const;
637 std::vector<ullint> getRingInclusion() const;
639
652 bool bondIsInRing(int atom_i, int atom_j) const;
653 bool bondIsInRing(int bond_index) const;
655
678 std::vector<IsomerPlan> getRotatableBondGroups() const;
679 std::vector<IsomerPlan> getRotatableBondGroups(int cutoff, int mol_index = 0) const;
681
685 std::vector<IsomerPlan> getCisTransIsomerizationGroups() const;
686
691 std::vector<IsomerPlan> getChiralInversionGroups() const;
692
702 std::vector<ChiralInversionProtocol> getChiralInversionMethods() const;
703 ChiralInversionProtocol getChiralInversionMethods(int index) const;
705
707 const AtomGraph* getTopologyPointer() const;
708
710 const ChemicalFeatures* getSelfPointer() const;
711
715 ChemicalFeaturesReader data(HybridTargetLevel tier = HybridTargetLevel::HOST) const;
716
724
730 void findRotatableBondGroups(StopWatch *timer = nullptr);
731
732private:
733 int atom_count;
734 int planar_atom_count;
735 int ring_count;
736 int fused_ring_count;
737 int twistable_ring_count;
743 int conjugated_group_count;
744 int aromatic_group_count;
745 int polar_hydrogen_count;
746 int hbond_donor_count;
747 int hbond_acceptor_count;
748 int chiral_center_count;
749 int rotatable_bond_count;
750 int cis_trans_bond_count;
751 int double_bond_count;
752 int triple_bond_count;
753 int max_ring_size;
755 double temperature;
757 bool rotating_groups_mapped;
758 bool chiralities_computed;
760
763 Hybrid<int> planar_centers;
764
774 Hybrid<ullint> ring_inclusion;
775
777 Hybrid<int> ring_atom_bounds;
778
782 Hybrid<int> ring_atoms;
783
785 Hybrid<int> aromatic_group_bounds;
786
788 Hybrid<int> aromatic_pi_electrons;
789
791 Hybrid<int> aromatic_groups;
792
794 Hybrid<int> polar_hydrogens;
795
799 Hybrid<int> hydrogen_bond_donors;
800
802 Hybrid<int> hydrogen_bond_acceptors;
803
808 Hybrid<int4> chiral_arm_atoms;
809
813 Hybrid<int> chiral_centers;
814
818 Hybrid<int> chiral_inversion_methods;
819
825 Hybrid<int> rotatable_groups;
826
830 Hybrid<int> rotatable_group_bounds;
831
834 Hybrid<int> cis_trans_groups;
835
838 Hybrid<int> cis_trans_group_bounds;
839
844 Hybrid<int> invertible_groups;
845
849 Hybrid<int> invertible_group_bounds;
850
852 Hybrid<int> anchor_a_branches;
853
855 Hybrid<int> anchor_b_branches;
856
859 Hybrid<double> formal_charges;
860
863 Hybrid<double> bond_orders;
864
866 Hybrid<double> free_electrons;
867
869 Hybrid<int> int_data;
870
874 Hybrid<int> mutable_group_data;
875
877 Hybrid<double> double_data;
878
884 std::vector<int> zerok_formal_charges;
885
887 std::vector<int> zerok_bond_orders;
888
890 std::vector<int> zerok_free_electrons;
891
893 std::vector<bool> bond_in_ring;
894
897 AtomGraph *ag_pointer;
898
901 StopWatch *timer;
902
908 void analyzeTopology(MapRotatableGroups map_groups_in);
909
915 std::vector<int> findPlanarAtoms(const ValenceKit<double> &vk) const;
916
930 void traceTopologicalRings(const NonbondedKit<double> &nbk, const ChemicalDetailsKit &cdk,
931 std::vector<ullint> *tmp_ring_inclusion,
932 std::vector<int> *tmp_ring_atoms,
933 std::vector<int> *tmp_ring_atom_bounds);
934
947 void markRingAtoms(int j_atom, int k_atom, const std::vector<int> &tree_positions,
948 int node_count, std::vector<BondedNode> *links,
949 std::vector<ullint> *tmp_ring_inclusion, std::vector<int> *tmp_ring_atoms,
950 std::vector<int> *tmp_ring_atom_bounds,
951 const ChemicalDetailsKit &cdk);
952
960 void drawLewisStructures(const ValenceKit<double> &vk, const NonbondedKit<double> &nbk,
961 const ChemicalDetailsKit &cdk);
962
978 void findAromaticGroups(const ChemicalDetailsKit &cdk, const ValenceKit<double> &vk,
979 const std::vector<int> &tmp_ring_atoms,
980 const std::vector<int> &tmp_ring_atom_bounds,
981 std::vector<int> *tmp_aromatic_group_bounds,
982 std::vector<int> *tmp_aromatic_pi_electrons,
983 std::vector<int> *tmp_aromatic_groups);
984
996 std::vector<int> detailChiralCenters(const NonbondedKit<double> &nbk,
997 const ValenceKit<double> &vk,
998 const ChemicalDetailsKit &cdk);
999
1011 std::vector<int> findChiralInversionMethods(const std::vector<int> &tmp_chiral_centers,
1012 const std::vector<int> &tmp_ring_atoms,
1013 const std::vector<int> &tmp_ring_atom_bounds);
1014
1036 void findRotatableBonds(const ValenceKit<double> &vk, const ChemicalDetailsKit &cdk,
1037 const NonbondedKit<double> &nbk, const std::vector<int> &ring_atoms,
1038 const std::vector<int> &ring_atom_bounds,
1039 std::vector<int> *tmp_rotatable_groups,
1040 std::vector<int> *tmp_rotatable_group_bounds,
1041 std::vector<int> *tmp_cis_trans_groups,
1042 std::vector<int> *tmp_cis_trans_group_bounds);
1043
1058 void findInvertibleGroups(const std::vector<int> &tmp_chiral_centers,
1059 const std::vector<int> &tmp_inversion_methods,
1060 std::vector<int> *tmp_anchor_a_branches,
1061 std::vector<int> *tmp_anchor_b_branches,
1062 std::vector<int> *tmp_invertible_groups,
1063 std::vector<int> *tmp_invertible_group_bounds);
1064
1074 void findHydrogenBondElements(const NonbondedKit<double> &nbk, const ChemicalDetailsKit &cdk,
1075 std::vector<int> *tmp_polar_h, std::vector<int> *tmp_hb_don,
1076 std::vector<int> *tmp_hb_acc);
1077
1092 void allocateMutableData(const std::vector<int> &tmp_rotatable_groups,
1093 const std::vector<int> &tmp_rotatable_group_bounds,
1094 const std::vector<int> &tmp_cis_trans_groups,
1095 const std::vector<int> &tmp_cis_trans_group_bounds,
1096 const std::vector<int> &tmp_cis_invertible_groups,
1097 const std::vector<int> &tmp_cis_invertible_group_bounds,
1098 const std::vector<int> &tmp_anchor_a_branches,
1099 const std::vector<int> &tmp_anchor_b_branches);
1100
1103 void repairPointers();
1104};
1105
1117void unpackRotatableGroups(const std::vector<int2> &bond_endpoints,
1118 const std::vector<std::vector<int>> &moving_lists,
1119 std::vector<int> *tmp_groups, std::vector<int> *tmp_group_bounds);
1120
1136bool scoreChiralBranches(const std::vector<std::vector<BondedNode>> &links,
1137 const std::vector<int> &layer_llim, const std::vector<int> &layer_hlim,
1138 const ChemicalDetailsKit &cdk, std::vector<int> *chiral_dominance,
1139 std::vector<int> *parallel_growth);
1140
1162template <typename T>
1163int getChiralOrientation(const T* xcrd, const T* ycrd, const T* zcrd, int center_atom,
1164 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1165
1166int getChiralOrientation(const CoordinateFrameReader &cfr, int center_atom, int root_atom,
1167 int branch_a_atom, int branch_b_atom, int branch_c_atom);
1168
1169int getChiralOrientation(const CoordinateFrame *cf, int center_atom, int root_atom,
1170 int branch_a_atom, int branch_b_atom, int branch_c_atom);
1171
1172int getChiralOrientation(const CoordinateFrame &cf, int center_atom, int root_atom,
1173 int branch_a_atom, int branch_b_atom, int branch_c_atom);
1174
1175int getChiralOrientation(const PhaseSpaceReader &psr, int center_atom, int root_atom,
1176 int branch_a_atom, int branch_b_atom, int branch_c_atom);
1177
1178int getChiralOrientation(const PhaseSpace *ps, int center_atom, int root_atom, int branch_a_atom,
1179 int branch_b_atom, int branch_c_atom);
1180
1181int getChiralOrientation(const PhaseSpace &ps, int center_atom, int root_atom, int branch_a_atom,
1182 int branch_b_atom, int branch_c_atom);
1183
1184template <typename T>
1185int getChiralOrientation(const CoordinateSeriesReader<T> &csr, size_t frame_index, int center_atom,
1186 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1187
1188template <typename T>
1189int getChiralOrientation(const CoordinateSeries<T> *cs, size_t frame_index, int center_atom,
1190 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1191
1192template <typename T>
1193int getChiralOrientation(const CoordinateSeries<T> &cs, size_t frame_index, int center_atom,
1194 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1195
1196int getChiralOrientation(const CondensateReader &cdnsr, int system_index, int center_atom,
1197 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1198
1199int getChiralOrientation(const Condensate *cdns, int system_index, int center_atom,
1200 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1201
1202int getChiralOrientation(const Condensate &cdns, int system_index, int center_atom,
1203 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1204
1205int getChiralOrientation(const PsSynthesisReader &poly_psr, int system_index, int center_atom,
1206 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1207
1208int getChiralOrientation(const PhaseSpaceSynthesis *poly_ps, int system_index, int center_atom,
1209 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1210
1211int getChiralOrientation(const PhaseSpaceSynthesis &poly_ps, int system_index, int center_atom,
1212 int root_atom, int branch_a_atom, int branch_b_atom, int branch_c_atom);
1214
1229bool matchBondingPattern(const AtomGraph &ag, const ChemicalFeatures &chemfe, int atom_a,
1230 int atom_b);
1232
1241bool permutationsAreLinked(const std::vector<IsomerPlan> &isomerizers, int permi, int permj,
1242 const NonbondedKit<double> &nbk);
1243
1244} // namespace chemistry
1245} // namespace stormm
1246
1247#include "chemical_features.tpp"
1248
1249#endif
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
int findBranchAtom(int search_index) const
Get the branch index of a specific atom in a BondedNode.
Definition chemical_features.cpp:137
int getPreviousAtom() const
Get the previous atom index.
Definition chemical_features.cpp:107
BondedNode()
Basic constructor simply initializes the members to blank values.
Definition chemical_features.cpp:45
int getBranchAtom(int index) const
Get the topological atom index of a specific branch that can come off of this BondedNode.
Definition chemical_features.cpp:132
int getPreviousNode() const
Get the previous node's list index.
Definition chemical_features.cpp:112
int getBranchCount() const
Get the number of branches associated with this BondedNode's central atom (this is the total number o...
Definition chemical_features.cpp:127
void setBranchPointer(std::vector< int > *vi, size_t pos, size_t max_branches)
Take a pre-existing std::vector<int> in order to set the object's own next_links pointer....
Definition chemical_features.cpp:51
void addBondOrder(const ValenceKit< double > &vk, const Hybrid< double > &bond_orders)
Add the bond order between this atom and its previous atom.
Definition chemical_features.cpp:90
void wipeRingCompletion()
Wipe clean the ring completion for this object.
Definition chemical_features.cpp:164
int getLayer() const
Get the layer of which this BondedNode is a part.
Definition chemical_features.cpp:122
int getAtom() const
Get the central atom for this BondedNode.
Definition chemical_features.cpp:117
void setRingCompletion(int partner_index)
Set the ring completion for this object (this relies on no atom having more bonds than the number of ...
Definition chemical_features.cpp:159
uint getRingCompletion(int branch_index) const
Get the ring completion status for a particular node.
Definition chemical_features.cpp:149
void addToTree(int previous_in, int current_atom, int current_layer, const NonbondedKit< double > &nbk, const std::vector< bool > &valid_atom_mask)
Set this as the next link in the chain, or as the chain initiator.
Definition chemical_features.cpp:62
double getRootBondOrder() const
Get the bond order of the bond between this atom and the previous atom in the tree.
Definition chemical_features.cpp:154
An object to store information about chemical motifs: participation in rings, planarity,...
Definition chemical_features.h:400
int getRotatableBondCount() const
Get the number of rotatable bonds in the system.
Definition chemical_features.cpp:2690
ChemicalFeatures & operator=(const ChemicalFeatures &other)
Copy assignment and move assignment operators.
Definition chemical_features.cpp:606
std::vector< int > getChiralCenters(ChiralOrientation direction=ChiralOrientation::NONE) const
List the chiral centers in a system, using topological indices.
Definition chemical_features.cpp:2782
int getAromaticGroupCount() const
Get the number of aromatic groups in the system.
Definition chemical_features.cpp:2665
std::vector< uint > getRingMask(int min_ring_size, int max_ring_size) const
Return a mask of rings within a given size range for this system.
Definition chemical_features.cpp:2710
std::vector< int > getHydrogenBondAcceptorList() const
Get a list of all hydrogen bond acceptor atoms.
Definition chemical_features.cpp:2762
int getPolarHydrogenCount() const
Get the number of polar hydrogens in the system.
Definition chemical_features.cpp:2670
std::vector< uint > getAromaticMask(int min_pi_electrons, int max_pi_electrons) const
Return a mask of atomatic atoms in the system.
Definition chemical_features.cpp:2731
int getHydrogenBondAcceptorCount() const
Get the number of hydrogen bond acceptors in the system.
Definition chemical_features.cpp:2680
std::vector< uint > getHydrogenBondAcceptorMask() const
Get a bit mask of all hydrogen bond acceptors in the system, acceptable for inputs to creating new at...
Definition chemical_features.cpp:2777
const std::vector< int > & getZeroKelvinFreeElectrons() const
Return the free electron content of atoms in a representative Lewis structure of the molecules in thi...
Definition chemical_features.cpp:2957
double getFreeElectrons(int atom_index) const
Return the (resonance-averaged) free electron content for one or more atoms in the system.
Definition chemical_features.cpp:2931
std::vector< double > getFormalCharges() const
Return a vector containing the formal charges on all particles in the system (this includes virtual s...
Definition chemical_features.cpp:2921
bool chiralitiesComputed() const
Indicate whether chiralities have been determined for this set of chemical features.
Definition chemical_features.cpp:2705
int getFusedRingCount() const
Get the number of fused rings in the system.
Definition chemical_features.cpp:2655
ChemicalFeatures(const AtomGraph *ag_in=nullptr, MapRotatableGroups map_groups_in=MapRotatableGroups::NO, double temperature_in=300.0, StopWatch *timer_in=nullptr)
The constructor requires a topology and some coordinate set.
Definition chemical_features.cpp:396
ChemicalFeaturesReader data(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the abstract.
Definition chemical_features.cpp:3148
int getAtomCount() const
Get the total number of atoms.
Definition chemical_features.cpp:2640
std::vector< IsomerPlan > getRotatableBondGroups() const
Get the atom endpoints of a rotatable bond. The bond root atom is returned in the x member of the tup...
Definition chemical_features.cpp:3017
std::vector< int > getPolarHydrogenList() const
Get a list of all polar hydrogen atoms.
Definition chemical_features.cpp:2752
const std::vector< int > & getZeroKelvinBondOrders() const
Return the bond orders for a representative Lewis structure of the molecules in this topology.
Definition chemical_features.cpp:2952
int getChiralCenterCount() const
Get the number of chiral centers in the system.
Definition chemical_features.cpp:2685
std::vector< IsomerPlan > getCisTransIsomerizationGroups() const
Get the moving atom groups and bond endpoints involved in cis-trans isomerization....
Definition chemical_features.cpp:3082
int getMutableRingCount() const
Get the number of malleable, non-aromatic twistable rings in the system.
Definition chemical_features.cpp:2660
const ChemicalFeatures * getSelfPointer() const
Get a const pointer to the object itself in host memory.
Definition chemical_features.cpp:3143
std::vector< int > getHydrogenBondDonorList() const
Get a list of all hydrogen bond donor atoms.
Definition chemical_features.cpp:2757
std::vector< uint > getPolarHydrogenMask() const
Get a bit mask of all polar hydrogen atoms in the system, acceptable for inputs to creating new atom ...
Definition chemical_features.cpp:2767
int getPlanarAtomCount() const
Get the number of planar atoms.
Definition chemical_features.cpp:2645
std::vector< ChiralInversionProtocol > getChiralInversionMethods() const
Get the means for inverting one or more chiral centers.
Definition chemical_features.cpp:3124
ullint getRingInclusion(int atom_index) const
Return the ring inclusion specifications for one or more atoms in the system.
Definition chemical_features.cpp:2962
void findRotatableBondGroups(StopWatch *timer=nullptr)
Find the rotatable (and cis-trans invertible, and chiral invertible) atom groups in the topology base...
Definition chemical_features.cpp:3188
int getHydrogenBondDonorCount() const
Get the number of hydrogen bond donors in the system.
Definition chemical_features.cpp:2675
int getRingCount() const
Get the number of rings in the system.
Definition chemical_features.cpp:2650
std::vector< int4 > getChiralArmBaseAtoms() const
Get the bases of each arm for all chiral centers. The result returns the lowest priority arm in the "...
Definition chemical_features.cpp:2834
void findChiralOrientations(const CoordinateFrameReader &cfr)
Find the chiral orientations of the system's chiral centers. This function will be called once by the...
Definition chemical_features.cpp:3169
std::vector< IsomerPlan > getChiralInversionGroups() const
Get the group of atoms that can invert a chiral center by a C2 symmetry rotation. This re-uses the Is...
Definition chemical_features.cpp:3102
bool rotatableGroupsMapped() const
Indicate whether the rotatable groups (including rotatable bonds as well as cis-trans bonds) have bee...
Definition chemical_features.cpp:2700
const AtomGraph * getTopologyPointer() const
Get a pointer to the AtomGraph which built this object.
Definition chemical_features.cpp:3138
std::vector< uint > getChiralityMask(ChiralOrientation direction) const
Return a mask of chiral centers in the system.
Definition chemical_features.cpp:2887
ChiralOrientation getAtomChirality(int atom_index) const
Return the chiral orientations for one or more atoms in the system.
Definition chemical_features.cpp:2839
std::vector< uint > getHydrogenBondDonorMask() const
Get a bit mask of all hydrogen bond donors in the system, acceptable for inputs to creating new atom ...
Definition chemical_features.cpp:2772
const std::vector< int > & getZeroKelvinFormalCharges() const
Return the formal charges for a representative Lewis structure of the molecules in this topology.
Definition chemical_features.cpp:2947
int getCisTransBondCount() const
Get the number of bonds involved in cis-trans isomerization.
Definition chemical_features.cpp:2695
bool bondIsInRing(int atom_i, int atom_j) const
Return whether a bond in the system is in a ring group or not.
Definition chemical_features.cpp:2978
std::vector< double > getBondOrders() const
Return a vector containing the orders of all bonds in the system (this includes bonds to virtual site...
Definition chemical_features.cpp:2926
int getRootHandle() const
Get the root atom handle (for a rotatable bond J-K, this might be I of the sequence I-J-K-L).
Definition chemical_features.cpp:260
ConformationEdit getMotion() const
Get the isomerizing motion.
Definition chemical_features.cpp:240
int getMovingAtom(const size_t index) const
Get the index of an individual moving atom from within this plan.
Definition chemical_features.cpp:285
IsomerPlan(const IsomerPlan &original)=default
The default copy and move constructors will suffice, and with no const members the copy and move assi...
int getPivotAtom() const
Get the pivot atom for the motion.
Definition chemical_features.cpp:255
int getRootAtom() const
Get the root atom for the motion.
Definition chemical_features.cpp:250
int getMovingAtomCount() const
Get the number of moving atoms.
Definition chemical_features.cpp:270
double getMovingAtomWeight() const
Get the total mass of moving atoms.
Definition chemical_features.cpp:280
void addMovingAtoms(const std::vector< int > &new_atom_idx)
Add atoms to the moving atoms list.
Definition chemical_features.cpp:299
const std::vector< int > & getMovingAtoms() const
Get a const reference to the stored list of atoms that move as a consequence of the isomerization.
Definition chemical_features.cpp:294
int getPivotHandle() const
Get the pivot atom handle (for a rotatable bond J-K, this might be L of the sequence I-J-K-L).
Definition chemical_features.cpp:265
int getRealMovingAtomCount() const
Get the number of real moving atoms.
Definition chemical_features.cpp:275
void eraseMovingAtoms()
Erase the list of moving atoms to start over. This will resize the vector to zero.
Definition chemical_features.cpp:304
ChiralInversionProtocol getChiralPlan() const
Get the plan for inverting a chiral center.
Definition chemical_features.cpp:245
IsomerPlan(ConformationEdit motion_in, ChiralInversionProtocol chiral_plan_in, int root_atom_in, int pivot_atom_in, const std::vector< int > &moving_atoms_in, const AtomGraph *ag_pointer_in)
The constructor takes all applicable arguments. Different overloads check the value of the Conformati...
Definition chemical_features.cpp:169
Condense the data format, and possibly offer a reduced representation of coordinates,...
Definition condensate.h:146
A fixed-precision representation of coordinates, velocities, and forces to manage a set of simulation...
Definition phasespace_synthesis.h:325
Object for managing calls to the C-standard function gettimeofday(), calculating deltas and categoriz...
Definition stopwatch.h:23
A struct to hold information relating to an Amber topology. This struct's member functions are limite...
Definition atomgraph.h:50
Store the coordinates and box information for a frame, only. This abridged struct can serve when the ...
Definition coordinateframe.h:111
Store the coordinates and box information for a series of frames, in one of several levels of precisi...
Definition coordinate_series.h:137
An object to complement a topology and hold positions, velocities, and forces of all particles in a s...
Definition phasespace.h:141
Abstract of the chemical features object: this is about as complex as an object with a single abstrac...
Definition chemical_features.h:298
const int * hydrogen_bond_acceptors
List of topological indices for H-bond acceptors.
Definition chemical_features.h:369
const int * aromatic_groups
Definition chemical_features.h:363
const int * invertible_group_bounds
Bounds array for invertible_groups.
Definition chemical_features.h:382
const int hbond_donor_count
Number of hydrogen bond donors.
Definition chemical_features.h:341
const int hbond_acceptor_count
Number of hydrogen bond acceptors.
Definition chemical_features.h:342
const int conjugated_group_count
Number of separate conjugated pi-systems.
Definition chemical_features.h:338
const double * formal_charges
Definition chemical_features.h:387
const int * hydrogen_bond_donors
Definition chemical_features.h:367
const int * cis_trans_group_bounds
Bounds array for cis_trans_groups.
Definition chemical_features.h:378
const int chiral_center_count
Number of chiral centers.
Definition chemical_features.h:343
ChemicalFeaturesReader(const ChemicalFeaturesReader &original)=default
The default copy and move constructors are acceptable, but assignment operators are implicitly delete...
const int aromatic_group_count
Number of distinct aromatic groups.
Definition chemical_features.h:339
const int cis_trans_bond_count
Number of cis-trans flippable bonds.
Definition chemical_features.h:345
const int twistable_ring_count
Number of twistable (i.e. boat-chair) rings.
Definition chemical_features.h:337
const int double_bond_count
Number of double bonds.
Definition chemical_features.h:346
const bool rotating_groups_mapped
Definition chemical_features.h:350
const int polar_hydrogen_count
Number of polar hydrogens.
Definition chemical_features.h:340
const int * aromatic_group_bounds
Bounds array for aromatic_groups.
Definition chemical_features.h:365
const int * cis_trans_groups
Definition chemical_features.h:376
const int ring_count
Number of rings.
Definition chemical_features.h:335
const int * chiral_inversion_methods
Definition chemical_features.h:371
const int * ring_atom_bounds
Bounds array for ring_atoms.
Definition chemical_features.h:359
const int * polar_hydrogens
List of topological indices for polar hydrogen atoms.
Definition chemical_features.h:366
const int * planar_centers
Topological indices of atoms with enforced planarity.
Definition chemical_features.h:356
const int4 * chiral_arm_atoms
Definition chemical_features.h:383
const double temperature
Temperature at which resonance structures were computed.
Definition chemical_features.h:349
const int * aromatic_pi_electrons
Definition chemical_features.h:360
ChemicalFeaturesReader(int atom_count_in, int planar_atom_count_in, int ring_count_in, int fused_ring_count_in, int twistable_ring_count_in, int conjugated_group_count_in, int aromatic_group_count_in, int polar_hydrogen_count_in, int hbond_donor_count_in, int hbond_acceptor_count_in, int chiral_center_count_in, int rotatable_bond_count_in, int cis_trans_bond_count_in, int double_bond_count_in, int triple_bond_count_in, int max_ring_size_in, double temperature_in, bool rotating_groups_mapped_in, bool chiralities_computed_in, const int *planar_centers_in, const int *ring_atoms_in, const int *ring_atom_bounds_in, const int *aromatic_pi_electrons_in, const int *aromatic_groups_in, const int *aromatic_group_bounds_in, const int *polar_hydrogens_in, const int *hydrogen_bond_donors_in, const int *hydrogen_bond_acceptors_in, const int *chiral_centers_in, const int *chiral_inversion_methods_in, const int *rotatable_groups_in, const int *rotatable_group_bounds_in, const int *cis_trans_groups_in, const int *cis_trans_group_bounds_in, const int *invertible_groups_in, const int *invertible_group_bounds_in, const int4 *chiral_arm_atoms_in, const double *formal_charges_in, const double *bond_orders_in, const double *free_electrons_in, const ullint *ring_inclusion_in, const AtomGraph *ag_pointer_in)
The constructor takes a straight list of critical constants and pointers.
Definition chemical_features.cpp:330
const AtomGraph * ag_pointer
Definition chemical_features.h:394
const int * chiral_centers
List of topological indices for chiral centers.
Definition chemical_features.h:370
const int atom_count
Total number of atoms in the system.
Definition chemical_features.h:333
const int * ring_atoms
Definition chemical_features.h:357
const int fused_ring_count
Number of fused rings.
Definition chemical_features.h:336
const int * invertible_groups
Definition chemical_features.h:379
const int triple_bond_count
Number of triple bonds.
Definition chemical_features.h:347
const int planar_atom_count
Number of atoms with enforced planarity.
Definition chemical_features.h:334
const int rotatable_bond_count
Number of rotatable single bonds.
Definition chemical_features.h:344
const double * bond_orders
Definition chemical_features.h:389
const bool chiralities_computed
Definition chemical_features.h:352
const int max_ring_size
The maximum ring size found.
Definition chemical_features.h:348
const double * free_electrons
Free electron content of each atom.
Definition chemical_features.h:391
const int * rotatable_groups
Definition chemical_features.h:373
const int * rotatable_group_bounds
Bounds array for rotatable groups.
Definition chemical_features.h:375
const ullint * ring_inclusion
Definition chemical_features.h:392
CoupledEdit(const CoupledEdit &original)=default
The copy and move constructors, as well as assignment operators, can take their default forms.
ConformationEdit edit
Definition chemical_features.h:291
CoupledEdit()
Definition chemical_features.cpp:309
int index
Index of the connected feature from whatever appropriate list.
Definition chemical_features.h:293
Definition stormm_vector_types.h:22
Definition stormm_vector_types.h:33
Read-only abstract for the Condensate class. In most cases, the read-only abstract will be preferred ...
Definition condensate.h:102
The reader for a PhaseSpaceSynthesis object, containing all of the data relevant for propagating dyna...
Definition phasespace_synthesis.h:199
Information on atoms and residues which may be useful for applying atom masks or identifying specific...
Definition atomgraph_abstracts.h:382
Information needed for non-bonded real-space calculations. Templating is used as above,...
Definition atomgraph_abstracts.h:287
Information need for bonded calculations. Templating is used to serve either of two levels of precisi...
Definition atomgraph_abstracts.h:88
Collect C-style pointers for the elements of a read-only CoordinateFrame object.
Definition coordinateframe.h:65
Collect C-style pointers and critical constants for a read-only CoordinateSeries object.
Definition coordinate_series.h:96
Collect constants and pointers to the components of a read-only PhaseSpace object.
Definition phasespace.h:81