23 #include "openPMD/IterationEncoding.hpp"
24 #include "openPMD/Mesh.hpp"
25 #include "openPMD/ParticleSpecies.hpp"
26 #include "openPMD/Streaming.hpp"
27 #include "openPMD/auxiliary/Variant.hpp"
28 #include "openPMD/backend/Attributable.hpp"
29 #include "openPMD/backend/Container.hpp"
79 bool beginStep =
false;
128 template <
typename T,
typename T_key,
typename T_container>
138 using IterationIndex_t = uint64_t;
145 template <
typename T>
154 template <
typename T>
162 template <
typename T>
171 template <
typename T>
236 [[deprecated(
"This attribute is no longer set by the openPMD-api.")]]
bool
248 std::shared_ptr<Data_t> m_iterationData;
250 inline Data_t const &get()
const
252 return *m_iterationData;
257 return *m_iterationData;
260 inline void setData(std::shared_ptr<Data_t> data)
262 m_iterationData = std::move(data);
263 Attributable::setData(m_iterationData);
291 void reread(std::string
const &path);
293 std::string
const &filePath,
294 std::string
const &groupPath,
296 void readGorVBased(std::string
const &groupPath,
bool beginStep);
297 void read_impl(std::string
const &groupPath);
298 void readMeshes(std::string
const &meshesPath);
299 void readParticles(std::string
const &particlesPath);
306 struct BeginStepStatus
308 using AvailableIterations_t = std::optional<std::deque<uint64_t> >;
315 AvailableIterations_t iterationsInOpenedStep;
329 inline operator std::tuple<AdvanceStatus &, AvailableIterations_t &>()
331 return std::tuple<AdvanceStatus &, AvailableIterations_t &>{
332 stepStatus, iterationsInOpenedStep};
343 BeginStepStatus beginStep(
bool reread);
350 static BeginStepStatus beginStep(
351 std::optional<Iteration> thisObject,
354 std::set<IterationIndex_t>
const &ignoreIterations = {});
388 virtual void linkHierarchy(
Writable &w);
395 void runDeferredParseAccess();
398 extern template float Iteration::time<float>()
const;
400 extern template double Iteration::time<double>()
const;
402 extern template long double Iteration::time<long double>()
const;
404 template <
typename T>
407 return this->readFloatingpoint<T>(
"time");
410 extern template float Iteration::dt<float>()
const;
412 extern template double Iteration::dt<double>()
const;
414 extern template long double Iteration::dt<long double>()
const;
416 template <
typename T>
419 return this->readFloatingpoint<T>(
"dt");
432 using index_t = Iteration::IterationIndex_t;
433 index_t
const iterationIndex;
436 template <
typename Iteration_t>
438 :
Iteration(std::forward<Iteration_t>(it)), iterationIndex(index)
Layer to manage storage of attributes associated with file objects.
Definition: Attributable.hpp:101
Map-like container that enforces openPMD requirements and handles IO.
Definition: Container.hpp:104
Subclass of Iteration that knows its own index withing the containing Series.
Definition: Iteration.hpp:427
Logical compilation of data from one snapshot (e.g.
Definition: Iteration.hpp:127
Iteration & setTimeUnitSI(double newTimeUnitSI)
Set the conversion factor to convert time and dt to seconds.
Definition: Iteration.cpp:77
double timeUnitSI() const
Definition: Iteration.cpp:72
Iteration & setTime(T newTime)
Set the global reference time for this iteration.
Definition: Iteration.cpp:51
bool closedByWriter() const
Has the iteration been closed by the writer? Background: Upon calling Iteration::close(),...
Definition: Iteration.cpp:183
T time() const
Definition: Iteration.hpp:405
bool closed() const
Has the iteration been closed? A closed iteration may not (yet) be reopened.
Definition: Iteration.cpp:163
T dt() const
Definition: Iteration.hpp:417
Iteration & open()
Open an iteration.
Definition: Iteration.cpp:147
Iteration & close(bool flush=true)
Close an iteration.
Definition: Iteration.cpp:85
Iteration & setDt(T newDt)
Set the time step used to reach this iteration.
Definition: Iteration.cpp:62
Implementation for the root level of the openPMD hierarchy.
Definition: Series.hpp:219
Definition: ReadIterations.hpp:35
Layer to mirror structure of logical data and persistent data in file.
Definition: Writable.hpp:75
Writing side of the streaming API.
Definition: WriteIterations.hpp:67
Definition: Attributable.hpp:57
Definition: Iteration.hpp:83
StepStatus m_stepStatus
Whether a step is currently active for this iteration.
Definition: Iteration.hpp:103
std::optional< DeferredParseAccess > m_deferredParseAccess
Information on a parsing request that has not yet been executed.
Definition: Iteration.hpp:109
std::optional< std::string > m_overrideFilebasedFilename
Upon reading a file, set this field to the used file name.
Definition: Iteration.hpp:117
CloseStatus
Whether an iteration has been closed yet.
Definition: Iteration.hpp:46
@ ParseAccessDeferred
The reader has not yet parsed this iteration.
@ Open
Iteration has not been closed.
Public definitions of openPMD-api.
Definition: Date.cpp:29
StepStatus
Used in step-based mode (i.e.
Definition: Streaming.hpp:46
AdvanceStatus
In step-based mode (i.e.
Definition: Streaming.hpp:21
Definition: Iteration.hpp:58
std::string filename
If fileBased == true, the file name (without file path) of the file containing this iteration.
Definition: Iteration.hpp:78
uint64_t iteration
The iteration index as accessed by the user in series.iterations[i].
Definition: Iteration.hpp:68
std::string path
The group path within /data containing this iteration.
Definition: Iteration.hpp:64
bool fileBased
If this iteration is part of a Series with file-based layout.
Definition: Iteration.hpp:73
Parameters recursively passed through the openPMD hierarchy when flushing.
Definition: AbstractIOHandler.hpp:86