OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Astra1DDynamic_fast.h
Go to the documentation of this file.
1//
2// Class Astra1DDynamic_fast
3//
4// This class provides a reader for Astra style field maps. It pre-computes the field
5// on a lattice to increase the performance during simulation.
6//
7// Copyright (c) 2016, Christof Metzger-Kraus, Helmholtz-Zentrum Berlin, Germany
8// 2017 - 2020 Christof Metzger-Kraus
9//
10// All rights reserved
11//
12// This file is part of OPAL.
13//
14// OPAL is free software: you can redistribute it and/or modify
15// it under the terms of the GNU General Public License as published by
16// the Free Software Foundation, either version 3 of the License, or
17// (at your option) any later version.
18//
19// You should have received a copy of the GNU General Public License
20// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
21//
22#ifndef CLASSIC_AstraFIELDMAP1DDYNAMICFAST_HH
23#define CLASSIC_AstraFIELDMAP1DDYNAMICFAST_HH
24
25#include "Fields/Astra1D_fast.h"
26
28
29public:
30 virtual ~_Astra1DDynamic_fast();
31
32 virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const;
33 virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const;
34 virtual void getFieldDimensions(double &zBegin, double &zEnd) const;
35 virtual void getFieldDimensions(double &xIni, double &xFinal, double &yIni, double &yFinal, double &zIni, double &zFinal) const;
36 virtual void swap();
37 virtual void getInfo(Inform *);
38 virtual double getFrequency() const;
39 virtual void setFrequency(double freq);
40 virtual void getOnaxisEz(std::vector<std::pair<double, double> > & F);
41
42private:
43 _Astra1DDynamic_fast(const std::string& filename);
44
45 static Astra1DDynamic_fast create(const std::string& filename);
46
47 virtual void readMap();
48
49 bool readFileHeader(std::ifstream &file);
50 int stripFileHeader(std::ifstream &file);
51
53 double xlrep_m;
54
55 friend class _Fieldmap;
56};
57
58using Astra1DDynamic_fast = std::shared_ptr<_Astra1DDynamic_fast>;
59#endif
std::shared_ptr< _Astra1DDynamic_fast > Astra1DDynamic_fast
DiffDirection
Definition Fieldmap.h:55
_Astra1D_fast(const std::string &filename)
virtual void setFrequency(double freq)
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
virtual void getInfo(Inform *)
int stripFileHeader(std::ifstream &file)
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
_Astra1DDynamic_fast(const std::string &filename)
bool readFileHeader(std::ifstream &file)
static Astra1DDynamic_fast create(const std::string &filename)
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
virtual double getFrequency() const
Vektor< double, 3 > Vector_t