java.lang.Object
simpa.acc.api.AccCli
Class that specifies all the commands that can be used in the CLI using the
CLI library apart from some extra commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArbitrary(String elementName, Double scaling, Double longiPos, String group, String etn, Map<Double, Profile> profileMap, String pathFile, org.apache.commons.math3.geometry.euclidean.threed.Vector3D localY) voidaddBending(String elementName, Double scaling, double length, double deflection, Double tilt, Double longPos, String etn, String group, Map<Double, Profile> profileMap, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, BendingType bendingType) voidvoidvoidaddStraight(String elementName, Double scaling, Double tilt, Double longPos, String group, String etn, Map<Double, Profile> profileMap, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot) beamFromFile(ParticleType type, Double mom, Double lPos, Double mass, Double charge, String name, String file) bobyqaMatcher(Integer ipn, Double initialRegion, Double stopFitness, Integer maxIter, MatchingTarget[] targets, MatchingVariable[] variables) double[]calculateChromaticity(String file1, String file2, Integer turns, double dpop) voidvoidcheckField(TilingConfig tconfig) cmaesMatcher(MatchingTarget[] targets, MatchingVariable[] variables, Double stopFitness, Integer maxIter, Boolean isActiveCMA, Double[] sigmas, Integer checkFeasableCount, Integer populationSize) voidconvertTrajectory(String particleName, String beamName, double diskr, String outFile, Boolean backward) voidcreateAccElement(TilingConfig tconfig, Double relativeError, SolverPreset solverPreset, Double bjar, Double bjpr, Integer sliceWidth, Integer sliceOverlap, Integer gmresRestart, Boolean debug) createBeam(ParticleType type, Double mom, Double he, Double ve, Double lPos, Double dpOp, Double mass, Double charge, String name, BeamDistribution distribution, Integer nParticles, TwissParameters twiss) createBeamRegion(Profile profile, double distance, Double ballRadius, Double extention) voidcreateBendingPath(Double deflectionAngle, Double bendingRadius, Integer nSegments, Double extentionLength, String name, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, BendingType bendingType) voidcreateCheckpointFile(TilingConfig tconfig, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, Double extension, Double stepSize) createEllipseProfile(double xrad, double yrad, int steps, Double startAngle) voidcreateFieldMaps(String file, String groupName, Boolean oneByOne, int lmax, Integer pass1Lmax, Double relativeError, Boolean stat) createParticle(ParticleType type, Double mom, Double dx, Double ax, Double dy, Double ay, Double lPos, Double dpOp, Double mass, Double charge, String name) createRectProfile(double xmin, double xmax, double ymin, double ymax, int xsteps, int ysteps) org.apache.commons.math3.geometry.euclidean.threed.RotationcreateRotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D v1, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v2, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v3, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v4, Double angle) voidcreateSequence(String name, Double orbitStep, Boolean circular, LocalFrameStrategyOption strategyOption, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vertical) createSingleRowCover(double apertureRadius, double ballRadius) voidcreateStraightPath(Double sx, Double sy, Double sz, Double ex, Double ey, Double ez, String elementName, Integer nSteps) createTilingConfig(String elementName, Profile profile, LengthUnit unit, double elevation, OutputFileFormatOption outputFileFormat, double fieldScalingFactor, TileTypeOption tileType, FieldTypeOption fieldType) createTwiss(Double x, Double xp, Double y, Double yp, Double ha, Double va, Double hb, Double vb, Double dispH, Double dispV, Double dispPrimeH, Double dispPrimeV, Double emH, Double emV, Double muH, Double muV, Double dpop, Double lPos) createVacuumChamber(HashMap<Object, Double[]> distances) org.apache.commons.math3.geometry.euclidean.threed.Vector3DcreateVector3D(double x, double y, double z) voidelementFrom(String seqName, String name) voidendSequence(String outputFile, String lfFile, Integer increment, String lcFileName) voidfieldOnCurve(Map<String, Double> map, org.apache.commons.math3.geometry.euclidean.threed.Vector3D shift, String outputFile, Boolean localFrame) static cli.api.CommandInterpreterMethod to get the CommandInterpreter object.static cli.api.CliStategetState()javaCall(String externalClassName, String internalClassName, String pathToClass, String methodName, Object[] methodParameters, Object[] constructorParameters) lineOptics(Beam b0, Beam b1, Double stepsize, double diskRadius, String outFile, Boolean backward, Boolean writeTrajectory) static voidmatch(Beam b0, Beam b1, Particle p0, Particle p1, Double diskRadius, Double stepSize, Matcher matcher, Boolean backward, String file, Double lossPenalty, TwissParameters initialTwiss) matchingTarget(Double longiPos, MatchingTargetType type, Double value, Double upperLimit, Double lowerLimit, Double weight) matchingVariable(String fieldMapFile, MatchingVariableType type, Double min, Double max, Double guess) voidmirrorPath(String inFile, String outFile, LengthUnit unit) voidorbitAtBPMs(String hOutFile, String vOutFile) voidvoidresamplePath(String inFile, String outFile, Integer steps, Double[] distances, String distFile, Boolean relDist, Double x, Double y, Double z) voidringOptics(Particle p1, Particle p2, Double stepsize, double diskRadius, String outFile, Integer turns, Boolean writeTrajectory) voidvoidsetIntegrator(IntegratorTypeOption type, Double omega) voidsetScalings(Map<String, Double> map, Boolean enableExternal) voidsurvey(Double x0, Double y0, Double z0, Double theta0, Double phi0, Double psi0, String file, String elementName) intsystemCall(String command) voidtrack(Particle particle, Beam beam, Integer turns, Double stepSize, Double[] phoLongiPosArray, Double diskRadius, Boolean trajectoryObserver, String sigmaFile, Boolean debug, Integer threads, Boolean backward) voidtransformAccElement(String name, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, Boolean inverseRot, Boolean inverseTransl, String outName) voidupdateScalings(Map<String, Double> map) voiduseSequence(String name) voidwriteSurfacePoints(TilingConfig tconfig)
-
Constructor Details
-
AccCli
public AccCli()
-
-
Method Details
-
main
- Throws:
IOException
-
getCommandInterpreter
Method to get the CommandInterpreter object. The command interpreter can be used to execute simpa commands.- Returns:
- The command interpreter.
- Throws:
IOException
-
getState
- Returns:
- The current state of the command line interface.
- Throws:
IOException- if the state cannot be created.
-
activeSequence
-
addArbitrary
-
addBending
-
addBPM
public void addBPM(BpmPlane plane, String name, Double lpos, Map<Double, Profile> profileMap) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
addMarker
public void addMarker(String name, Double lpos, Map<Double, Profile> profileMap) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
addStraight
public void addStraight(String elementName, Double scaling, Double tilt, Double longPos, String group, String etn, Map<Double, Profile> profileMap, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot) throws IllegalAccessException- Throws:
IllegalAccessException
-
beamFromFile
public Beam beamFromFile(ParticleType type, Double mom, Double lPos, Double mass, Double charge, String name, String file) throws OutOfApertureException, KnownFatalException, FileNotFoundException -
beamTwiss
- Throws:
IOException
-
bobyqaMatcher
public Matcher bobyqaMatcher(Integer ipn, Double initialRegion, Double stopFitness, Integer maxIter, MatchingTarget[] targets, MatchingVariable[] variables) -
calculateChromaticity
public double[] calculateChromaticity(String file1, String file2, Integer turns, double dpop) throws FileNotFoundException - Throws:
FileNotFoundException
-
calculateTunes
public void calculateTunes(String file, Integer turns, Integer startTurn, String directory, String outFile) throws FileNotFoundException - Throws:
FileNotFoundException
-
checkField
- Throws:
FileNotFoundExceptionNotSetException
-
cmaesMatcher
public Matcher cmaesMatcher(MatchingTarget[] targets, MatchingVariable[] variables, Double stopFitness, Integer maxIter, Boolean isActiveCMA, Double[] sigmas, Integer checkFeasableCount, Integer populationSize) -
convertTrajectory
public void convertTrajectory(String particleName, String beamName, double diskr, String outFile, Boolean backward) throws IOException - Throws:
IOException
-
createAccElement
public void createAccElement(TilingConfig tconfig, Double relativeError, SolverPreset solverPreset, Double bjar, Double bjpr, Integer sliceWidth, Integer sliceOverlap, Integer gmresRestart, Boolean debug) throws NotSetException, PositionMismatchException -
createBeam
public Beam createBeam(ParticleType type, Double mom, Double he, Double ve, Double lPos, Double dpOp, Double mass, Double charge, String name, BeamDistribution distribution, Integer nParticles, TwissParameters twiss) throws OutOfApertureException, KnownFatalException -
createBeamRegion
public String createBeamRegion(Profile profile, double distance, Double ballRadius, Double extention) throws FileNotFoundException, KnownFatalException -
createBendingPath
-
createCheckpointFile
public void createCheckpointFile(TilingConfig tconfig, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, Double extension, Double stepSize) throws FileNotFoundException, NotSetException - Throws:
FileNotFoundExceptionNotSetException
-
createEllipseProfile
-
createParticle
public Particle createParticle(ParticleType type, Double mom, Double dx, Double ax, Double dy, Double ay, Double lPos, Double dpOp, Double mass, Double charge, String name) throws OutOfApertureException, KnownFatalException -
createRectProfile
public Profile createRectProfile(double xmin, double xmax, double ymin, double ymax, int xsteps, int ysteps) -
createRotation
public org.apache.commons.math3.geometry.euclidean.threed.Rotation createRotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D v1, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v2, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v3, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v4, Double angle) -
createSequence
public void createSequence(String name, Double orbitStep, Boolean circular, LocalFrameStrategyOption strategyOption, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vertical) -
createSingleRowCover
-
plot
public void plot(PlotTypeOption type, String name, Boolean vectorField, String fileName, Double vectorScale) throws IOException - Throws:
IOException
-
createTilingConfig
public TilingConfig createTilingConfig(String elementName, Profile profile, LengthUnit unit, double elevation, OutputFileFormatOption outputFileFormat, double fieldScalingFactor, TileTypeOption tileType, FieldTypeOption fieldType) throws FileNotFoundException - Throws:
FileNotFoundException
-
createStraightPath
public void createStraightPath(Double sx, Double sy, Double sz, Double ex, Double ey, Double ez, String elementName, Integer nSteps) throws IOException - Throws:
IOException
-
createTwiss
public TwissParameters createTwiss(Double x, Double xp, Double y, Double yp, Double ha, Double va, Double hb, Double vb, Double dispH, Double dispV, Double dispPrimeH, Double dispPrimeV, Double emH, Double emV, Double muH, Double muV, Double dpop, Double lPos) throws OutOfApertureException, KnownFatalException -
createVector3D
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D createVector3D(double x, double y, double z) -
endSequence
-
javaCall
-
createFieldMaps
public void createFieldMaps(String file, String groupName, Boolean oneByOne, int lmax, Integer pass1Lmax, Double relativeError, Boolean stat) throws IOException - Throws:
IOException
-
fieldOnCurve
public void fieldOnCurve(Map<String, Double> map, org.apache.commons.math3.geometry.euclidean.threed.Vector3D shift, String outputFile, Boolean localFrame) throws OutOfApertureException, KnownFatalException, IOException -
createVacuumChamber
-
lineOptics
public Optics lineOptics(Beam b0, Beam b1, Double stepsize, double diskRadius, String outFile, Boolean backward, Boolean writeTrajectory) throws IOException - Throws:
IOException
-
match
public Map<String,Double> match(Beam b0, Beam b1, Particle p0, Particle p1, Double diskRadius, Double stepSize, Matcher matcher, Boolean backward, String file, Double lossPenalty, TwissParameters initialTwiss) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
matchingTarget
public MatchingTarget matchingTarget(Double longiPos, MatchingTargetType type, Double value, Double upperLimit, Double lowerLimit, Double weight) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
matchingVariable
public MatchingVariable matchingVariable(String fieldMapFile, MatchingVariableType type, Double min, Double max, Double guess) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
mirrorPath
- Throws:
FileNotFoundException
-
orbitAtBPMs
- Throws:
IOException
-
resamplePath
public void resamplePath(String inFile, String outFile, Integer steps, Double[] distances, String distFile, Boolean relDist, Double x, Double y, Double z) throws IOException - Throws:
IOException
-
ringOptics
public void ringOptics(Particle p1, Particle p2, Double stepsize, double diskRadius, String outFile, Integer turns, Boolean writeTrajectory) throws IOException - Throws:
IOException
-
sequenceSourcesToFile
-
setIntegrator
-
setScalings
- Throws:
Exception
-
survey
-
systemCall
- Throws:
Exception
-
track
public void track(Particle particle, Beam beam, Integer turns, Double stepSize, Double[] phoLongiPosArray, Double diskRadius, Boolean trajectoryObserver, String sigmaFile, Boolean debug, Integer threads, Boolean backward) throws KnownFatalException, IOException - Throws:
KnownFatalExceptionIOException
-
transformAccElement
public void transformAccElement(String name, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, Boolean inverseRot, Boolean inverseTransl, String outName) throws IOException - Throws:
IOException
-
twiss
- Throws:
IOException
-
updateScalings
- Throws:
Exception
-
useSequence
-
elementFrom
-
writeSurfacePoints
- Throws:
NotSetException
-