src issueshttps://gitlab.psi.ch/OPAL/src/-/issues2023-10-17T13:29:00+02:00https://gitlab.psi.ch/OPAL/src/-/issues/357Unify units in Elements and Input / Output2023-10-17T13:29:00+02:00frey_mUnify units in Elements and Input / OutputAccording to #45 and #227 the units of OPAL-T and OPAL-Cycl should be unified.
The following units should be used:
* meter
* second
* MeV or eV
* Tesla
* MV
For the full list see http://amas.web.psi.ch/opal/Documentation/master/OPAL...According to #45 and #227 the units of OPAL-T and OPAL-Cycl should be unified.
The following units should be used:
* meter
* second
* MeV or eV
* Tesla
* MV
For the full list see http://amas.web.psi.ch/opal/Documentation/master/OPAL_Manual.html#sec.conventions.units
Some elements are already fixed. This issue (as discussed with @gsell) should keep track of elements that are not yet updated. If an element is missing, please add it to the list.
Developers that fixed an element should mark it here:
- [x] Bend2D - no fixing needed
- [x] BeamStripping (!368, !479)
- [x] CCollimator (!368, !479)
- [x] ~~Corrector~~ deleted in !390
- [x] Cyclotron (!632)
- [x] ~~CyclotronValley~~ deleted in !218
- [ ] Degrader
- [ ] Drift
- [ ] FlexibleCollimator
- [ ] Monitor
- [ ] Multipole
- [ ] MultipoleTBase
- [ ] MultipoleTCurvedConstRadius
- [ ] MultipoleTCurvedVarRadius
- [x] MultipoleT (!643)
- [ ] MultipoleTStraight
- [x] Offset
- [x] ~~ParallelPlate~~ deleted in !390
- [x] PluginElement (!368)
- [x] Probe (!368, !479)
- [x] RBend3D - no fixing needed
- [x] RBend - no fixing needed
- [x] RFCavity (!619)
- [x] ~~RFQuadrupole~~ deleted in !390
- [x] Ring (!632, !643)
- [x] SBend3D - no fixing needed
- [x] SBend - no fixing needed
- [x] ScalingFFAMagnet (!643)
- [x] ~~SectorFieldMapComponent~~ deleted in !230
- [x] Septum (!368, !479)
- [ ] Solenoid
- [x] Source - no fixing needed
- [x] Stripper (!368, !479)
- [ ] TravelingWave
- [x] TrimCoil
- [x] VariableRFCavityFringeField (!643)
- [x] VariableRFCavity (!643)
- [x] VerticalFFAMagnet (!643)
Input / Output
- [ ] ID1 and ID2 in stat file and track file
- [ ] Field Maps (!506)snuverink_jjochem.snuverink@psi.chext-calvo_ppedro.calvo@ciemat.esext-rogers_ckraussnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/686Use a library that provides dimensional analysis and unit/quantity manipulation.2023-07-24T11:02:38+02:00krausUse a library that provides dimensional analysis and unit/quantity manipulation.Once we switch to c++20 then we should use [this library](https://github.com/mpusz/units) to make unit convertions safe. Ideally we also provide units for the parser such that the user can provide quantities in different units than meter...Once we switch to c++20 then we should use [this library](https://github.com/mpusz/units) to make unit convertions safe. Ideally we also provide units for the parser such that the user can provide quantities in different units than meter, seconds etc.
See also [here](https://mpusz.github.io/units/introduction.html) and [here](https://www.youtube.com/watch?v=7dExYGSOJzo).https://gitlab.psi.ch/OPAL/src/-/issues/757Zero field should create a warning2023-04-12T10:58:36+02:00adelmannZero field should create a warning### Summary
In case a zero field is read in, a warning should be issued.
Such almost zero fields make sense however one field component must be non zero.
The attached example shows the zero field and the fixed zero field.
[zero-field-...### Summary
In case a zero field is read in, a warning should be issued.
Such almost zero fields make sense however one field component must be non zero.
The attached example shows the zero field and the fixed zero field.
[zero-field-example.zip](/uploads/334c29c62cd2efbaff2e81f244885022/zero-field-example.zip)2023.1adelmannadelmannhttps://gitlab.psi.ch/OPAL/src/-/issues/547Replace all plain pointers with smart pointers2022-11-05T23:09:24+01:00krausReplace all plain pointers with smart pointersWe should replace all plain pointers with smart pointers, either from std or from boost.
#### Some random notes
- Each class `T` for which a shared pointer `std::shared_ptr<T>` is used should feature a `typedef std::shared_ptr<T> SP`. T...We should replace all plain pointers with smart pointers, either from std or from boost.
#### Some random notes
- Each class `T` for which a shared pointer `std::shared_ptr<T>` is used should feature a `typedef std::shared_ptr<T> SP`. This reduces the amount of code we have to write.
- Cyclic references have to be avoided using weak pointers.
#### ToDos
- [ ] `ElementBase *` -> `std::shared_ptr<ElementBase>`
- [ ] return type of Object::clone
- [ ] (almost) all occurrences of the keyword `new`
- [ ] replace (occurrences of) `Pointer` class
- [ ] replace pointers in Classic/Fields with smart pointers (#744)
- [ ] replace plain pointers in Classic/AbsBeamline with smart pointers (#746)https://gitlab.psi.ch/OPAL/src/-/issues/576Emit particles from position of Source element2021-08-11T14:35:52+02:00krausEmit particles from position of Source elementCurrently the particles are always emitted from `z = 0` even if the source element is shifted.Currently the particles are always emitted from `z = 0` even if the source element is shifted.https://gitlab.psi.ch/OPAL/src/-/issues/628Add signal handler for SIGABRT, SIGSEGV with stacktrace2021-07-09T08:41:11+02:00krausAdd signal handler for SIGABRT, SIGSEGV with stacktraceOne could add a handler to `main(...)` to print a stacktrace in case a run is aborted or a segmentation fault occurred. See e.g. [here](https://stackoverflow.com/questions/77005/how-to-automatically-generate-a-stacktrace-when-my-program-...One could add a handler to `main(...)` to print a stacktrace in case a run is aborted or a segmentation fault occurred. See e.g. [here](https://stackoverflow.com/questions/77005/how-to-automatically-generate-a-stacktrace-when-my-program-crashes). I don't know if this is portable. One could also have a look at how [Glog](https://github.com/google/glog) does it in `Google::InstallFailureSignalHandler()`.
### Stacktrace with line numbers
[link#1](https://stackoverflow.com/questions/4636456/how-to-get-a-stack-trace-for-c-using-gcc-with-line-number-information)
[link#2](https://stackoverflow.com/questions/3151779/best-way-to-invoke-gdb-from-inside-program-to-print-its-stacktrace/4611112#4611112)
### Glog
[link#1](https://github.com/google/glog/blob/master/src/signalhandler.cc)https://gitlab.psi.ch/OPAL/src/-/issues/661BANDRF field map type needs both E and B field2021-06-23T11:42:16+02:00snuverink_jjochem.snuverink@psi.chBANDRF field map type needs both E and B fieldThe `BANDRF` / `T3DDynamicH5Block` field map type, as produced by the `ascii2h5block` script, only accepts fields that have both the E field and B field specified. This shouldn't be necessary, and either only an electric field or magneti...The `BANDRF` / `T3DDynamicH5Block` field map type, as produced by the `ascii2h5block` script, only accepts fields that have both the E field and B field specified. This shouldn't be necessary, and either only an electric field or magnetic field could be specified as well.https://gitlab.psi.ch/OPAL/src/-/issues/62Static code analysis of OPAL2021-06-18T11:43:05+02:00snuverink_jjochem.snuverink@psi.chStatic code analysis of OPALI have run the OPAL source code through the static analysis tool cppcheck (http://cppcheck.sourceforge.net/). The log is [attached](/uploads/306d150e867ff0c780275c6c6c69f64a/cppcheck-2.4.1.txt) (cppcheck v2.4.1 - updated 18-06-2021, comm...I have run the OPAL source code through the static analysis tool cppcheck (http://cppcheck.sourceforge.net/). The log is [attached](/uploads/306d150e867ff0c780275c6c6c69f64a/cppcheck-2.4.1.txt) (cppcheck v2.4.1 - updated 18-06-2021, commit 052a732c).
I started using it after I lost access to Coverity, which I had access to at CERN and which I found quite useful. Cppcheck is also quite good, but not so extensive and has no GUI.
Just as an example, memory leaks are flagged sometimes since there is a leak in one of the logical branches:
`[src/Classic/AbsBeamline/Cyclotron.cpp:931]: (error) Resource leak: f`
The line reads:
`931: CHECK_CYC_FSCANF_EOF(fscanf(f, "%lf", &BP.rmin));`
Since `CHECK_CYC_FSCANF_EOF` can throw, `f` is leaked in that case. But I would say this is (close to) a false positive, and doesn't need fixing. Other things that are flagged are somewhat personal style. But often these can also indicate bugs or typos. In general there are few false positives.
The log file contains certainly some things I think should be fixed like the usual uninitialised members, unused variables, etc. And others that I would leave. There are different categories. I fixed most of the few errors it found in src/src (see 4359206a).
Over time, I plan to go through, fix some of the simpler and more serious ones, make separate issues for the more complicated ones and rerun.
Please have a look if there are any issues in the code parts that you are maintaining.https://gitlab.psi.ch/OPAL/src/-/issues/260Implement improved and low energy CSR methods2021-06-18T11:28:29+02:00krausImplement improved and low energy CSR methodsThe formulas to compute the CSR kick that is current used workes only for high energy beams. Better formulas such as [D. Sagan's](http://accelconf.web.cern.ch/AccelConf/e06/PAPERS/THPCH024.PDF) exist and are well tested.The formulas to compute the CSR kick that is current used workes only for high energy beams. Better formulas such as [D. Sagan's](http://accelconf.web.cern.ch/AccelConf/e06/PAPERS/THPCH024.PDF) exist and are well tested.ext-neveu_next-neveu_nhttps://gitlab.psi.ch/OPAL/src/-/issues/211Unify energy units2021-06-10T19:17:23+02:00krausUnify energy unitsOPAL expects inputs in eV, MeV and GeV. Clean this up to a single unit, e. g. MeV. @all please comment!OPAL expects inputs in eV, MeV and GeV. Clean this up to a single unit, e. g. MeV. @all please comment!krausadelmannkraushttps://gitlab.psi.ch/OPAL/src/-/issues/13Speedup boundary geometry initialization2021-06-10T18:19:07+02:00gsellSpeedup boundary geometry initializationInitializing the boundary geometry is quite time consuming. Instead of running the initialization again and again for every run, we should save the computed data-structures to a file. This should include:
* the voxel-mesh
* the two...Initializing the boundary geometry is quite time consuming. Instead of running the initialization again and again for every run, we should save the computed data-structures to a file. This should include:
* the voxel-mesh
* the two spanning corners
* the number of voxels for x,y,z
* the voxel ID's
* triangle ID to voxel ID mapping
* triangle mesh
* points
* triangles defined point ID's
* triangle normalgsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/45Unification of OPAL-Cyc and OPAL-T2021-06-10T18:11:10+02:00frey_mUnification of OPAL-Cyc and OPAL-TAccording to the OPAL round table meeting of today (i.e. 2. March 2017) we need to unify the OPAL flavors OPAL-T and OPAL-Cyc in the following points:
- units
- convention of vertical and longitudinal plane
- definition of particle dist...According to the OPAL round table meeting of today (i.e. 2. March 2017) we need to unify the OPAL flavors OPAL-T and OPAL-Cyc in the following points:
- units
- convention of vertical and longitudinal plane
- definition of particle distribution (i.e. different meaning of py)
- OPAL-Cyc allows single particle tracking but in OPAL-T minimum 10 particles are needed
The points are also listed in Valeria's wiki page at point
[OPAL-Cyc: RINGDEFINITION](https://gitlab.psi.ch/AMAS-members/rizzoglio_v/wikis/OPAL_Meeting.html)adelmannadelmannhttps://gitlab.psi.ch/OPAL/src/-/issues/250Store stat files of Sampler (and Optimizer?) in a single file2021-06-10T17:58:47+02:00krausStore stat files of Sampler (and Optimizer?) in a single fileThe stat files should be stored into a single file such that all data from all runs can be evaluated in post processing. The data should be supplemented with the values of the design variables. File formats that come into considerations ...The stat files should be stored into a single file such that all data from all runs can be evaluated in post processing. The data should be supplemented with the values of the design variables. File formats that come into considerations are HDF5, SDDS, a NoSQL database, zip/tar gunzip etc.krausadelmanngsellkraushttps://gitlab.psi.ch/OPAL/src/-/issues/261Reintroduce methods to compute Schottky effect2021-06-10T17:58:09+02:00krausReintroduce methods to compute Schottky effectThis was once introduced by Zha into Opal but couldn't be maintained. It was therefore removed from the code.This was once introduced by Zha into Opal but couldn't be maintained. It was therefore removed from the code.https://gitlab.psi.ch/OPAL/src/-/issues/270Flexible Energy Bins2021-06-10T17:57:44+02:00krausFlexible Energy BinsCurrently the user has to define how many energy bins are used. They are then used for `MINSTEPFORREBIN` steps whether this is necessary or not (or sufficient). Instead the number of bins should be controlled by the difference in gamma. ...Currently the user has to define how many energy bins are used. They are then used for `MINSTEPFORREBIN` steps whether this is necessary or not (or sufficient). Instead the number of bins should be controlled by the difference in gamma. If all particles have the same gamma then only one energy bin should be used. On contrary if the energy spread is big many bins should be used.krauskraushttps://gitlab.psi.ch/OPAL/src/-/issues/279Trimcoil: PHIMIN and PHIMAX as arrays2021-06-10T17:57:30+02:00frey_mTrimcoil: PHIMIN and PHIMAX as arraysIn order to have one instance of a trim coil instead of multiple instances it is better having the arguments PHIMIN and PHIMAX as arrays. Otherwise one needs to specify the same trim coil n-times for n-sectors.In order to have one instance of a trim coil instead of multiple instances it is better having the arguments PHIMIN and PHIMAX as arrays. Otherwise one needs to specify the same trim coil n-times for n-sectors.snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/287Reference Particle Class for all Trackers2021-06-10T17:56:59+02:00snuverink_jjochem.snuverink@psi.chReference Particle Class for all TrackersThe cyclotron tracker has no good reference particle treatment. In addition, it would be nice to adapt the reference particle treatment of the t-tracker into a separate class. This can be used for all trackers.The cyclotron tracker has no good reference particle treatment. In addition, it would be nice to adapt the reference particle treatment of the t-tracker into a separate class. This can be used for all trackers.snuverink_jjochem.snuverink@psi.chkraussnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/297Suggestion for improvements to the Optimiser2021-06-10T17:56:24+02:00snuverink_jjochem.snuverink@psi.chSuggestion for improvements to the OptimiserSome suggestions and observations to improve usability of the optimiser by Michael Abo-Bakr (as far as not already covered in other issues):
* [ ] For 1 or 2 optimisation parameters there is no hypervolume calculation.
* [ ] It would be...Some suggestions and observations to improve usability of the optimiser by Michael Abo-Bakr (as far as not already covered in other issues):
* [ ] For 1 or 2 optimisation parameters there is no hypervolume calculation.
* [ ] It would be very nice to get at the end a final best solution in the output (defined with some cost function)
* [ ] .json format is not always ideal for reading or writing new generation files (as starting condition)
* [ ] Not all individuals appear to be really new.
* [ ] Option to adaptively change optimisation parameters (mutation, crossover etc.)snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/354Add Analytic model of a transverse deflecting cavity (TCAV)2021-06-10T17:54:19+02:00adelmannAdd Analytic model of a transverse deflecting cavity (TCAV)adelmannkrausext-neveu_nadelmannhttps://gitlab.psi.ch/OPAL/src/-/issues/555Move Distribution attribute from the TrackRun command to the Beam command.2021-06-10T17:47:27+02:00krausMove Distribution attribute from the TrackRun command to the Beam command.It seems more logic to have them together since the distribution describes the beam of particles.It seems more logic to have them together since the distribution describes the beam of particles.