define(PLOT, 0) if (VARIANT == 1) then sdefine(WHAT, Static-Yee1) define(WWAKE, 0) sdefine(HFDTD, no) else if (VARIANT == 2) then sdefine(WHAT, Static-Yee33) define(WWAKE, 0) sdefine(HFDTD, yes) else if (VARIANT == 3) then sdefine(WHAT, ww-Strang) define(WWAKE, 1) sdefine(STRANG, yes) define(YEEORDER, 4711) else if (VARIANT == 4) then sdefine(WHAT, ww-Yee1) define(WWAKE, 1) sdefine(STRANG, no) define(YEEORDER, 1) else if (VARIANT == 5) then sdefine(WHAT, ww-Yee31) define(WWAKE, 1) sdefine(STRANG, no) define(YEEORDER, 31) else echo bad Variant: VARIANT stop end if define(A, 1e-3 ) # Radius of the Beampipes define(B, A/3) # Radius of the narrowest Part. define(GAP, TLEN*A) # define(GAP, 8*A) # Strang gives somewhat different Wy. define(STPSZE, A/80/3) define(SIGMA, 30*STPSZE) define(DY, 0.1*A) # y-Position of the Linecharge. -gen, text()= Variant: VARIANT, zLen/Radius: ZLEN, tLen/Radius: TLEN text()= What: WHAT, wwake: WWAKE, Strang: STRANG, YeeOrder: YEEORDER text()= TaperLength/Radius: eval(GAP/A) text()= Sigma/Spacing: eval(SIGMA/STPSZE) define( GEOSCALE, 1 ) # To make the Frequency of an Impedance-Plot to k*A: # define( GEOSCALE, @clight/A/2/@pi ) -mesh, geoscale= GEOSCALE -general outfile= SCRATCH/Collimator-tLen-TLEN-Variant-VARIANT-zLen-ZLEN scratch= SCRATCH/scratch- -mesh spacing= STPSZE pxlow= 0, pxhigh= A+STPSZE, cxlow= mag, cxhigh= ele pylow= 0, pyhigh= A+STPSZE, cylow= ele, cyhigh= ele pzlow = - (GAP/2 + ZLEN*A + 10*STPSZE) pzhigh= + (GAP/2 + ZLEN*A + 10*STPSZE) -material, material= 3, type= electric, kappa= 56e6 # Fill the Universe with Metal. -brick, material= 3, volume= ( -INF,INF, -INF,INF, -INF,INF ), doit -gccylinder material= 0, radius= A, length= INF origin= ( 0, 0, GAP/2 ) direction= ( 0, 0, 1 ) doit # Upper Beampipe material= 0, radius= A, length= INF origin= ( 0, 0, -GAP/2 ) direction= ( 0, 0, -1 ) doit # Lower BeamPipe # The Tapers. -gbor, material= 0, origin= ( 0, 0, 0 ), zprime= ( 0, 0, 1 ), rprime= ( 1, 0, 0 ) clear point= (-GAP/2-STPSZE, 0) # ( Zi, Ri ) point= (-GAP/2-STPSZE, A) point= (-GAP/2, A) point= ( 0, B ) point= ( GAP/2, A) point= ( GAP/2+STPSZE, A) point= ( GAP/2+STPSZE, 0) # show= now doit if (PLOT) then -volumeplot, roty= 90, doit end if -fdtd -ports define(NPML, 40) name= beamlow, plane= zlow, modes= 0, npml= NPML, doit name= beamhigh, plane= zhigh, modes= 0, npml= NPML, doit -lcharge if (PLOT) then showdata= yes else showdata= no end if charge= 1e-12, sigma= SIGMA xposition= 0, yposition= DY shigh= 12*SIGMA if (0) then # If one would want to create a Movie. define(NDT, 0.5 * STPSZE * GEOSCALE / @clight) # Every Timestep -fdtd, -fexport system( rm SCRATCH/H-fields-iVar-VARIANT-* ) outfile= SCRATCH/H-fields-VARIANT- what= h-fields firstsaved= 1e-20 lastsaved= INF distancesaved= NDT bbxlow= -STPSZE/10, bbxhigh= STPSZE/10 bbylow= -INF, bbyhigh= INF bbzlow= -INF, bbzhigh= INF doit end if if (WWAKE) then -windowwake, fdtdorder= YEEORDER, strang= STRANG, doit else -fdtd, hfdtd= HFDTD, doit end if