|
7 | 7 | # |
8 | 8 | # This file is part of the code: |
9 | 9 | # |
10 | | -# PyECLOUD Version 8.3.0 |
| 10 | +# PyECLOUD Version 8.4.0 |
11 | 11 | # |
12 | 12 | # |
13 | 13 | # Main author: Giovanni IADAROLA |
@@ -66,6 +66,8 @@ class Empty(object): |
66 | 66 |
|
67 | 67 |
|
68 | 68 | class DummyBeamTim(object): |
| 69 | + """Dummy beam-timing class to interface with buildup simulation""" |
| 70 | + |
69 | 71 | def __init__(self, PyPIC_state): |
70 | 72 | self.PyPIC_state = PyPIC_state |
71 | 73 |
|
@@ -100,6 +102,8 @@ def get_beam_eletric_field(self, MP_e): |
100 | 102 |
|
101 | 103 | class Ecloud(object): |
102 | 104 | def generate_twin_ecloud_with_shared_space_charge(self): |
| 105 | + """Generate an identical Ecloud objet with shared space-charge member.""" |
| 106 | + |
103 | 107 | if hasattr(self, "efieldmap"): |
104 | 108 | raise ValueError( |
105 | 109 | "Ecloud has been replaced with field map. I cannot generate a twin ecloud!" |
@@ -136,8 +140,105 @@ def __init__( |
136 | 140 | force_interp_at_substeps_interacting_slices=False, |
137 | 141 | **kwargs |
138 | 142 | ): |
| 143 | + """ |
| 144 | + Construct an e-cloud object that can be inserted in a PyHEADTAIL machine |
| 145 | +
|
| 146 | + Parameters |
| 147 | + --------- |
| 148 | +
|
| 149 | + L_ecloud : m |
| 150 | + Length of the e-cloud interaction |
| 151 | +
|
| 152 | + slicer : |
| 153 | + PyHEADTAIL slicer object, used to define slices for e-cloud insteraction. |
| 154 | + Needs to be provided only if slice_by_slice_mode is False. |
| 155 | +
|
| 156 | + Dt_ref : s |
| 157 | + Target duration of the sub-steps perfomed in each slice. |
| 158 | +
|
| 159 | + pyecl_input_folder : path |
| 160 | + Folder containing the PyECLOUD input files defining the e-cloud. |
| 161 | +
|
| 162 | + flag_clean_slices : {True, False} |
| 163 | + If True, slicing is redone before the e-cloud interation. |
| 164 | + This flag has no effect is slice_by_slice_mode is True. |
| 165 | +
|
| 166 | + slice_by_slice_mode : {True, False} |
| 167 | +
|
| 168 | + - If False, the e-cloud receives a full bunch, slicing is done interally, |
| 169 | + the cloud is automatically re-initialized after each interaction. |
| 170 | + - If True, the e-cloud receives one slice at a time (the slice object |
| 171 | + should have metadata in a member called slice_info. The reinitialization |
| 172 | + of the cloud is done based on the meta-data or esplicitly by the user. |
| 173 | +
|
| 174 | + space_charge_obj : |
| 175 | +
|
| 176 | + - If None a space-charge object (Particle In Cell) is constructed for |
| 177 | + the e-cloud |
| 178 | + - If not None the provided space-charge objeci is used |
| 179 | +
|
| 180 | + kick_mode_for_beam_field : {True, False} |
| 181 | + If True, the force of the beam on the electrons is applied as a |
| 182 | + discrete kick (used mainly for fast beam-ion simulations). |
| 183 | +
|
| 184 | + beam_monitor : |
| 185 | + PyHEADTAIL beam-monitor, used sometimes for debug purposes. |
| 186 | +
|
| 187 | + verbose : {True, False} |
| 188 | +
|
| 189 | + save_pyecl_outp_as : path |
| 190 | + File in which cloud evolution is stored. |
| 191 | +
|
| 192 | + force_reinterp_at_substeps_interacting_slices : {True, False} |
| 193 | + Fields from beams and clouds are re-interpolated at each subsstep. |
| 194 | +
|
| 195 | + x_beam_offset : m |
| 196 | + Horizontal position of the PyHEADTAIL reference trajectoy in |
| 197 | + the PyECLOUD referece system. |
| 198 | +
|
| 199 | + y_beam_offset: m |
| 200 | + Vertical position of the PyHEADTAIL reference trajectoy in |
| 201 | + the PyECLOUD referece system. |
| 202 | +
|
| 203 | + probes_position : dict |
| 204 | + Positions at which electron density and field can be measured. |
| 205 | +
|
| 206 | + enable_kick_x : |
| 207 | + Enable horizontal kick from the cloud on the beam. |
| 208 | +
|
| 209 | + enable_kick_y : |
| 210 | + Enable vertical kick from the cloud on the beam. |
| 211 | +
|
| 212 | + **kwargs : |
| 213 | + Any input parameter of PyECLOUD can be passes as a keyword arguments. |
| 214 | + Parameters definded in the input files are overridden by those passas as |
| 215 | + keyword arguments. |
| 216 | +
|
| 217 | + Additional information |
| 218 | + ---------------------- |
| 219 | + After building the object, the following members can be set to true to record |
| 220 | + additional information (which is then attached as a member to the ecloud object |
| 221 | + itself. After setting any of these ot true the [ecloud]._reinitialize |
| 222 | + function needs to be called to prepare the data storage, which also resets cloud |
| 223 | + state. |
| 224 | +
|
| 225 | + [ecloud].save_ele_distributions_last_track |
| 226 | + [ecloud].save_ele_potential_and_field |
| 227 | + [ecloud].save_ele_potential |
| 228 | + [ecloud].save_ele_field |
| 229 | + [ecloud].save_ele_MP_position |
| 230 | + [ecloud].save_ele_MP_velocity |
| 231 | + [ecloud].save_ele_MP_size |
| 232 | +
|
| 233 | + [ecloud].save_beam_distributions_last_track |
| 234 | + [ecloud].save_beam_potential_and_field |
| 235 | + [ecloud].save_beam_potential |
| 236 | + [ecloud].save_beam_field |
| 237 | +
|
| 238 | +
|
| 239 | + """ |
139 | 240 |
|
140 | | - print("PyECLOUD Version 8.3.0") |
| 241 | + print("PyECLOUD Version 8.4.0") |
141 | 242 |
|
142 | 243 | # These git commands return the hash and the branch of the specified git directory. |
143 | 244 | path_to_git = os.path.dirname(os.path.abspath(__file__)) + "/.git" |
@@ -264,6 +365,7 @@ def __init__( |
264 | 365 |
|
265 | 366 | self.slice_by_slice_mode = slice_by_slice_mode |
266 | 367 | if self.slice_by_slice_mode: |
| 368 | + assert(slicer is None) |
267 | 369 | self.track = self._track_in_single_slice_mode |
268 | 370 | self.finalize_and_reinitialize = self._finalize_and_reinitialize |
269 | 371 |
|
|
0 commit comments