InitialConditions1DCartesian#
- class pisces.extensions.simulation.core.initial_conditions.InitialConditions1DCartesian(directory: str | Path)[source]#
Initial conditions for 1D Cartesian simulations.
Specialized Cartesian subclass with
ndim=1. Models are placed along a one-dimensional line with scalar position and velocity. This is useful for toy models, 1D test problems, or simplified collapse/expansion scenarios.- Extends
InitialConditionsCartesianwith physics utilities for: Mass-weighted center-of-mass (COM) position and velocity.
Shifting models into the COM frame.
Computing the total system mass.
- Models must include:
model_nameandmodel(file reference).position(1D vector with length units).velocity(1D vector with length/time units).
Methods
__init__(directory)Load an existing set of initial conditions from a target directory.
add_model(name, model, model_config[, ...])Add a new model to the initial conditions set.
add_particles_to_model(particle_path, model_name)Attach a particle dataset file to an existing model in the initial conditions.
compute_center_of_mass([models, masses])Compute the mass-weighted center of mass (COM) position for one or more models in the initial conditions.
Compute the positions of models in the center-of-mass (COM) frame.
Compute the velocities of models in the center-of-mass (COM) frame.
compute_center_of_mass_velocity([models, masses])Compute the mass-weighted center-of-mass (COM) velocity for one or more models in the initial conditions.
compute_total_mass([models, masses])Compute the total mass of one or more models in the initial conditions.
create_ics(directory, *models[, ...])Create a new initial conditions (IC) directory and return an
InitialConditionsinstance.generate_particles(model_name, num_particles)Generate particles for a stored model using its internal particle generation method.
get_model_coordinate_system(model_name)Retrieve the coordinate system of a stored model without fully loading it.
get_model_fields(model_name)Inspect the available fields in a stored model without fully loading it.
get_model_grid(model_name)Retrieve the grid object of a stored model without fully loading it.
get_model_info(model_name)Retrieve the configuration information for a specific model.
get_model_metadata(model_name)Inspect the metadata of a stored model without fully loading it.
get_model_summary(model_name[, include_fields])Retrieve a combined summary of a stored model without fully loading it.
get_particle_count(model_name)Inspect the number of particles in each species group for a stored model.
get_particle_fields(model_name)Inspect the available fields for each particle species in a model.
get_particle_path(model_name)Retrieve the particle file path associated with a specific model.
Retrieve a dictionary mapping model names to their associated particle file paths.
get_particle_species(model_name)List the particle species present in the stored particle dataset for a given model.
has_model(model_name)Check if a model with the given name exists in these initial conditions.
has_particles(model_name)Check if a specific model has associated particles.
List all models currently stored in these initial conditions.
List all models that have associated particle datasets.
load_model(name)Load a specific model from the initial conditions.
load_particles(model_name, **kwargs)Load the particle dataset associated with a specific model.
remove_model(name)Remove a model and its associated files from the initial conditions.
remove_particles_from_model(model_name[, ...])Detach and optionally delete the particle dataset associated with a specific model.
shift_to_COM_frame([models, masses])Shift the positions and velocities of models into the center-of-mass (COM) frame.
update_model(model_name, **parameters)Update parameters of an existing model in the initial conditions.
Attributes
The configuration manager for the initial conditions.
The directory where the initial conditions are stored.
Logger instance for the InitialConditions class.
The metadata associated with the initial conditions.
The positions of the models in the initial conditions.
The velocities of the models in the initial conditions.
The processed models used in the initial conditions.
The number of spatial dimensions for the initial conditions.
The particle files associated with the models in the initial conditions.
- Extends