2#ifndef STORMM_CONDENSATE_H
3#define STORMM_CONDENSATE_H
9#include "Accelerator/gpu_details.h"
10#include "Accelerator/hybrid.h"
11#include "Accelerator/hybrid_util.h"
12#include "Constants/behavior.h"
13#include "Constants/hpc_bounds.h"
14#include "DataTypes/common_types.h"
15#include "Math/rounding.h"
16#include "Math/series_ops.h"
17#include "Topology/atomgraph_abstracts.h"
18#include "Trajectory/coordinateframe.h"
19#include "Trajectory/coordinate_series.h"
20#include "phasespace_synthesis.h"
21#include "synthesis_enumerators.h"
26using card::default_hpc_format;
27using card::GpuDetails;
29using card::HybridFormat;
30using card::HybridTargetLevel;
31using constants::CartesianDimension;
32using constants::PrecisionModel;
33using stmath::incrementingSeries;
35using topology::UnitCellType;
36using trajectory::CoordinateFrame;
37using trajectory::CoordinateSeries;
38using trajectory::CoordinateSeriesReader;
47 CondensateBorders(
int system_count_in,
const size_t* atom_starts_in,
const int* atom_counts_in);
67 CondensateWriter(PrecisionModel mode_in, StructureSource basis_in,
int system_count_in,
68 UnitCellType unit_cell_in,
const size_t* atom_starts_in,
70 double*
xcrd,
double*
ycrd,
double*
zcrd,
double* umat_in,
double* invu_in,
107 CondensateReader(PrecisionModel mode_in, StructureSource basis_in,
int system_count_in,
108 UnitCellType unit_cell_in,
const size_t* atom_starts_in,
109 const int* atom_counts_in,
const float*
xcrd_sp,
const float*
ycrd_sp,
111 const double*
zcrd,
const double* umat_in,
const double* invu_in,
112 const double* boxdim_in);
158 Condensate(HybridFormat format_in = default_hpc_format);
161 const GpuDetails &gpu = null_gpu);
164 const GpuDetails &gpu = null_gpu);
166 template <
typename T>
168 const GpuDetails &gpu = null_gpu);
170 template <
typename T>
172 const GpuDetails &gpu = null_gpu);
193 PrecisionModel
getMode()
const;
220 template <
typename T>
231 HybridTargetLevel tier = HybridTargetLevel::HOST)
const;
240 HybridTargetLevel tier = HybridTargetLevel::HOST)
const;
295 void launchCondensateUpdate(
const GpuDetails &gpu);
308 PrecisionModel mode_in = PrecisionModel::SINGLE,
const GpuDetails &gpu = null_gpu);
311 PrecisionModel mode_in = PrecisionModel::SINGLE,
const GpuDetails &gpu = null_gpu);
313 template <
typename T>
315 const PrecisionModel mode_in = PrecisionModel::SINGLE,
330 void update(HybridTargetLevel tier = HybridTargetLevel::HOST,
const GpuDetails &gpu = null_gpu);
332 template <
typename T>
334 HybridTargetLevel tier = HybridTargetLevel::HOST,
const GpuDetails &gpu = null_gpu);
336 template <
typename T>
338 HybridTargetLevel tier = HybridTargetLevel::HOST,
const GpuDetails &gpu = null_gpu);
346 StructureSource basis;
349 UnitCellType unit_cell;
357 size_t csptr_data_type;
402 void repairPointers();
407 void validateSystemIndex(
int index)
const;
411static const size_t condensate_type_index = std::type_index(
typeid(
Condensate)).hash_code();
416#include "condensate.tpp"
421using synthesis::condensate_type_index;
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
Condensate(HybridFormat format_in=default_hpc_format)
Definition condensate.cpp:55
Condense the data format, and possibly offer a reduced representation of coordinates,...
Definition condensate.h:146
const CondensateBorders borders(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the read-only summary of the system sizes. The data is never needed in as a collection of device ...
Definition condensate.cpp:466
const Condensate * getSelfPointer() const
Get a pointer to the original object, useful if a pointer is needed but the object was passed into a ...
Definition condensate.cpp:439
std::vector< double > getInterlacedCoordinates(int system_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const
Produce the interlaced coordinates of a specific system. As is the case with other coordinate objects...
Definition condensate.cpp:365
void rebuild(const PhaseSpaceSynthesis *poly_ps_in, PrecisionModel mode_in=PrecisionModel::SINGLE, const GpuDetails &gpu=null_gpu)
Rebuild the object using a different PhaseSpaceSynthesis or CoordinateSeries, and possibly a new comp...
Definition condensate.cpp:528
size_t getAtomOffset(int system_index) const
Get the starting index of atoms for one of the systems, using its index.
Definition condensate.cpp:243
int getAtomCount(int system_index) const
Get the number of atoms in one of the systems, using its index.
Definition condensate.cpp:248
const CoordinateSeries< T > * getSeriesPointer() const
Get a const pointer to the original coordinate series. The developer must supply the template type fo...
size_t getCoordinateSeriesTypeID() const
Get the data type of the CoordinateSeries upon which this object is based.
Definition condensate.cpp:253
Condensate(HybridFormat format_in=default_hpc_format)
Definition condensate.cpp:55
bool ownsCoordinates() const
Get an indication of whether the Condensate keeps its own copy of the coordinates.
Definition condensate.cpp:238
void update(HybridTargetLevel tier=HybridTargetLevel::HOST, const GpuDetails &gpu=null_gpu)
Reload the coordinates based on an updated coordinate synthesis or series, without re-computing the b...
Definition condensate.cpp:625
PrecisionModel getMode() const
Get the compression mode.
Definition condensate.cpp:223
const CondensateReader data(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the appropriate abstract based on the const-ness of the object.
Definition condensate.cpp:444
CoordinateFrame exportCoordinateFrame(int system_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const
Export a single frame as double-precision coordinates.
Definition condensate.cpp:263
const PhaseSpaceSynthesis * getSynthesisPointer() const
Get a const pointer to the original coordinate synthesis.
Definition condensate.cpp:258
HybridFormat getFormat() const
Get the memory layout of the object.
Definition condensate.cpp:218
int getSystemCount() const
Get the number of systems found in the condensate.
Definition condensate.cpp:233
StructureSource getBasis() const
Get the basis for the coordinates in the object: synthesis or series.
Definition condensate.cpp:228
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
const double * ycrd
Double-precision Cartesian Y coordinates.
Definition condensate.h:136
const double * zcrd
Double-precision Cartesian Z coordinates.
Definition condensate.h:137
const float * xcrd_sp
Single-precision Cartesian X coordinates.
Definition condensate.h:132
const float * zcrd_sp
Single-precision Cartesian Z coordinates.
Definition condensate.h:134
CondensateReader(PrecisionModel mode_in, StructureSource basis_in, int system_count_in, UnitCellType unit_cell_in, const size_t *atom_starts_in, const int *atom_counts_in, const float *xcrd_sp, const float *ycrd_sp, const float *zcrd_sp, const double *xcrd, const double *ycrd, const double *zcrd, const double *umat_in, const double *invu_in, const double *boxdim_in)
The constructor takes a straight list of all relevant constants and pointers. One overloaded form acc...
Definition condensate.cpp:32
const float * ycrd_sp
Single-precision Cartesian Y coordinates.
Definition condensate.h:133
const double * xcrd
Double-precision Cartesian X coordinates.
Definition condensate.h:135
float * zcrd_sp
Single-precision Cartesian Z coordinates.
Definition condensate.h:90
double * ycrd
Double-precision Cartesian Y coordinates.
Definition condensate.h:92
double * xcrd
Double-precision Cartesian X coordinates.
Definition condensate.h:91
float * ycrd_sp
Single-precision Cartesian Y coordinates.
Definition condensate.h:89
float * xcrd_sp
Single-precision Cartesian X coordinates.
Definition condensate.h:88
double * zcrd
Double-precision Cartesian Z coordinates.
Definition condensate.h:93
CondensateWriter(PrecisionModel mode_in, StructureSource basis_in, int system_count_in, UnitCellType unit_cell_in, const size_t *atom_starts_in, const int *atom_counts_in, float *xcrd_sp, float *ycrd_sp, float *zcrd_sp, double *xcrd, double *ycrd, double *zcrd, double *umat_in, double *invu_in, double *boxdim_in)
The constructor takes a straight list of all relevant constants and pointers.
Definition condensate.cpp:19
A read-only abstract for the system demarcations in the object. This information is sometimes critica...
Definition condensate.h:43
const size_t * atom_starts
Starting indices for the atoms of each system.
Definition condensate.h:58
CondensateBorders(int system_count_in, const size_t *atom_starts_in, const int *atom_counts_in)
The constructor accepts the total number of systems as well as pointers to the number of atoms and st...
Definition condensate.cpp:13
const int system_count
Definition condensate.h:56
CondensateBorders(const CondensateBorders &original)=default
Copy and move constructors–as with any object containing const members, the move assignment operator ...
const int * atom_counts
Atom counts for each system.
Definition condensate.h:59
Read-only abstract for the Condensate class. In most cases, the read-only abstract will be preferred ...
Definition condensate.h:102
const double * ycrd
Double-precision Cartesian Y coordinates.
Definition condensate.h:136
const double * zcrd
Double-precision Cartesian Z coordinates.
Definition condensate.h:137
const double * invu
Inverse box transform information for all systems.
Definition condensate.h:139
const UnitCellType unit_cell
The type of unit cell, common to all systems.
Definition condensate.h:129
const size_t * atom_starts
Starting indices of each system's atoms in the data arrays.
Definition condensate.h:130
const double * boxdims
Box dimensions for all systems.
Definition condensate.h:140
const float * xcrd_sp
Single-precision Cartesian X coordinates.
Definition condensate.h:132
const StructureSource basis
The original material on which the original object is based.
Definition condensate.h:127
const float * zcrd_sp
Single-precision Cartesian Z coordinates.
Definition condensate.h:134
CondensateReader(PrecisionModel mode_in, StructureSource basis_in, int system_count_in, UnitCellType unit_cell_in, const size_t *atom_starts_in, const int *atom_counts_in, const float *xcrd_sp, const float *ycrd_sp, const float *zcrd_sp, const double *xcrd, const double *ycrd, const double *zcrd, const double *umat_in, const double *invu_in, const double *boxdim_in)
The constructor takes a straight list of all relevant constants and pointers. One overloaded form acc...
Definition condensate.cpp:32
const float * ycrd_sp
Single-precision Cartesian Y coordinates.
Definition condensate.h:133
const double * xcrd
Double-precision Cartesian X coordinates.
Definition condensate.h:135
const double * umat
Box transform information for all systems.
Definition condensate.h:138
const int system_count
The number of systems held by the underlying Condensate.
Definition condensate.h:128
const PrecisionModel mode
The compression mode.
Definition condensate.h:126
CondensateReader(const CondensateReader &original)=default
The usual copy and move constructors aply for an abstract, with copy and move assignment operators be...
const int * atom_counts
Number of atoms in each system.
Definition condensate.h:131
Writeable abstract for the Condensate class, wherein coordinates (only) can be modified as a conseque...
Definition condensate.h:64
float * zcrd_sp
Single-precision Cartesian Z coordinates.
Definition condensate.h:90
const int * atom_counts
Number of atoms in each system.
Definition condensate.h:87
double * ycrd
Double-precision Cartesian Y coordinates.
Definition condensate.h:92
double * xcrd
Double-precision Cartesian X coordinates.
Definition condensate.h:91
float * ycrd_sp
Single-precision Cartesian Y coordinates.
Definition condensate.h:89
float * xcrd_sp
Single-precision Cartesian X coordinates.
Definition condensate.h:88
double * zcrd
Double-precision Cartesian Z coordinates.
Definition condensate.h:93
CondensateWriter(const CondensateWriter &original)=default
The usual copy and move constructors aply for an abstract, with copy and move assignment operators be...
const int system_count
The number of systems held by the underlying Condensate.
Definition condensate.h:84
double * invu
Inverse box transform information for all systems.
Definition condensate.h:95
const UnitCellType unit_cell
The type of unit cell, common to all systems.
Definition condensate.h:85
double * boxdims
Box dimensions for all systems.
Definition condensate.h:96
const StructureSource basis
The original material on which the original object is based.
Definition condensate.h:83
const size_t * atom_starts
Starting indices of each system's atoms in the data arrays.
Definition condensate.h:86
CondensateWriter(PrecisionModel mode_in, StructureSource basis_in, int system_count_in, UnitCellType unit_cell_in, const size_t *atom_starts_in, const int *atom_counts_in, float *xcrd_sp, float *ycrd_sp, float *zcrd_sp, double *xcrd, double *ycrd, double *zcrd, double *umat_in, double *invu_in, double *boxdim_in)
The constructor takes a straight list of all relevant constants and pointers.
Definition condensate.cpp:19
double * umat
Box transform information for all systems.
Definition condensate.h:94
const PrecisionModel mode
The compression mode.
Definition condensate.h:82