OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
H5Writer.h
Go to the documentation of this file.
1//
2// Class H5Writer
3// Interface for H5 writers.
4//
5// Copyright (c) 2019-2020, Matthias Frey, Paul Scherrer Institut, Villigen PSI, Switzerland
6// All rights reserved
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18#ifndef OPAL_H5_WRITER_H
19#define OPAL_H5_WRITER_H
20
21#include "PartBunch/PartBunch.h"
22#include "H5hut.h"
24
25class H5Writer {
26public:
27 H5Writer(H5PartWrapper* h5wrapper, bool restart);
28
29 void close();
30
31 void changeH5Wrapper(H5PartWrapper* h5wrapper);
32
34
35 double getLastPosition();
36
50
66 PartBunch_t* beam, Vector_t<double, 3> FDext[], double E, double refPr, double refPt,
67 double refPz, double refR, double refTheta, double refZ, double azimuth, double elevation,
68 bool local);
69
70private:
72 IpplTimings::TimerRef H5PartTimer_m;
73
75
78};
79
80inline void H5Writer::close() {
81 h5wrapper_m->close();
82}
83
85 h5wrapper_m = h5wrapper;
86}
87
89 h5wrapper_m->storeCavityInformation();
90}
91
93 return h5wrapper_m->getLastPosition();
94}
95
96#endif
PartBunch< PLayout_t< double, 3 >, double, 3 > PartBunch_t
ippl::Vector< T, Dim > Vector_t
void close()
Definition H5Writer.h:80
IpplTimings::TimerRef H5PartTimer_m
Timer to track particle data/H5 file write time.
Definition H5Writer.h:72
H5Writer(H5PartWrapper *h5wrapper, bool restart)
Definition H5Writer.cpp:20
void storeCavityInformation()
Definition H5Writer.h:88
H5PartWrapper * h5wrapper_m
Definition H5Writer.h:74
double getLastPosition()
Definition H5Writer.h:92
int H5call_m
Current record, or time step, of H5 file.
Definition H5Writer.h:77
void changeH5Wrapper(H5PartWrapper *h5wrapper)
Definition H5Writer.h:84
void writePhaseSpace(PartBunch_t *beam, Vector_t< double, 3 > FDext[])
Dumps Phase Space to H5 file.
Definition H5Writer.cpp:32