def dump_all_diags(pops=[]): import pyphare.pharein as ph, numpy as np sim = ph.global_vars.sim timestamps = np.arange(0, sim.time_step + 3) * sim.time_step for quantity in ["density", "bulkVelocity"]: ph.FluidDiagnostics( quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, ) for pop in pops: for quantity in ["density", "flux"]: ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, population_name=pop) for quantity in ['domain', 'levelGhost', 'patchGhost']: ph.ParticleDiagnostics(quantity=quantity, compute_timestamps=timestamps, write_timestamps=timestamps, population_name=pop) for quantity in ["E", "B"]: ph.ElectromagDiagnostics( quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, )
def dump_all_diags(pops=[], flush_every=100, timestamps=None): import pyphare.pharein as ph, numpy as np sim = ph.global_vars.sim if timestamps is None: timestamps = all_timestamps(sim) ph.MetaDiagnostics( quantity="tags", write_timestamps=timestamps, compute_timestamps=timestamps, ) for quantity in ["density", "bulkVelocity"]: ph.FluidDiagnostics( quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, flush_every=flush_every, ) for pop in pops: for quantity in ["density", "flux"]: ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, flush_every=flush_every, population_name=pop) for quantity in ['domain', 'levelGhost', 'patchGhost']: ph.ParticleDiagnostics(quantity=quantity, compute_timestamps=timestamps, write_timestamps=timestamps, flush_every=flush_every, population_name=pop) for quantity in ["E", "B"]: ph.ElectromagDiagnostics( quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, flush_every=flush_every, )
def config(**options): ph.Simulation(**options) ph.MaxwellianFluidModel(bx=bx, by=by, bz=bz, protons={ "charge": 1, "density": density, **vvv }) ph.ElectronModel(closure="isothermal", Te=0.12) sim = ph.global_vars.sim timestamps = all_timestamps(sim) for quantity in ["E", "B"]: ph.ElectromagDiagnostics( quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, ) for quantity in ["density", "bulkVelocity"]: ph.FluidDiagnostics( quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, ) for pop in sim.model.populations: for quantity in ['domain']: ph.ParticleDiagnostics( quantity=quantity, compute_timestamps=timestamps[:particle_diagnostics["count"] + 1], write_timestamps=timestamps[:particle_diagnostics["count"] + 1], population_name=pop)
"charge": 1, "density": density, **vvv, "init": { "seed": 1337 } }) ElectronModel(closure="isothermal", Te=0.12) sim = ph.global_vars.sim timestamps = np.arange(0, sim.final_time + sim.time_step, 10 * sim.time_step) for quantity in ["E", "B"]: ph.ElectromagDiagnostics( quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, ) for quantity in ["density", "bulkVelocity"]: ph.FluidDiagnostics( quantity=quantity, write_timestamps=timestamps, compute_timestamps=timestamps, ) pops = [ "protons", ]