pisces.extensions.simulation.core.frontends.GadgetLikeFrontend.generate_initial_conditions#
- GadgetLikeFrontend.generate_initial_conditions(filename: str, *args, overwrite: bool = False, **kwargs)[source]#
Generate Gadget-compatible initial condition files for this frontend.
This method provides a convenience wrapper around the base
generate_initial_conditions()method, adding a standardfilenameandoverwriteinterface for Gadget-like simulation codes.It performs the complete frontend lifecycle:
Validate runtime configuration using
_validate_runtime_configuration(), ensuring that the current configuration and particle data are consistent and complete.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 fromic_directory.*args – Additional positional arguments forwarded to both
_validate_runtime_configuration()and_generate_initial_conditions().overwrite (
bool, defaultFalse) – IfTrue, any existing file with the same name will be replaced. IfFalse, an existing file will raise aFileExistsError.**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 aGadget4ParticleDatasetrepresenting 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
filenameargument is always interpreted relative toic_directory.Logging messages will automatically indicate progress through validation and file generation stages.