Data and Results Flow

The NSphere workflow typically involves simulation followed by analysis:

  1. Simulation (``./nsphere``): The C executable, ./nsphere, handles the core physics simulation. It takes command-line arguments or reads configuration to set up parameters like particle count, simulation time, and physics models. It may read initial particle configurations from the init/ directory (if present and configured). During execution, it calculates particle trajectories under self-gravity and any additional physics, outputting results primarily to the data/ directory (created in the current working directory if it doesn’t exist). This output includes time-series data, particle snapshots at specified intervals (Rank_Mass_Rad_VRad*.dat), and potentially theoretically calculated profiles (massprofile*.dat, etc.). A lastparams*.dat file is often written to record key parameters of the run.

  2. Visualization/Analysis (``./nsphere_plot`` and wrappers): The Python executable, ./nsphere_plot, along with its convenience wrappers, processes the files generated by the simulation, expecting them in the data/ directory relative to the current working directory. It typically uses a --suffix argument to identify the specific simulation run’s data files. Based on command-line flags, these scripts read the relevant data, perform analysis, and use the Matplotlib library to generate various outputs (plots as .png files, animations as .gif files) which are saved to the results/ directory (also created in the current working directory if needed).