OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
DumpEMFields.h
Go to the documentation of this file.
1//
2// Class DumpEMFields
3// DumpEMFields dumps the dynamically changing fields of a Ring in a user-
4// defined grid.
5//
6// Copyright (c) 2017, Chris Rogers
7// All rights reserved
8//
9// This file is part of OPAL.
10//
11// OPAL is free software: you can redistribute it and/or modify
12// it under the terms of the GNU General Public License as published by
13// the Free Software Foundation, either version 3 of the License, or
14// (at your option) any later version.
15//
16// You should have received a copy of the GNU General Public License
17// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
18//
19#ifndef OPAL_BASICACTIONS_DUMPEMFIELDS_HH
20#define OPAL_BASICACTIONS_DUMPEMFIELDS_HH
21
24
25#include <string>
26#include <unordered_set>
27#include <vector>
28
29namespace interpolation {
30 class NDGrid;
31}
32class Component;
33
54class DumpEMFields: public Action {
55
56public:
58 enum {
80 };
81
84
86 DumpEMFields(const std::string& name, DumpEMFields* parent);
87
89 virtual ~DumpEMFields();
90
96 virtual DumpEMFields* clone(const std::string& name);
97
104 virtual void execute();
105
121 static void writeFields(Component* field);
122
124 void print(std::ostream& os) const;
125
126private:
127
128 enum class CoordinateSystem: unsigned short {
131 };
132
133 virtual void writeFieldThis(Component* field);
134 virtual void buildGrid();
136 void writeHeader(std::ofstream& fout) const;
137 void writeFieldLine(Component* field,
138 const Vector_t& point,
139 const double& time,
140 std::ofstream& fout) const;
141
143 std::string filename_m;
144
146
147 static std::unordered_set<DumpEMFields*> dumpsSet_m;
148
149 DumpEMFields(const DumpEMFields& dump); // disabled
150 DumpEMFields& operator=(const DumpEMFields& dump); // disabled
151};
152
153inline std::ostream& operator<<(std::ostream& os, const DumpEMFields& b) {
154 b.print(os);
155 return os;
156}
157
158#endif // ifdef OPAL_DUMPFIELDS_HH
std::ostream & operator<<(std::ostream &os, const DumpEMFields &b)
const std::string name
Action(int size, const char *name, const char *help)
Constructor for exemplars.
Definition Action.cpp:54
virtual void writeFieldThis(Component *field)
virtual void buildGrid()
void print(std::ostream &os) const
static std::unordered_set< DumpEMFields * > dumpsSet_m
void parseCoordinateSystem()
std::string filename_m
static void writeFields(Component *field)
DumpEMFields & operator=(const DumpEMFields &dump)
interpolation::NDGrid * grid_m
CoordinateSystem coordinates_m
void writeHeader(std::ofstream &fout) const
virtual void execute()
virtual DumpEMFields * clone(const std::string &name)
void writeFieldLine(Component *field, const Vector_t &point, const double &time, std::ofstream &fout) const
virtual ~DumpEMFields()
DumpEMFields(const DumpEMFields &dump)
Interface for a single beam element.
Definition Component.h:50
Vektor< double, 3 > Vector_t