svenreiche / Genesis-1.3-Version4

Time-dependent, 3D Code to simulate the amplification process of a Free-electron Laser.
GNU General Public License v3.0
53 stars 26 forks source link

conversion of data storage in class Collective to std::vector #148

Closed ZeugAusHH closed 7 months ago

ZeugAusHH commented 7 months ago

As a first step to fix the memory corruption issues reported in bug report https://github.com/svenreiche/Genesis-1.3-Version4/issues/144 , the data arrays were replaced by std::vector. Many (but not all) data accesses are done via at(), avoiding that indexing issues go undetected in the future.

As a second step, if possible, the code block should be reworked to use integer arithmetic (and avoid floating point arithmetic) as much as possible to avoid the rounding issues reported in https://github.com/svenreiche/Genesis-1.3-Version4/issues/144 . Moreover, since the computation of the parameters done in function Wake::init uses several parameters from an instance of class Time, it might be useful to pass a const pointer to that instance to Collective::initWake instead of these parameters...