A decent number of lines of code will run (including the quenching and drifting stages in the case of the output file), before the input and output files are initially opened. This means that the simulation will halt if the input file doesn't exist, or if the output file already exists. I've found this a little annoying, as it looks like the simulation starts just for it to later halt because I forgot to delete the output file (this happens when rerunning the simulation multiple times for testing purposes). So I've added two checks at the beginning of the simulation. These will halt the simulation immediately if the input file doesn't exist or if the output file exists already. This way the simulation will not actually start until these checks are passed.
A decent number of lines of code will run (including the quenching and drifting stages in the case of the output file), before the input and output files are initially opened. This means that the simulation will halt if the input file doesn't exist, or if the output file already exists. I've found this a little annoying, as it looks like the simulation starts just for it to later halt because I forgot to delete the output file (this happens when rerunning the simulation multiple times for testing purposes). So I've added two checks at the beginning of the simulation. These will halt the simulation immediately if the input file doesn't exist or if the output file exists already. This way the simulation will not actually start until these checks are passed.