ocelot-collab / ocelot

OCELOT is a multiphysics simulation toolkit designed for studying FEL and storage ring-based light sources.
GNU General Public License v3.0
84 stars 58 forks source link

CSR with 0 angle bends #2

Closed iagapov closed 6 years ago

iagapov commented 6 years ago

if a bend has 0 angle in the lattice csr crashes like so

Traceback (most recent call last): File "C:\workspace\p4-h\collective\cellA.py", line 192, in navi.add_physics_proc(csr,lat.sequence[0], IDMARKER) File "c:\workspace\ocelot-collab\ocelot\cpbd\optics.py", line 1067, in add_physics_proc self.process_table.add_physics_proc(physics_proc, elem1, elem2) File "c:\workspace\ocelot-collab\ocelot\cpbd\optics.py", line 1041, in add_physics_proc physics_proc.prepare(self.lat) File "c:\workspace\ocelot-collab\ocelot\cpbd\csr.py", line 627, in prepare R = -elem.l/elem.angle ZeroDivisionError: float division by zero

sergey-tomin commented 6 years ago

Fixed and committed to "dev" branch.