Skip to content

Commit

Permalink
Update examples according to API changes
Browse files Browse the repository at this point in the history
Caution: Examples still not working again
  • Loading branch information
n01r authored and ax3l committed Aug 31, 2022
1 parent a9c6af3 commit f6cf8eb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/chicane/chicane.madx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SBEND1: sbend, L=0.50037, angle=0.048345, e1=0.000, e2=0.000, k1=0.00;
SBEND2: sbend, L=0.50037, angle=-0.048345, e1=0.000, e2=0.000, k1=0.00;
! dipole edge elements
DIPEDGE1: dipedge, H=0.096618357, e1=-0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00;
DIPEDGE2: dipedge, H=0.096618357, e1=0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00;;
DIPEDGE2: dipedge, H=0.096618357, e1=0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00;

CHICANE: Line=(SBEND1,DIPEDGE1,DRIFT1,DIPEDGE2,SBEND2,DRIFT2,SBEND2,DIPEDGE2,DRIFT1,DIPEDGE1,SBEND1,DRIFT3);
USE, SEQUENCE = CHICANE;
4 changes: 2 additions & 2 deletions examples/chicane/run_chicane_madx.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import amrex
from impactx import (ImpactX, MADXParser, RefPart, distribution, elements,
madx2impactx_beam, madx2impactx_lattice)
read_beam, read_lattice)

sim = ImpactX()

Expand Down Expand Up @@ -37,7 +37,7 @@

beamline = madx.getBeamline()

ref_particle_dict = madx2impactx_beam(
ref_particle_dict = read_beam(
madx.getParticle(), # if particle species is known, mass, charge, and potentially energy are set to default
# TODO MADX parser needs to extract charge if it's given,
# TODO MADX parser needs to extract mass if it's given,
Expand Down
4 changes: 2 additions & 2 deletions examples/fodo/run_fodo_madx.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import amrex
from impactx import (ImpactX, MADXParser, RefPart, distribution, elements,
madx2impactx_beam, madx2impactx_lattice)
read_beam, read_lattice)

sim = ImpactX()

Expand All @@ -36,7 +36,7 @@

beamline = madx.getBeamline()

ref_particle_dict = madx2impactx_beam(
ref_particle_dict = read_beam(
madx.getParticle(), # if particle species is known, mass, charge, and potentially energy are set to default
# TODO MADX parser needs to extract charge if it's given,
# TODO MADX parser needs to extract mass if it's given,
Expand Down
4 changes: 2 additions & 2 deletions src/python/impactx/MADXParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def parse(self, fn):
self.__dipedge[obj.group(i)] = float(obj.group(i + 1))
else:
raise MADXInputError(
"DipEgde",
"DipEdge",
"Line "
+ str(nLine)
+ ": Parameter "
Expand Down Expand Up @@ -393,7 +393,7 @@ def __str__(self):
+ " * #quadrupole:\t"
+ str(nTypes[2])
+ "\n"
+ " * #dipedge:\t"
+ " * #dipedge:\t"
+ str(nTypes[3])
+ "\n"
+ " beam:\t\n"
Expand Down

0 comments on commit f6cf8eb

Please sign in to comment.