2#ifndef STORMM_BINARY_ENCODING_H
3#define STORMM_BINARY_ENCODING_H
9#include "DataTypes/common_types.h"
10#include "DataTypes/stormm_vector_types.h"
11#include "Synthesis/phasespace_synthesis.h"
12#include "Trajectory/coordinateframe.h"
13#include "Trajectory/coordinate_series.h"
14#include "Trajectory/phasespace.h"
20using card::HybridTargetLevel;
21using synthesis::PhaseSpaceSynthesis;
22using trajectory::CoordinateFrame;
23using trajectory::CoordinateFrameReader;
24using trajectory::CoordinateSeries;
25using trajectory::PhaseSpace;
29const char default_binary_file_descriptor[] =
"No description provided";
30const char default_cf_descriptor[] =
"CoordinateFrame with positions";
31const char default_ps_descriptor[] =
"PhaseSpace with positions and velocities";
32const char default_cs_descriptor[] =
"CoordinateSeries with positions";
33const char default_polyps_descriptor[] =
"PhaseSpaceSynthesis with positions";
53 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
55 BinaryFileContent(
size_t ct_vptr_in,
size_t length_in,
const void* vptr_in,
bool repeating_in,
56 const std::string &description_in,
57 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
91 std::string description;
94 HybridTargetLevel tier;
125 BinaryFileKey(
const std::string &description_in = std::string(
""));
127 template <
typename T>
BinaryFileKey(
const T* content,
size_t length,
128 const std::string &description_in = std::string(
""),
129 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
131 template <
typename T>
BinaryFileKey(
const std::vector<T> *content,
132 const std::string &description_in = std::string(
""));
134 template <
typename T>
BinaryFileKey(
const std::vector<T> &content,
135 const std::string &description_in = std::string(
""));
138 const std::string &description_in = std::string(
""),
139 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
142 const std::string &description_in = std::string(
""),
143 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
146 const std::string &description_in = std::string(default_cf_descriptor),
147 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
150 const std::string &description_in = std::string(default_cf_descriptor),
151 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
154 const std::string &description_in = std::string(default_ps_descriptor),
155 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
158 const std::string &description_in = std::string(default_ps_descriptor),
159 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
161 template <
typename T>
163 const std::string &description_in = std::string(default_cs_descriptor),
164 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
166 template <
typename T>
168 const std::string &description_in = std::string(default_cs_descriptor),
169 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
172 const std::string &description_in = std::string(default_polyps_descriptor),
173 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
176 const std::string &description_in = std::string(default_polyps_descriptor),
177 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
189 void addArray(
const void *vptr,
size_t length,
size_t ct_vptr,
bool repeating_in,
190 const std::string &description_in = std::string(
""),
191 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
193 template <
typename T>
194 void addArray(
const T* content,
size_t length,
bool repeating_in,
195 const std::string &description_in,
196 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
198 template <
typename T>
199 void addArray(
const std::vector<T> *content,
bool repeating_in,
200 const std::string &description_in = std::string(
""));
202 template <
typename T>
203 void addArray(
const std::vector<T> &content,
bool repeating_in,
204 const std::string &description_in = std::string(
""));
206 template <
typename T>
208 const std::string &description_in = std::string(
""),
209 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
211 template <
typename T>
213 const std::string &description_in = std::string(
""),
214 HybridTargetLevel tier_in = HybridTargetLevel::HOST);
227 const std::string &description_in = std::string(
""));
233 const std::string &description_in = std::string(
""));
238 const std::string &description_in = std::string(
""));
243 const std::string &description_in = std::string(
""));
246 std::string description;
250 std::vector<char> tiers;
261 std::vector<BinaryFileContent> singleton_items;
264 std::vector<BinaryFileContent> array_items;
275 size_t nonrepeating_bytes;
277 llint total_expected_bytes;
283 llint total_written_bytes;
290 llint content_checksum;
295 TrajectoryCompression packed_format;
301char codifyHybridTargetLevel(HybridTargetLevel tier);
314uint16_t codifyTypeIndex(
size_t ct,
bool is_array,
bool is_repeatable);
319#include "binary_encoding.tpp"
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
BinaryFileContent(T content_in, bool repeating_in, const std::string description_in, HybridTargetLevel tier_in=HybridTargetLevel::HOST)
The constructor requires the type of data, its length, some way to make a pointer to the data itself,...
void setUpperBound(llint upper_bound_in)
Set the upper bound of memory for this content within a binary file.
Definition binary_encoding.cpp:23
void setLowerBound(llint lower_bound_in)
Set the lower bound of memory for this content within a binary file.
Definition binary_encoding.cpp:18
void addTuple2(T2 parm, const std::string &description_in=std::string(""))
Add a two-component tuple to the table of contents. Descriptions of input parameters follow from addS...
void addTuple4(T4 parm, const std::string &description_in=std::string(""))
Add a four-component tuple to the table of contents. Descriptions of input parameters follow from add...
void addArray(const void *vptr, size_t length, size_t ct_vptr, bool repeating_in, const std::string &description_in=std::string(""), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
Add a new array to the current table of contents. The array will be appended by default,...
Definition binary_encoding.cpp:308
void addTuple3(T3 parm, const std::string &description_in=std::string(""))
Add a three-component tuple to the table of contents. Descriptions of input parameters follow from ad...
void addScalar(T parm, const std::string &description_in=std::string(""))
Add a critical scalar constant to the table of contents. Every added array gets its own sizing consta...
BinaryFileKey(const std::string &description_in=std::string(""))
The constructor can take one or more arrays as well as specific objects, for convenience.
Definition binary_encoding.cpp:28
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