2#ifndef STORMM_ATOM_EQUIVALENCE_H
3#define STORMM_ATOM_EQUIVALENCE_H
8#include "Topology/atomgraph.h"
9#include "Trajectory/coordinateframe.h"
10#include "UnitTesting/stopwatch.h"
11#include "chemical_features.h"
12#include "chemistry_enumerators.h"
17using topology::AtomGraph;
18using testing::StopWatch;
36 const std::vector<double> &free_electrons,
const std::vector<ullint> &ring_inclusion,
37 const std::vector<ChiralOrientation> &chiralities, std::vector<int> *a_idx_tree,
38 std::vector<int> *b_idx_tree, std::vector<int> *a_zn_tree, std::vector<int> *b_zn_tree,
39 std::vector<double> *a_fc_tree, std::vector<double> *b_fc_tree,
40 std::vector<double> *a_fe_tree, std::vector<double> *b_fe_tree,
41 std::vector<ullint> *a_ri_tree, std::vector<ullint> *b_ri_tree,
42 std::vector<ChiralOrientation> *a_ch_tree, std::vector<ChiralOrientation> *b_ch_tree,
43 std::vector<int> *a_coverage, std::vector<int> *b_coverage,
int low_molecule_index = 0,
44 int high_molecule_index = -1);
47 const std::vector<double> &free_electrons,
const std::vector<ullint> &ring_inclusion,
48 const std::vector<ChiralOrientation> &chiralities,
int low_molecule_index = 0,
49 int high_molecule_index = -1);
52 int high_molecule_index = -1);
55 int high_molecule_index = -1);
69 const std::vector<int>&
getRanks()
const;
70 std::vector<int>
getRanks(
int low_index,
int high_index)
const;
71 int getRank(
int atom_index)
const;
86 std::vector<int> ranks;
87 std::vector<int> rank_degeneracy_bounds;
88 std::vector<int> rank_instances;
120 const std::vector<double> &free_electrons,
121 const std::vector<ullint> &ring_inclusion,
122 const std::vector<ChiralOrientation> &chiralities,
StopWatch *timer =
nullptr,
123 int low_molecule_index = 0,
int high_molecule_index = -1);
126 const std::vector<double> &free_electrons,
127 const std::vector<ullint> &ring_inclusion,
128 const std::vector<ChiralOrientation> &chiralities,
StopWatch *timer =
nullptr,
129 int low_molecule_index = 0,
int high_molecule_index = -1);
132 int low_molecule_index = 0,
int high_molecule_index = -1);
135 int low_molecule_index = 0,
int high_molecule_index = -1);
161 std::vector<int>
getGroup(
int group_index)
const;
218 std::vector<int> group_atoms;
224 std::vector<int> group_sizes;
225 std::vector<int> group_orders;
226 std::vector<int> group_bounds;
227 std::vector<int> group_levels;
233 std::vector<int> dependencies;
237 std::vector<int> dependency_bounds;
239 std::vector<int> asymmetric_atoms;
242 std::vector<EquivalenceSwap> group_rules;
280 void findEquivalentAtoms(
const std::vector<int> &subset_atoms, std::vector<int> *map_to_subset,
281 const std::vector<double> &formal_charges,
282 const std::vector<double> &free_electrons,
283 const std::vector<ullint> &ring_inclusion,
284 const std::vector<ChiralOrientation> &chiralities,
285 const AtomRank &arnks, std::vector<int> *domain_coverage,
286 std::vector<int> *allowed_atoms, std::vector<int> *candidate_hopper,
287 std::vector<int> *domain_assignment, std::vector<int> *jumbled_groups,
288 std::vector<int> *aligned_groups, std::vector<int> *layer_bounds);
316 void drawEquivalentGroups(
const std::vector<int> &partners,
const std::vector<int> &subset_atoms,
317 const std::vector<double> &formal_charges,
318 const std::vector<double> &free_electrons,
319 const std::vector<ullint> &ring_inclusion,
320 const std::vector<ChiralOrientation> &chiralities,
321 const AtomRank &arnks, std::vector<int> *domain_coverage,
322 std::vector<int> *allowed_atoms, std::vector<int> *candidate_hopper,
323 std::vector<int> *domain_assignment, std::vector<int> *jumbled_groups,
324 std::vector<int> *aligned_groups, std::vector<int> *layer_bounds);
339 void addSymmetryGroup(
const std::vector<int> &all_domains,
int domain_size,
340 const std::vector<int> &selected_domains, EquivalenceSwap plan);
344 void freeForAllSymmetryGroup(
const std::vector<int> &all_domains,
int domain_size,
345 const std::vector<int> &selected_domains);
355 void rotarySymmetryGroup(
const std::vector<int> &all_domains,
int domain_size,
356 const std::vector<int> &selected_domains,
357 const std::vector<bool> &touch_table);
361 void cullDuplicateGroups();
365 void findDependencies();
370 void orderAllGroups();
397std::vector<int> rankAtoms(
const AtomGraph *ag,
const std::vector<double> &formal_charges,
398 const std::vector<double> &free_electrons,
399 const std::vector<ullint> &ring_inclusion,
400 const std::vector<ChiralOrientation> &chiralities,
401 std::vector<int> *a_idx_tree, std::vector<int> *b_idx_tree,
402 std::vector<int> *a_zn_tree, std::vector<int> *b_zn_tree,
403 std::vector<double> *a_fc_tree, std::vector<double> *b_fc_tree,
404 std::vector<double> *a_fe_tree, std::vector<double> *b_fe_tree,
405 std::vector<ullint> *a_ri_tree, std::vector<ullint> *b_ri_tree,
406 std::vector<ChiralOrientation> *a_ch_tree,
407 std::vector<ChiralOrientation> *b_ch_tree,
408 std::vector<int> *a_coverage, std::vector<int> *b_coverage,
409 int low_molecule_index = 0,
int high_molecule_index = -1);
411std::vector<int> rankAtoms(
const AtomGraph &ag,
const std::vector<double> &formal_charges,
412 const std::vector<double> &free_electrons,
413 const std::vector<ullint> &ring_inclusion,
414 const std::vector<ChiralOrientation> &chiralities,
415 int low_molecule_index = 0,
int high_molecule_index = -1);
418 int low_molecule_index = 0,
int high_molecule_index = -1);
421 int low_molecule_index = 0,
int high_molecule_index = -1);
std::vector< int > getGroup(int group_index) const
Get the atoms of one group as an independent Standard Template Library vector.
Definition atom_equivalence.cpp:570
std::vector< int > getGroupDependencies(int group_index) const
Get a list of a group's dependencies (other groups that the group in question contains completely)....
Definition atom_equivalence.cpp:614
const AtomGraph * getTopologyPointer() const
Get a const pointer to the topology for which these equivalencies apply.
Definition atom_equivalence.cpp:635
int getGroupSize(int group_index) const
Get the size of a particular group.
Definition atom_equivalence.cpp:594
AtomEquivalence(const AtomEquivalence &original)=default
int getGroupLevel(int group_index) const
Get the depth of the group of interest in terms of its dependence on (containment within) other group...
Definition atom_equivalence.cpp:604
EquivalenceSwap getGroupRule(int group_index) const
Get the manner by which combinations of the group's interchangeable subunits should be laid out in or...
Definition atom_equivalence.cpp:609
AtomEquivalence()
The constructor relies on a topology pointer plus arrays of formal charges, bond orders,...
Definition atom_equivalence.cpp:401
int getSymmetryDepth() const
Get the number of levels of symmetry-related groups. This is essential for mapping identity swaps tha...
Definition atom_equivalence.cpp:565
int getGroupCount() const
Get the number of atom equivalence groups.
Definition atom_equivalence.cpp:560
int getGroupOrder(int group_index) const
Get the order of a particular group.
Definition atom_equivalence.cpp:599
const int * getGroupPointer(int group_index) const
Get a pointer to the atom indices of a particular group.
Definition atom_equivalence.cpp:589
const std::vector< int > & getAsymmetricAtoms() const
Get a const reference to the list of atoms outside any symmetry group.
Definition atom_equivalence.cpp:630
int getSymmetryRelatedAtom(int group_index, int domain_index, int atom_index) const
Get one atom index from within a symmetry-equivalent atom group.
Definition atom_equivalence.cpp:581
int getAsymmetricAtomCount() const
Get the number of asymmetric core atoms.
Definition atom_equivalence.cpp:625
Compute ranks for each atom from one or more molecules, assigning a unique (but, essentially arbitrar...
Definition atom_equivalence.h:25
const std::vector< int > & getRanks() const
Get the rank of one or more atoms.
Definition atom_equivalence.cpp:349
AtomRank(const AtomGraph *ag_in=nullptr)
The atom ranks can be constructed with or without temporary arrays to use as a workspace....
Definition atom_equivalence.cpp:20
std::vector< int > getRankPartners(const int atom_index) const
Get a list of all atoms which have a similar rank to a specific atom.
Definition atom_equivalence.cpp:388
std::vector< int > getAtomsWithRank(const int rank_value) const
Get a list of all atoms in the system with a particular rank.
Definition atom_equivalence.cpp:373
An object to store information about chemical motifs: participation in rings, planarity,...
Definition chemical_features.h:400
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