pencil.pipelines.clonesimulations ================================= .. py:module:: pencil.pipelines.clonesimulations Functions --------- .. autoapisummary:: pencil.pipelines.clonesimulations.clone_sims pencil.pipelines.clonesimulations.clone_sims_from_obj Module Contents --------------- .. py:function:: clone_sims(simset, simsdir=None) clone_sims(simset, simsdir=None) Create a set of simulation directories from a dictionary object, simset, which contains the list of parameters to combine across set of clones. :param simset: Parameters to combine across set of clones. :type simset: dictionary :param simsdir: Root directory for collection of clone simulations. :type simsdir: string :returns: * *Set of uncompiled and unexecuted simulation run directories with* * *parameters updated.* .. rubric:: Notes It is assumed that the user is working in the compiled source directory. .. rubric:: Examples >>> simsdir = '/path/to/set_of_clones' >>> params = pencil.pipelines.parameter_table('example_filename.txt') >>> params = user_own_trim_table(params)#See pc.pipelines.trim_table >>> simset = pencil.pipelines.make_sims_dict(params) >>> clone_sims(simset,simsdir=simsdir) .. py:function:: clone_sims_from_obj(simset, simsdir='..', template_sim=None, specify_nml=True) clone_sims_from_obj(simset, simsdir="..", template_sim=None, specify_nml=True): Create a set of simulation directories from a dictionary object, simset, which contains the list of parameters to combine across set of clones. This differs from the clone_sims function in that it is more configurable, and uses the native Python way of copying the sim. :param simset: Parameters to combine across set of clones. :type simset: dictionary :param simsdir: Root directory for collection of clone simulations. :type simsdir: string :param template_sim: A pencil simulation object (returned by pc.get_sim). If not specified, the simulation in the current directory will be used. :type template_sim: obj :param specify_nml: Whether, for files like run.in, you also specify the namelist in simset. If so, f90nml will be directly used to write the value. If not, the change_value_in_file function will be used even for these files. :type specify_nml: bool :returns: * *Set of unexecuted simulation run directories with* * *parameters updated.* .. rubric:: Example >>> template_sim = pc.get_sim("simulation_to_clone") >>> template_sim.optionals.append("job.pbs") #A job submission script which ... #one wants to copy along with the other simulation files. >>> params = pc.pipelines.parameter_table("example_filename.txt") >>> simset = pc.pipelines.make_sims_dict(params) >>> pc.pipelines.clone_sims_from_obj(simset, template_sim=template_sim, simsdir=".")