STORMM Source Documentation
Loading...
Searching...
No Matches
rmsd_plan.h
1// -*-c++-*-
2#ifndef STORMM_RMSD_PLAN_H
3#define STORMM_RMSD_PLAN_H
4
5#include <vector>
6#include "copyright.h"
7#include "Accelerator/hybrid.h"
8#include "Accelerator/gpu_details.h"
9#include "Chemistry/atom_equivalence.h"
10#include "Synthesis/phasespace_synthesis.h"
11#include "Synthesis/synthesis_cache_map.h"
12#include "Synthesis/synthesis_enumerators.h"
13#include "Synthesis/systemcache.h"
14#include "Topology/atomgraph.h"
15#include "Topology/atomgraph_abstracts.h"
16#include "Trajectory/coordinateframe.h"
17#include "Trajectory/coordinate_series.h"
18#include "structure_enumerators.h"
19
20namespace stormm {
21namespace structure {
22
23using card::GpuDetails;
24using card::Hybrid;
25using card::HybridTargetLevel;
26using chemistry::AtomEquivalence;
27using synthesis::PhaseSpaceSynthesis;
28using synthesis::PsSynthesisReader;
29using synthesis::SynthesisCacheMap;
30using synthesis::SystemCache;
31using synthesis::SystemGrouping;
32using topology::AtomGraph;
33using topology::ChemicalDetailsKit;
34using trajectory::CoordinateFrame;
35using trajectory::CoordinateSeries;
36
41constexpr double default_required_mass_fraction = 0.75;
42
45template <typename T> struct RMSDPlanReader {
46
48 RMSDPlanReader(int plan_count_in, RMSDMethod strategy_in, double mass_fraction_in,
49 const T* masses_in, const int* atom_counts_in, const int* atom_starts_in,
50 const int* alignment_steps_in, const int* core_atoms_in,
51 const int* core_counts_in, const int* core_starts_in, const int* symm_atoms_in,
52 const int4* symm_bounds_in, const int2* symm_ranges_in);
53
60
61 const int plan_count;
62 const RMSDMethod strategy;
64 const double mass_fraction;
66 const T* masses;
67 const int* atom_counts;
68 const int* atom_starts;
70 const int* alignment_steps;
71 const int* core_atoms;
72 const int* core_counts;
74 const int* core_starts;
76 const int* symm_atoms;
85};
86
89class RMSDPlan {
90public:
91
116 RMSDPlan(RMSDMethod strategy_in = RMSDMethod::ALIGN_MASS,
117 double rmf_in = default_required_mass_fraction,
118 const PhaseSpaceSynthesis *poly_ps_in = nullptr, const SystemCache *sc_in = nullptr,
119 const SynthesisCacheMap *scmap_in = nullptr);
120
121 RMSDPlan(const AtomGraph &ag_in, const CoordinateFrame &cf_in,
122 RMSDMethod strategy_in = RMSDMethod::ALIGN_MASS,
123 double rmf_in = default_required_mass_fraction, const GpuDetails &gpu = null_gpu,
124 int low_mol_idx = 0, int high_mol_idx = -1);
125
126 RMSDPlan(const AtomEquivalence &eq_in, RMSDMethod strategy_in = RMSDMethod::ALIGN_MASS,
127 double rmf_in = default_required_mass_fraction, const GpuDetails &gpu = null_gpu);
128
129 RMSDPlan(const PhaseSpaceSynthesis *poly_ps_in, RMSDMethod strategy_in = RMSDMethod::ALIGN_MASS,
130 double rmf_in = default_required_mass_fraction, const GpuDetails &gpu = null_gpu,
131 int low_mol_idx = 0, int high_mol_idx = -1);
132
133 RMSDPlan(const PhaseSpaceSynthesis *poly_ps_in, const std::vector<AtomEquivalence> &eq_list_in,
134 RMSDMethod strategy_in = RMSDMethod::ALIGN_MASS,
135 double rmf_in = default_required_mass_fraction, const GpuDetails &gpu = null_gpu);
136
137 RMSDPlan(const PhaseSpaceSynthesis &poly_ps_in, RMSDMethod strategy_in = RMSDMethod::ALIGN_MASS,
138 double rmf_in = default_required_mass_fraction, const GpuDetails &gpu = null_gpu,
139 int low_mol_idx = 0, int high_mol_idx = -1);
140
141 RMSDPlan(const PhaseSpaceSynthesis &poly_ps_in, const std::vector<AtomEquivalence> &eq_list_in,
142 RMSDMethod strategy_in = RMSDMethod::ALIGN_MASS,
143 double rmf_in = default_required_mass_fraction, const GpuDetails &gpu = null_gpu);
144
145 RMSDPlan(const PhaseSpaceSynthesis *poly_ps_in, const SystemCache *sc_in,
146 const SynthesisCacheMap *scmap_in,
147 const RMSDMethod strategy_in = RMSDMethod::ALIGN_MASS,
148 const double rmf_in = default_required_mass_fraction, const GpuDetails &gpu = null_gpu,
149 const int low_mol_idx = 0, const int high_mol_idx = -1);
150
151 RMSDPlan(const PhaseSpaceSynthesis &poly_ps_in, const SystemCache &sc_in,
152 const SynthesisCacheMap &scmap_in,
153 const RMSDMethod strategy_in = RMSDMethod::ALIGN_MASS,
154 const double rmf_in = default_required_mass_fraction, const GpuDetails &gpu = null_gpu,
155 const int low_mol_idx = 0, const int high_mol_idx = -1);
157
165 RMSDPlan(const RMSDPlan &original) = default;
166 RMSDPlan(RMSDPlan &&original) = default;
167 RMSDPlan& operator=(const RMSDPlan &original) = default;
168 RMSDPlan& operator=(RMSDPlan &&original) = default;
170
172 int getPlanCount() const;
173
180 int getPlanIndex(int index, SystemGrouping organization) const;
181
183 RMSDMethod getGeneralStrategy() const;
184
187 double getRequiredMassFraction() const;
188
192 const AtomGraph* getTopologyPointer(int plan_index) const;
193
197 RMSDAlignmentProtocol getAlignmentProtocol(int plan_index) const;
198
203 const RMSDPlanReader<double> dpData(HybridTargetLevel tier = HybridTargetLevel::HOST) const;
204
209 const RMSDPlanReader<float> spData(HybridTargetLevel tier = HybridTargetLevel::HOST) const;
210
213
215 const SystemCache* getCachePointer() const;
216
219
220#ifdef STORMM_USE_HPC
222 void upload();
223
225 void download();
226#endif
227
237 void addSystemCache(const SystemCache *sc, const SynthesisCacheMap *scmap);
238 void addSystemCache(const SystemCache &sc, const SynthesisCacheMap &scmap);
240
241private:
242
244 int plan_count;
245
246 // Additional directives and arrays pertinent to each individual plan
247 RMSDMethod general_strategy;
251 double required_mass_fraction;
253 Hybrid<double> masses;
254 Hybrid<float> sp_masses;
255 Hybrid<int> atom_counts;
256 Hybrid<int> atom_starts;
259 Hybrid<int> asymmetric_core_atoms;
261 Hybrid<int> asymmetric_core_counts;
263 Hybrid<int> asymmetric_core_starts;
265 Hybrid<int> symmetry_group_atoms;
274 Hybrid<int4> symmetry_group_bounds;
288 Hybrid<int> alignment_steps;
293 Hybrid<int2> symmetry_group_ranges;
297
311 Hybrid<int> alignment_prerequisites;
312
315 Hybrid<int> alignment_protocols;
316
321 Hybrid<int> symmetry_depth;
322
331 Hybrid<int2> symmetry_group_membership;
332
346 Hybrid<ullint> symmetry_group_membership_bounds;
347
349 std::vector<AtomGraph*> ag_pointers;
350
354 PhaseSpaceSynthesis *poly_ps_ptr;
355
360 SystemCache *sc_ptr;
361
363 SynthesisCacheMap *scmap_ptr;
364
369 void chartSymmetryGroups(const std::vector<AtomEquivalence> &eq_tables);
370
375 void writeSymmetryGroupCodes();
376};
377
378} // namespace structure
379} // namespace stormm
380
381#include "rmsd_plan.tpp"
382
383#endif
Pertinent aspects of one particular GPU. Condensing the data for each GPU in this manner helps to ens...
Definition gpu_details.h:27
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
Collect the set of symmetry-related and interchangeable groups for one or more molecules within a top...
Definition atom_equivalence.h:94
const SystemCache * getCachePointer() const
Get the system cache pointer.
Definition rmsd_plan.cpp:253
const SynthesisCacheMap * getSynthesisMapPointer() const
Get a pointer to the map between the cache and the coordinate synthesis.
Definition rmsd_plan.cpp:258
const RMSDPlanReader< float > spData(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the read-only abstract of the system in single precision. The masses of particles are the only te...
Definition rmsd_plan.cpp:238
RMSDMethod getGeneralStrategy() const
Get the general, prescribed strategy for computing RMSDs.
Definition rmsd_plan.cpp:207
int getPlanCount() const
Get the number of plans kept within this object.
Definition rmsd_plan.cpp:178
const RMSDPlanReader< double > dpData(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the read-only abstract of the system in double precision. The masses of particles are the only te...
Definition rmsd_plan.cpp:227
const AtomGraph * getTopologyPointer(int plan_index) const
Get one of the topology pointers used by the RMSD plan.
Definition rmsd_plan.cpp:217
void addSystemCache(const SystemCache *sc, const SynthesisCacheMap *scmap)
Attach a SystemCache and map between the cache and the synthesis to the object.
Definition rmsd_plan.cpp:305
const PhaseSpaceSynthesis * getCoordinateSynthesisPointer() const
Get the coordinate synthesis pointer.
Definition rmsd_plan.cpp:248
RMSDPlan(const RMSDPlan &original)=default
With no POINTER-kind Hybrid or pointers to its own member variables to repair, and no const members,...
RMSDPlan(RMSDMethod strategy_in=RMSDMethod::ALIGN_MASS, double rmf_in=default_required_mass_fraction, const PhaseSpaceSynthesis *poly_ps_in=nullptr, const SystemCache *sc_in=nullptr, const SynthesisCacheMap *scmap_in=nullptr)
The constructor can take any number of AtomEquivalence objects and build plans from them....
Definition rmsd_plan.cpp:23
int getPlanIndex(int index, SystemGrouping organization) const
Get the plan index applicable to a specific grouping of systems (this assumes that all systems in the...
Definition rmsd_plan.cpp:183
RMSDAlignmentProtocol getAlignmentProtocol(int plan_index) const
Get one of the alignment protocols.
Definition rmsd_plan.cpp:222
double getRequiredMassFraction() const
Get the mass fraction required to test symmetry-related atom arrangements without specific alignments...
Definition rmsd_plan.cpp:212
A fixed-precision representation of coordinates, velocities, and forces to manage a set of simulation...
Definition phasespace_synthesis.h:325
Encode a map between the systems of a snythesis and those of a SystemCache. The synthesis is expected...
Definition synthesis_cache_map.h:70
Simple but central struct to store the primitive form of the collection of systems that most STORMM a...
Definition systemcache.h:63
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
Definition stormm_vector_types.h:22
Definition stormm_vector_types.h:33
Read-only abstract for the RMSDPlan object, containing pointers to various buckets of atom indices.
Definition rmsd_plan.h:45
RMSDPlanReader(int plan_count_in, RMSDMethod strategy_in, double mass_fraction_in, const T *masses_in, const int *atom_counts_in, const int *atom_starts_in, const int *alignment_steps_in, const int *core_atoms_in, const int *core_counts_in, const int *core_starts_in, const int *symm_atoms_in, const int4 *symm_bounds_in, const int2 *symm_ranges_in)
The constructor takes inputs for all arguments.
const double mass_fraction
Definition rmsd_plan.h:64
const int plan_count
The number of individual system RMSD calculation plans.
Definition rmsd_plan.h:61
const int * symm_atoms
Concatenated lists of each system's symmetry-related atoms.
Definition rmsd_plan.h:76
const int * core_starts
Definition rmsd_plan.h:74
const T * masses
Masses of particles in all systems.
Definition rmsd_plan.h:66
const RMSDMethod strategy
Definition rmsd_plan.h:62
RMSDPlanReader(const RMSDPlanReader &original)
The presence of const members will implicitly delete the copy and move assignment operators,...
const int * atom_counts
Numbers of atoms involved in the systems served by each plan.
Definition rmsd_plan.h:67
const int2 * symm_ranges
Definition rmsd_plan.h:82
const int * core_counts
Definition rmsd_plan.h:72
const int * atom_starts
Definition rmsd_plan.h:68
const int * alignment_steps
Protocols for performing RMSD calculations under each plan.
Definition rmsd_plan.h:70
const int * core_atoms
Concatenated lists of asymmetric atoms in each system.
Definition rmsd_plan.h:71
const int4 * symm_bounds
Definition rmsd_plan.h:77