pisces.extensions.simulation.core.frontends.SimulationFrontend.generate_initial_conditions#

SimulationFrontend.generate_initial_conditions(*args, **kwargs) Any[source]#

Generate all simulation-ready initial condition files for this frontend.

This method serves as the main entry point for converting a Pisces InitialConditions object into the native input format required by an external simulation code.

It performs a complete two-step lifecycle:

  1. Validate runtime configuration using _validate_runtime_configuration(), ensuring that the loaded configuration and attached initial conditions are physically and structurally consistent with the simulation code’s expectations.

  2. Generate native input files via _generate_initial_conditions(), which performs the actual file-writing procedure defined by the subclass implementation.

Depending on the specific frontend, this process may involve:

  • Writing HDF5 or binary particle data files.

  • Generating code-specific metadata or parameter files.

  • Performing pre-processing (e.g., orientation, bounding box cuts).

  • Registering provenance or logging details to the IC directory.

Parameters:
  • *args – Positional arguments forwarded to both _validate_runtime_configuration() and _generate_initial_conditions().

  • **kwargs – Keyword arguments forwarded to both methods. These may include code-specific runtime options (e.g., filename, overwrite=True).

Returns:

The return value of _generate_initial_conditions(), which varies depending on the frontend implementation. For example, Gadget-like frontends return a Gadget4ParticleDataset instance representing the generated file.

Return type:

Any

Notes

  • This method is not meant to be overridden in subclasses. Instead, subclasses should implement the two private lifecycle methods: _validate_runtime_configuration() and _generate_initial_conditions().

  • Any log output or error handling performed here ensures a consistent user experience across all simulation frontends.