STORMM Source Documentation
Loading...
Searching...
No Matches
local_arrangement.h
1// -*-c++-*-
2#ifndef STORMM_LOCAL_ARRANGEMENT_H
3#define STORMM_LOCAL_ARRANGEMENT_H
4
5#include <cmath>
6#include "copyright.h"
7#include "Accelerator/hybrid.h"
8#include "Constants/behavior.h"
9#include "Constants/fixed_precision.h"
10#include "Constants/symbol_values.h"
11#include "DataTypes/common_types.h"
12#include "DataTypes/stormm_vector_types.h"
13#include "Math/rounding.h"
14#include "Math/vector_ops.h"
15#include "Numerics/split_fixed_precision.h"
16#include "Reporting/error_format.h"
17#include "Synthesis/condensate.h"
18#include "Synthesis/phasespace_synthesis.h"
19#include "Topology/atomgraph_enumerators.h"
20#include "Trajectory/coordinateframe.h"
21#include "Trajectory/coordinateframe.h"
22#include "Trajectory/coordinate_series.h"
23#include "Trajectory/phasespace.h"
24#include "structure_enumerators.h"
25
26namespace stormm {
27namespace structure {
28
29using card::Hybrid;
30using constants::PrecisionModel;
31using data_types::isSignedIntegralScalarType;
32using numerics::globalpos_scale_nonoverflow_bits;
33using numerics::hostInt95ToDouble;
34using numerics::hostInt95Subtract;
35using numerics::hostInt95Sum;
36using stmath::angleVerification;
37using stmath::crossProduct;
38using stmath::roundUp;
39using synthesis::Condensate;
40using synthesis::CondensateReader;
41using synthesis::CondensateWriter;
42using synthesis::PhaseSpaceSynthesis;
43using synthesis::PsSynthesisReader;
44using synthesis::PsSynthesisWriter;
45using topology::UnitCellType;
46using trajectory::CoordinateFrame;
47using trajectory::CoordinateFrameReader;
48using trajectory::CoordinateFrameWriter;
49using trajectory::CoordinateSeries;
50using trajectory::CoordinateSeriesReader;
51using trajectory::CoordinateSeriesWriter;
52using trajectory::PhaseSpace;
53using trajectory::PhaseSpaceReader;
54using trajectory::PhaseSpaceWriter;
55
63template <typename Tcoord, typename Tcalc>
64Tcoord imageValue(Tcoord x, Tcalc range, ImagingMethod style, Tcalc gpos_scale_factor = 1.0);
65
87template <typename Tcoord, typename Tcalc>
88void imageCoordinates(Tcoord *x, Tcoord *y, Tcoord *z, const double* umat, const double* invu,
89 UnitCellType unit_cell, ImagingMethod style, Tcalc gpos_scale_factor = 1.0);
90
91template <typename Tcoord, typename Tcalc>
92void imageCoordinates(Tcoord* x, Tcoord* y, Tcoord* z, const int length, const double* umat,
93 const double* invu, UnitCellType unit_cell, ImagingMethod style,
94 Tcalc gpos_scale_factor = 1.0, int* xcrd_ovrf = nullptr,
95 int* ycrd_ovrf = nullptr, int* zcrd_ovrf = nullptr);
96
97template <typename Tcoord, typename Tcalc>
98void imageCoordinates(std::vector<Tcoord> *x, std::vector<Tcoord> *y, std::vector<Tcoord> *z,
99 const double* umat, const double* invu, UnitCellType unit_cell,
100 ImagingMethod style, Tcalc gpos_scale_factor = 1.0);
101
102template <typename Tcoord, typename Tcalc>
103void imageCoordinates(Hybrid<Tcoord> *x, Hybrid<Tcoord> *y, Hybrid<Tcoord> *z,
104 const double* umat, const double* invu, UnitCellType unit_cell,
105 ImagingMethod style, Tcalc gpos_scale_factor = 1.0);
106
107void imageCoordinates(CoordinateFrameWriter cfw, ImagingMethod style);
108
109void imageCoordinates(CoordinateFrame *cf, ImagingMethod style);
110
111void imageCoordinates(PhaseSpaceWriter psw, ImagingMethod style);
112
113void imageCoordinates(PhaseSpace *ps, ImagingMethod style);
114
115template <typename Tcoord, typename Tcalc>
116void imageCoordinates(CoordinateSeriesWriter<Tcoord> csw, size_t frame_index, ImagingMethod style);
117
118template <typename Tcoord, typename Tcalc>
119void imageCoordinates(CoordinateSeries<Tcoord> *cs, size_t frame_index, ImagingMethod style);
120
121template <typename Tcalc>
122void imageCoordinates(CondensateWriter cdnsw, int system_index, ImagingMethod style);
123
124template <typename Tcalc>
125void imageCoordinates(Condensate *cdns, int system_index, ImagingMethod style);
126
127template <typename Tcalc>
128void imageCoordinates(PsSynthesisWriter poly_psw, int system_index, ImagingMethod style);
129
130template <typename Tcalc>
131void imageCoordinates(PhaseSpaceSynthesis *poly_ps, int system_index, ImagingMethod style);
133
146template <typename Tcoord>
147double displacement(int atom_i, int atom_j, const Tcoord* crd, const int* crd_ovrf,
148 double inv_gpos_factor);
149
180template <typename Tcalc4, typename Tcalc>
181Tcalc4 distance(const int95_t pti_x, const int95_t pti_y, const int95_t pti_z, const int95_t ptj_x,
182 const int95_t ptj_y, const int95_t ptj_z, const double* umat, const double* invu,
183 UnitCellType unit_cell, Tcalc gpos_scale_factor);
184
185template <typename Tcoord, typename Tcalc>
186Tcalc distance(int atom_i, int atom_j, const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd,
187 const double* umat, const double* invu, UnitCellType unit_cell,
188 Tcalc gpos_scale_factor = 1.0, const int* xcrd_ovrf = nullptr,
189 const int* ycrd_ovrf = nullptr, const int* zcrd_ovrf = nullptr);
190
191double distance(int atom_i, int atom_j, const CoordinateFrameReader &cfr);
192
193double distance(int atom_i, int atom_j, const CoordinateFrame *cf);
194
195double distance(int atom_i, int atom_j, const CoordinateFrame &cf);
196
197double distance(int atom_i, int atom_j, const PhaseSpaceReader &psr);
198
199double distance(int atom_i, int atom_j, const PhaseSpace *ps);
200
201double distance(int atom_i, int atom_j, const PhaseSpace &ps);
202
203template <typename Tcoord, typename Tcalc>
204Tcalc distance(int atom_i, int atom_j, const CoordinateSeriesReader<Tcoord> &csr,
205 size_t frame_index);
206
207template <typename Tcoord, typename Tcalc>
208Tcalc distance(int atom_i, int atom_j, const CoordinateSeries<Tcoord> *cs, size_t frame_index);
209
210template <typename Tcoord, typename Tcalc>
211Tcalc distance(int atom_i, int atom_j, const CoordinateSeries<Tcoord> &cs, size_t frame_index);
212
213template <typename Tcalc>
214Tcalc distance(int atom_i, int atom_j, const CondensateReader &cdnsr, int system_index);
215
216template <typename Tcalc>
217Tcalc distance(int atom_i, int atom_j, const Condensate *cdns, int system_index);
218
219template <typename Tcalc>
220Tcalc distance(int atom_i, int atom_j, const Condensate &cdns, int system_index);
221
222template <typename Tcalc>
223Tcalc distance(int atom_i, int atom_j, const PsSynthesisReader &poly_psr, int system_index);
224
225template <typename Tcalc>
226Tcalc distance(int atom_i, int atom_j, const PhaseSpaceSynthesis *poly_ps, int system_index);
227
228template <typename Tcalc>
229Tcalc distance(int atom_i, int atom_j, const PhaseSpaceSynthesis &poly_ps, int system_index);
231
244template <typename Tcoord, typename Tcalc>
245Tcalc angle(int atom_i, int atom_j, int atom_k, const Tcoord* xcrd, const Tcoord* ycrd,
246 const Tcoord* zcrd, const double* umat, const double* invu, UnitCellType unit_cell,
247 Tcalc gpos_scale_factor = 1.0, const int* xcrd_ovrf = nullptr,
248 const int* ycrd_ovrf = nullptr, const int* zcrd_ovrf = nullptr);
249
250double angle(int atom_i, int atom_j, int atom_k, const CoordinateFrameReader &cfr);
251
252double angle(int atom_i, int atom_j, int atom_k, const CoordinateFrame *cf);
253
254double angle(int atom_i, int atom_j, int atom_k, const CoordinateFrame &cf);
255
256double angle(int atom_i, int atom_j, int atom_k, const PhaseSpaceReader &psr);
257
258double angle(int atom_i, int atom_j, int atom_k, const PhaseSpace *ps);
259
260double angle(int atom_i, int atom_j, int atom_k, const PhaseSpace &ps);
261
262template <typename Tcoord, typename Tcalc>
263Tcalc angle(int atom_i, int atom_j, int atom_k, const CoordinateSeriesReader<Tcoord> &csr,
264 size_t frame_index);
265
266template <typename Tcoord, typename Tcalc>
267Tcalc angle(int atom_i, int atom_j, int atom_k, const CoordinateSeries<Tcoord> *cs,
268 size_t frame_index);
269
270template <typename Tcoord, typename Tcalc>
271Tcalc angle(int atom_i, int atom_j, int atom_k, const CoordinateSeries<Tcoord> &cs,
272 size_t frame_index);
273
274template <typename Tcalc>
275Tcalc angle(int atom_i, int atom_j, int atom_k, const CondensateReader &cdnsr, int system_index);
276
277template <typename Tcalc>
278Tcalc angle(int atom_i, int atom_j, int atom_k, const Condensate *cdns, int system_index);
279
280template <typename Tcalc>
281Tcalc angle(int atom_i, int atom_j, int atom_k, const Condensate &cdns, int system_index);
282
283template <typename Tcalc>
284Tcalc angle(int atom_i, int atom_j, int atom_k, const PsSynthesisReader &poly_psr,
285 int system_index);
286
287template <typename Tcalc>
288Tcalc angle(int atom_i, int atom_j, int atom_k, const PhaseSpaceSynthesis *poly_ps,
289 int system_index);
290
291template <typename Tcalc>
292Tcalc angle(int atom_i, int atom_j, int atom_k, const PhaseSpaceSynthesis &poly_ps,
293 int system_index);
295
308template <typename Tcoord, typename Tcalc>
309Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l, const Tcoord* xcrd,
310 const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
311 const double* invu, UnitCellType unit_cell, Tcalc gpos_scale_factor = 1.0,
312 const int* xcrd_ovrf = nullptr, const int* ycrd_ovrf = nullptr,
313 const int* zcrd_ovrf = nullptr);
314
315double dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l,
316 const CoordinateFrameReader &cfr);
317
318double dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l, const CoordinateFrame *cf);
319
320double dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l, const CoordinateFrame &cf);
321
322double dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l, const PhaseSpaceReader &cfr);
323
324double dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l, const PhaseSpace *ps);
325
326double dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l, const PhaseSpace &ps);
327
328template <typename Tcoord, typename Tcalc>
329Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l,
330 const CoordinateSeriesReader<Tcoord> &csr, size_t frame_index);
331
332template <typename Tcoord, typename Tcalc>
333Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l,
334 const CoordinateSeries<Tcoord> *cs, size_t frame_index);
335
336template <typename Tcoord, typename Tcalc>
337Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l,
338 const CoordinateSeries<Tcoord> &cs, size_t frame_index);
339
340template <typename Tcalc>
341Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l, const CondensateReader &cdnsr,
342 int system_index);
343
344template <typename Tcalc>
345Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l, const Condensate *cdns,
346 int system_index);
347
348template <typename Tcalc>
349Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l, const Condensate &cdns,
350 int system_index);
351
352template <typename Tcalc>
353Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l,
354 const PsSynthesisReader &poly_psr, int system_index);
355
356template <typename Tcalc>
357Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l,
358 const PhaseSpaceSynthesis *poly_ps, int system_index);
359
360template <typename Tcalc>
361Tcalc dihedralAngle(int atom_i, int atom_j, int atom_k, int atom_l,
362 const PhaseSpaceSynthesis &poly_ps, int system_index);
364
365} // namespace structure
366} // namespace stormm
367
368#include "local_arrangement.tpp"
369
370#endif
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
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
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
Read-only abstract for the Condensate class. In most cases, the read-only abstract will be preferred ...
Definition condensate.h:102
Writeable abstract for the Condensate class, wherein coordinates (only) can be modified as a conseque...
Definition condensate.h:64
The reader for a PhaseSpaceSynthesis object, containing all of the data relevant for propagating dyna...
Definition phasespace_synthesis.h:199
The writer for a PhaseSpaceSynthesis object, containing all of the data relevant for propagating dyna...
Definition phasespace_synthesis.h:87
Collect C-style pointers for the elements of a read-only CoordinateFrame object.
Definition coordinateframe.h:65
Collect C-style pointers for the elements of a writable CoordinateFrame object.
Definition coordinateframe.h:30
Collect C-style pointers and critical constants for a read-only CoordinateSeries object.
Definition coordinate_series.h:96
Collect C-style pointers and critical constants for a writeable CoordinateSeries object.
Definition coordinate_series.h:66
Collect constants and pointers to the components of a read-only PhaseSpace object.
Definition phasespace.h:81
Collect constants and pointers to the components of a modifiable PhaseSpace object.
Definition phasespace.h:31