summaryrefslogtreecommitdiff
path: root/cad/src/experimental/NH1_Integration/HDF5_SimResults/lib/NE1_Simulation/SimResultsDataStore.py
blob: f5c29b5ce0818cb15f4452b6a5cf8d81c54dd218 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452

# Copyright 2007 Nanorex, Inc.  See LICENSE file for details.
"""
Encapsulates a simulation results data store.
The main class in this module is L{SimResultsDataStore}. The L{SimResultsBond}
class is really just a container for bond information.
"""


class SimResultsBond:
    """
    A chemical bond. See L{SimResultsDataStore} for context.
    """


    def __init__(self, atomId_1, atomId_2, order):
        """
        Constructs a SimResultsBond with the given atom identifiers and order.
        """
        self.atomId_1 = atomId_1
        self.atomId_2 = atomId_2
        self.order = order



class SimResultsDataStore:
    """
    Encapsulates a simulation results data store.

    B{Atom Records Alignment -}
    The arrays of atom identifiers, positions, and velocities within a given
    frame are aligned. So the contents at index X of all three arrays correspond
    to the same atom.

    B{Extension Data -}
    Extension data can be stored in each frame. Such data could be used to plot
    graphs, for example. Extension data exists as named floating point numbers,
    integers, floating point number arrays, and integer arrays inside a named
    data-set.
    """


    def openDataStore(self, directory):
        """
        Opens the simulation results data store, found in the given directory,
        for read/write access.
        @return: (0=successful or non-zero error code), (error description)
        """
        print 'directory=%s' % directory
        return 0


    def getNotes(self):
        """Returns the user's notes for these simulation results."""
        pass
    def setNotes(self, notes):
        """Sets the user's notes for these simulation results."""
        pass


    def getName(self):
        """Returns the simulation name."""
        pass
    def setName(self, name):
        """Sets the simulation name."""
        pass


    def getDescription(self):
        """Returns the simulation description."""
        pass
    def setDescription(self, description):
        """Sets the simulation description."""
        pass


    def getTimestep(self):
        """Returns the simulation timestep in seconds."""
        pass
    def setTimestep(self, timestep):
        """
        Sets the simulation timestep.
        @param timestep: duration in seconds
        """
        pass


    def getStartStep(self):
        """Returns the simulation starting step number."""
        pass
    def setStartStep(self, startStep):
        """Sets the simulation starting step number."""
        pass


    def getMaxSteps(self):
        """Returns the maximum number of steps to simulate."""
        pass
    def setMaxSteps(self, maxSteps):
        """Sets the maximum number of steps to simulate."""
        pass


    def getStepsPerFrame(self):
        """Returns the number of steps per frame."""
        pass
    def setStepsPerFrame(self, stepsPerFrame):
        """Sets the number of steps per frame."""
        pass


    def getEnvironmentTemperature(self):
        """Returns the simulation environment temperature in Kelvin."""
        pass
    def setEnvironmentTemperature(self, temperature):
        """
        Sets the simulation environment temperature.
        @param temperature: in Kelvin
        """
        pass


    def getEnvironmentPressure(self):
        """Returns the simulation environment pressure in Pascals."""
        pass
    def setEnvironmentPressure(self, pressure):
        """
        Sets the simulation environment pressure.
        @param pressure: in Pascals
        """
        pass


    def getFilePathKeys(self):
        """
        Returns an array of file path keys. These file paths are for simulation
        specification files, simulation workflow scripts, template files, etc.
        """
        pass
    def getFilePath(self, key):
        """Returns the file path associated with the given key."""
        pass
    def setFilePath(self, key, filePath):
        """Associates the given file path with the given key."""
        pass


    def getRunResult(self):
        """
        Returns the simulation run's result and failure message if the
        simulation failed.
        @return: (0=success, 1=still running, 2=failure, 3=aborted),
                 (failure message)
        """
        pass
    def setRunResult(self, code, message):
        """
        Sets the simulation run's result and failure message.
        @param code: 0=success, 1=still running, 2=failure, 3=aborted
        @param message: description of a simulation failure
        """
        pass


    def getStepCount(self):
        """Returns the number of steps successfully simulated."""
        pass
    def setStepCount(self, count):
        """Sets the number of steps successfully simulated."""
        pass


    def getStartTime(self):
        """
        Returns the simulation start time.
        @return: a U{datetime<http://docs.python.org/lib/datetime-datetime.html>}
                 object set to the simulation's start time
        """
        pass
    def setStartTime(self, startTime):
        """
        Sets the simulation start time.
        @param startTime: a U{datetime<http://docs.python.org/lib/datetime-datetime.html>}
                          object set to the simulation's start time
        """
        pass


    def getCPU_RunningTime(self):
        """Returns the simulation CPU running time in seconds."""
        pass
    def setCPU_RunningTime(self, cpuRunningTime):
        """
        Set the simulation CPU running time.
        @param cpuRunningTime: in seconds
        """
        pass


    def getWallRunningTime(self):
        """Returns the simulation wall running time in seconds."""
        pass
    def setWallRunningTime(self, wallRunningTime):
        """
        Sets the simulation wall running time.
        @param wallRunningTime: in seconds
        """
        pass


    def getExtDataNames(self):
        """Returns an array of extension data-set names."""
        pass
    def getExtDataKeys(self, extDataSetName):
        """
        Returns an array of extension data-set keys for a given extension
        data-set.
        """
        pass
    def getExtDataFloat(self, extDataSetName, key):
        """
        Returns a floating point value stored in the extension data-set with the
        given key.
        """
        pass
    def getExtDataInt(self, extDataSetName, key):
        """
        Returns an integer value stored in the extension data-set with the
        given key.
        """
        pass
    def getExtDataFloatArray(self, extDataSetName, key):
        """
        Returns an array of floating point values stored in the extension
        data-set with the given key.
        """
        pass
    def getExtDataIntArray(self, extDataSetName, key):
        """
        Returns an array of integers stored in the extension data-set with the
        given key.
        """
        pass
    def setExtDataFloat(self, extDataSetName, key, value):
        """
        Sets a floating point value stored in the extension data-set with the
        given key.
        """
        pass
    def setExtDataInt(self, extDataSetName, key, value):
        """
        Sets an integer value stored in the extension data-set with the
        given key.
        """
        pass
    def setExtDataFloatArray(self, extDataSetName, key, floatArray):
        """
        Sets an array of floating point values stored in the extension data-set
        with the given key.
        """
        pass
    def setExtDataIntArray(self, extDataSetName, key, intArray):
        """
        Sets an array of integers stored in the extension data-set
        with the given key.
        """
        pass


    def getFrameSetNames(self):
        """
        Returns an array of frame-set names. These frame-set names are used to
        get/set frame data.
        """
        pass
    def addFrameSet(self, name, aggregationMode):
        """
        Adds a frame-set with the given name and aggregation mode.
        @param aggregationMode: 0=per-time-step values are averaged (default),
                                1=last per-time-step value is used
        """
        pass
    def removeFrameSet(self, name):
        """Removes the frame-set with the given name."""
        pass


    def getFrameCount(self, frameSetName):
        """Returns the number of frames in a frame-set."""
        pass
    def getFrameTimes(self, frameSetName):
        """Returns an array of frame times (in seconds) for a frame-set."""
        pass
    def getFrameTime(self, frameSetName, frameIndex):
        """Returns a specific frame time (in seconds) for a frame-set."""
        pass
    def addFrame(self, frameSetName, time):
        """
        Adds a frame to the specified frame-set.
        @param time: the frame's time in seconds
        """
        pass
    def removeFrame(self, frameSetName, frameIndex):
        """Removes a frame from the specified frame-set."""
        pass


    def getFrameAtomIds(self, frameSetName):
        """Returns an array of atom identifiers for a frame-set."""
        pass
    def setFrameAtomIds(self, frameSetName, atomIds):
        """Sets the array of atom identifiers for a frame-set."""
        pass


    def getFrameAtomPositions(self, frameSetName, frameIndex):
        """
        Returns an array of Cartesian atom positions for a specified frame. Each
        position is an array of length 3 corresponding to x, y, z coordinates in
        meters.
        """
        pass
    def setFrameAtomPositions(self, frameSetName, frameIndex, positions):
        """
        Sets the array of Cartesian atom positions for a specified frame.
        @param positions: an array of arrays of length 3 corresponding to
                          x, y, z coordinates for each atom in meters
        """
        pass


    def getFrameAtomVelocities(self, frameSetName, frameIndex):
        """
        Returns an array of atom velocities for a specified frame. Each velocity
        is an array of length 3 corresponding to the x, y, z components of the
        atom's velocity in m/s.
        """
        pass
    def setFrameAtomVelocities(self, frameSetName, frameIndex, velocities):
        """
        Sets the array of atom velocities for a specified frame.
        @param velocities: an array of arrays of length 3 corresponding to the
                           x, y, z components for each atom's velocity in m/s
        """
        pass


    def getFrameBonds(self, frameSetName, frameIndex):
        """Returns an array of SimResultsBond objects for a specified frame."""
        pass
    def setFrameBonds(self, frameSetName, frameIndex, bonds):
        """Sets the array of SimResultsBond objects for a specified frame."""
        pass


    def getFrameTotalEnergy(self, frameSetName, frameIndex):
        """Returns the total energy for the specified frame in Joules."""
        pass
    def setFrameTotalEnergy(self, frameSetName, frameIndex, totalEnergy):
        """
        Sets the total energy for the specified frame.
        @param totalEnergy: in Joules
        """
        pass


    def getFrameIdealTemperature(self, frameSetName, frameIndex):
        """Returns the ideal temperature for the specified frame in Kelvin."""
        pass
    def setFrameIdealTemperature(self, frameSetName, frameIndex, temperature):
        """
        Sets the ideal temperature for the specified frame.
        @param temperature: in Kelvin
        """
        pass


    def getFramePressure(self, frameSetName, frameIndex):
        """Returns the pressure for the specified frame in Pascals."""
        pass
    def setFramePressure(self, frameSetName, frameIndex, pressure):
        """
        Sets the pressure for the specified frame.
        @param pressure: in Pascals
        """
        pass


    def getFrameExtDataNames(self, frameSetName):
        """Returns an array of extension data-set names for a given frame-set."""
        pass
    def getFrameExtDataKeys(self, frameSetName, extDataSetName):
        """
        Returns an array of extension data-set keys for a given extension
        data-set.
        """
        pass
    def getFrameExtDataFloat(self, frameSetName, frameIndex, extDataSetName,
                             key):
        """
        Returns a floating point value stored in the specified frame for the
        given key.
        """
        pass
    def getFrameExtDataInt(self, frameSetName, frameIndex, extDataSetName, key):
        """
        Returns an integer value stored in the specified frame for the given
        key.
        """
        pass
    def getFrameExtDataFloatArray(self, frameSetName, frameIndex,
                                  extDataSetName, key):
        """
        Returns an array of floating point values stored in the specified frame
        for the given key.
        """
        pass
    def getFrameExtDataIntArray(self, frameSetName, frameIndex, extDataSetName,
                                key):
        """
        Returns an array of integers stored in the specified frame for the given
        key.
        """
        pass
    def setFrameExtDataFloat(self, frameSetName, frameIndex, extDataSetName,
                             key, value):
        """
        Sets a floating point value stored in the specified frame for the given
        key.
        """
        pass
    def setFrameExtDataInt(self, frameSetName, frameIndex, extDataSetName, key,
                           value):
        """
        Sets an integer value stored in the specified frame for the given
        key.
        """
        pass
    def setFrameExtDataFloatArray(self, frameSetName, frameIndex,
                                  extDataSetName, key, floatArray):
        """
        Sets an array of floating point values stored in the specified
        frame for the given key.
        """
        pass
    def setFrameExtDataIntArray(self, frameSetName, frameIndex, extDataSetName,
                                key, intArray):
        """
        Sets an array of integers stored in the specified frame for the given
        key.
        """
        pass