pisces.extensions.simulation.arepo.frontends.AREPOFrontend.generate_initial_conditions#

AREPOFrontend.generate_initial_conditions(filename: str, *args, overwrite: bool = False, **kwargs)#

Generate Gadget-compatible initial condition files for this frontend.

This method provides a convenience wrapper around the base generate_initial_conditions() method, adding a standard filename and overwrite interface for Gadget-like simulation codes.

It performs the complete frontend lifecycle:

  1. Validate runtime configuration using _validate_runtime_configuration(), ensuring that the current configuration and particle data are consistent and complete.

  2. Write the simulation input files by calling the subclass-specific _generate_initial_conditions(), which performs file creation, unit system setup, particle preprocessing, and ID assignment.

Parameters:
  • filename (str) – Name of the output file to be written within the initial conditions directory (e.g., "ClusterICs.hdf5"). The full path is automatically resolved from ic_directory.

  • *args – Additional positional arguments forwarded to both _validate_runtime_configuration() and _generate_initial_conditions().

  • overwrite (bool, default False) – If True, any existing file with the same name will be replaced. If False, an existing file will raise a FileExistsError.

  • **kwargs – Additional keyword arguments forwarded to both _validate_runtime_configuration() and _generate_initial_conditions(). These may include code-specific options (e.g., compression flags, chunking behavior, etc.).

Returns:

The object returned by _generate_initial_conditions(). For most Gadget-like frontends, this will be a Gadget4ParticleDataset representing the generated simulation file.

Return type:

Any

Notes

  • This method should not be overridden in subclasses unless the frontend requires a fundamentally different call signature.

  • The filename argument is always interpreted relative to ic_directory.

  • Logging messages will automatically indicate progress through validation and file generation stages.