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
55 stars 27 forks source link

[BUG] &time block is silently ignored if too late in input file (and inconsistent slice numbers are reported) #118

Closed ZeugAusHH closed 10 months ago

ZeugAusHH commented 1 year ago

If &time block comes after the &field and &beam block it is silently ignored. Here at least a warning should be printed. Moreover the slice numbers reported by the code are inconsistent, see the output attached down below.

I used git commit id b788bb316f1f62a9a234e28d954fcbd137332dc, which is the status of dev branch as of Oct-24, 2023.

GENESIS - Version 4.6.5 (beta) has started...
Compile info: Compiled by [..] from Git Commit ID: b788bb316f1f62a9a234e28d954fcbd137332dc
Starting Time: Tue Oct 24 22:22:41 2023

MPI-Comm Size: 128 nodes

Parsing lattice file...
*** Warning: Cannot find a matching solution
Generating input radiation field for HARM = 1 ...
Generating input particle distribution...
Setting up time window of 1.0112 microns with **10112** sample points...

Running Core Simulation...
Time-dependent run with **128** slices for a time window of 0.0128 microns
Initial analysis of electron beam and radiation field...
  Calculation: 0% done
[... rest of output omitted ...]

The simulation used the input files from https://github.com/svenreiche/Genesis-1.3-Version4/discussions/117 In https://github.com/svenreiche/Genesis-1.3-Version4/discussions/117#discussioncomment-7374108 there is also an improved main input file where &time is positioned after &setup.

svenreiche commented 10 months ago

Solved with the latest commit to the dev branch. Time namelist is ignored when beam or field has been already defined.