Skip to content

Commit 76881fb

Browse files
committed
Fixed bug with last commit. Set the wrong flag to True in add_physics_nodes.
1 parent 897ce92 commit 76881fb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

virtaccl/PyORBIT_Model/pyorbit_lattice_controller.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ def add_physics_nodes(self) -> List[str]:
217217
List of the names of all the new physics nodes added to the lattice.
218218
"""
219219

220+
self.physics_flag = True
220221
if self.lattice_flag and not self.physics_added_flag:
221222
physics_node_names = []
222223
list_of_nodes = self.accLattice.getNodes()
@@ -226,7 +227,7 @@ def add_physics_nodes(self) -> List[str]:
226227
node.addChildNode(physics_node, node.ENTRANCE)
227228
self.pyorbit_dictionary[physics_name] = PyorbitChild(physics_node, node)
228229
physics_node_names.append(physics_name)
229-
self.physics_flag = True
230+
self.physics_added_flag = True
230231

231232
if self.bunch_flag:
232233
self.accLattice.trackDesignBunch(self.bunch_dict['initial_bunch'])
@@ -235,7 +236,7 @@ def add_physics_nodes(self) -> List[str]:
235236
elif self.lattice_flag and self.physics_added_flag:
236237
print('Physics nodes already added. Nothing to be done.')
237238
else:
238-
print('Error: Initialize a lattice in order to add physics nodes.')
239+
print('Warning: Initialize a lattice in order to add physics nodes.')
239240

240241
def set_initial_bunch(self, initial_bunch: Bunch, beam_current: float = 40e-3):
241242
"""Designate an input PyORBIT bunch for the lattice. If a lattice has already been initialized, this bunch is

0 commit comments

Comments
 (0)