diff --git a/pyphare/pyphare/pharein/diagnostics.py b/pyphare/pyphare/pharein/diagnostics.py index 9eb5ce4e3..2721c9633 100644 --- a/pyphare/pyphare/pharein/diagnostics.py +++ b/pyphare/pyphare/pharein/diagnostics.py @@ -28,7 +28,6 @@ def wrapper(diagnostics_object, name, **kwargs): accepted_keywords = [ "path", - "compute_timestamps", "population_name", "flush_every", ] @@ -117,9 +116,11 @@ def __init__(self, name, **kwargs): self.write_timestamps = validate_timestamps( self.__class__.__name__, "write_timestamps", **kwargs ) - self.compute_timestamps = validate_timestamps( - self.__class__.__name__, "compute_timestamps", **kwargs - ) + # for now every diagnostics needing computation (like momentum tensor) + # is computing at the same time as written. + # later this parameter can evolve to allow for different timestamps + # that will depend on the type of diagnostics. + self.compute_timestamps = self.write_timestamps self.attributes = kwargs.get("attributes", {}) diff --git a/pyphare/pyphare_tests/test_pharesee/test_hierarchy.py b/pyphare/pyphare_tests/test_pharesee/test_hierarchy.py index cecfaf56f..f06d33a2c 100644 --- a/pyphare/pyphare_tests/test_pharesee/test_hierarchy.py +++ b/pyphare/pyphare_tests/test_pharesee/test_hierarchy.py @@ -145,11 +145,7 @@ def vthz(x, y): ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) return sim diff --git a/src/phare/phare_init.py b/src/phare/phare_init.py index 55afb5d4b..2c90bce3a 100644 --- a/src/phare/phare_init.py +++ b/src/phare/phare_init.py @@ -98,19 +98,11 @@ def vthz(x): for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) pops = [ "protons", diff --git a/src/phare/phare_init_small.py b/src/phare/phare_init_small.py index ce3f0db72..b4bccc1cb 100644 --- a/src/phare/phare_init_small.py +++ b/src/phare/phare_init_small.py @@ -101,19 +101,11 @@ def vthz(x): for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) pops = [ "protons", diff --git a/tests/diagnostic/__init__.py b/tests/diagnostic/__init__.py index 49ab8ef18..fb7c52d96 100644 --- a/tests/diagnostic/__init__.py +++ b/tests/diagnostic/__init__.py @@ -20,24 +20,18 @@ def dump_all_diags(pops=[], flush_every=100, timestamps=None): if timestamps is None: timestamps = all_timestamps(sim) - ph.InfoDiagnostics( - quantity="particle_count", - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.InfoDiagnostics(quantity="particle_count", write_timestamps=timestamps) # commented out because not working propertly at the moment # but we keep it there for when it does # ph.MetaDiagnostics( # quantity="tags", - # write_timestamps=timestamps, - # compute_timestamps=timestamps, + # write_timestamps=timestamps # ) for quantity in ["density", "bulkVelocity", "pressure_tensor"]: ph.FluidDiagnostics( quantity=quantity, write_timestamps=timestamps, - compute_timestamps=timestamps, flush_every=flush_every, ) @@ -46,7 +40,6 @@ def dump_all_diags(pops=[], flush_every=100, timestamps=None): ph.FluidDiagnostics( quantity=quantity, write_timestamps=timestamps, - compute_timestamps=timestamps, flush_every=flush_every, population_name=pop, ) @@ -54,7 +47,6 @@ def dump_all_diags(pops=[], flush_every=100, timestamps=None): for quantity in ["domain", "levelGhost", "patchGhost"]: ph.ParticleDiagnostics( quantity=quantity, - compute_timestamps=timestamps, write_timestamps=timestamps, flush_every=flush_every, population_name=pop, @@ -64,6 +56,5 @@ def dump_all_diags(pops=[], flush_every=100, timestamps=None): ph.ElectromagDiagnostics( quantity=quantity, write_timestamps=timestamps, - compute_timestamps=timestamps, flush_every=flush_every, ) diff --git a/tests/functional/alfven_wave/alfven_wave1d.py b/tests/functional/alfven_wave/alfven_wave1d.py index b0a864629..c7344ed17 100644 --- a/tests/functional/alfven_wave/alfven_wave1d.py +++ b/tests/functional/alfven_wave/alfven_wave1d.py @@ -91,18 +91,10 @@ def vthz(x): timestamps = all_timestamps(sim) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) return sim diff --git a/tests/functional/conservation/conserv.py b/tests/functional/conservation/conserv.py index 6e30b3dd1..8e638d153 100644 --- a/tests/functional/conservation/conserv.py +++ b/tests/functional/conservation/conserv.py @@ -83,16 +83,11 @@ def vthz(x): timestamps = np.arange(0, sim.final_time, 50 * sim.time_step) for quantity in ["B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for name in ["domain", "levelGhost", "patchGhost"]: ph.ParticleDiagnostics( quantity=name, - compute_timestamps=timestamps, write_timestamps=timestamps, population_name="protons", ) diff --git a/tests/functional/dispersion/dispersion.py b/tests/functional/dispersion/dispersion.py index 4d8a88e05..39e751c79 100644 --- a/tests/functional/dispersion/dispersion.py +++ b/tests/functional/dispersion/dispersion.py @@ -86,11 +86,7 @@ def vthz(x): timestamps = np.arange(0, sim.final_time + sim.time_step, sim.time_step) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) return sim @@ -172,18 +168,10 @@ def vthz(x): timestamps = np.arange(0, sim.final_time + sim.time_step, sim.time_step) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) return sim diff --git a/tests/functional/ionIonBeam/ion_ion_beam1d.py b/tests/functional/ionIonBeam/ion_ion_beam1d.py index 724b480ed..107b54bc4 100644 --- a/tests/functional/ionIonBeam/ion_ion_beam1d.py +++ b/tests/functional/ionIonBeam/ion_ion_beam1d.py @@ -96,18 +96,11 @@ def vth(x): timestamps = np.arange(0, sim.final_time, 0.1) for quantity in ["B", "E"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for pop_name in ["main", "beam"]: ph.ParticleDiagnostics( - quantity="domain", - population_name=pop_name, - write_timestamps=timestamps, - compute_timestamps=timestamps, + quantity="domain", population_name=pop_name, write_timestamps=timestamps ) return sim diff --git a/tests/functional/shock/shock.py b/tests/functional/shock/shock.py index 5f616ad76..7fd0a6ec2 100644 --- a/tests/functional/shock/shock.py +++ b/tests/functional/shock/shock.py @@ -105,18 +105,10 @@ def vthz(x): timestamps = dt * np.arange(nt) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) return sim diff --git a/tests/functional/td/td1d.py b/tests/functional/td/td1d.py index 45062e299..7a715a182 100644 --- a/tests/functional/td/td1d.py +++ b/tests/functional/td/td1d.py @@ -98,17 +98,12 @@ def vthz(x): timestamps = np.linspace(0, sim.final_time, n_dump) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: ph.FluidDiagnostics( quantity=quantity, write_timestamps=timestamps, - compute_timestamps=timestamps, ) return sim diff --git a/tests/functional/tdtagged/td1dtagged.py b/tests/functional/tdtagged/td1dtagged.py index 5b63273ab..fca1c374b 100644 --- a/tests/functional/tdtagged/td1dtagged.py +++ b/tests/functional/tdtagged/td1dtagged.py @@ -116,23 +116,14 @@ def config(**options): timestamps = all_timestamps(sim) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_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, ) diff --git a/tests/functional/translation/translat1d.py b/tests/functional/translation/translat1d.py index 9e41201a6..53eb7daa0 100644 --- a/tests/functional/translation/translat1d.py +++ b/tests/functional/translation/translat1d.py @@ -85,18 +85,10 @@ def vthz(x): timestamps = all_timestamps(sim) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) return sim @@ -188,18 +180,10 @@ def vthz(x): timestamps = all_timestamps(sim) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) return sim diff --git a/tests/simulator/refinement/test_2d_10_core.py b/tests/simulator/refinement/test_2d_10_core.py index 07345cb92..dfb88703a 100644 --- a/tests/simulator/refinement/test_2d_10_core.py +++ b/tests/simulator/refinement/test_2d_10_core.py @@ -99,18 +99,10 @@ def vthz(x, y): timestamps = dt * np.arange(nt) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) return sim diff --git a/tests/simulator/refinement/test_2d_2_core.py b/tests/simulator/refinement/test_2d_2_core.py index d7ceae427..af017f60c 100644 --- a/tests/simulator/refinement/test_2d_2_core.py +++ b/tests/simulator/refinement/test_2d_2_core.py @@ -99,18 +99,10 @@ def vthz(x, y): timestamps = dt * np.arange(nt) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: - ph.FluidDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps) return sim diff --git a/tests/simulator/test_advance.py b/tests/simulator/test_advance.py index 7fedf997f..569f2c873 100644 --- a/tests/simulator/test_advance.py +++ b/tests/simulator/test_advance.py @@ -150,17 +150,12 @@ def vthz(*xyz): timestamps = all_timestamps(global_vars.sim) for quantity in ["E", "B"]: - ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) for quantity in ["density", "bulkVelocity"]: FluidDiagnostics( quantity=quantity, write_timestamps=timestamps, - compute_timestamps=timestamps, ) poplist = ["protons"] @@ -169,14 +164,12 @@ def vthz(*xyz): FluidDiagnostics( quantity=quantity, write_timestamps=timestamps, - compute_timestamps=timestamps, population_name=pop, ) for quantity in ["domain", "levelGhost", "patchGhost"]: ParticleDiagnostics( quantity=quantity, - compute_timestamps=timestamps, write_timestamps=timestamps, population_name=pop, ) diff --git a/tests/simulator/test_diagnostic_timestamps.py b/tests/simulator/test_diagnostic_timestamps.py index c0c34c4ad..d5271b3a6 100644 --- a/tests/simulator/test_diagnostic_timestamps.py +++ b/tests/simulator/test_diagnostic_timestamps.py @@ -117,7 +117,6 @@ def test_dump_diags_timestamps(self): ElectromagDiagnostics( quantity=quantity, write_timestamps=timestamps, - compute_timestamps=timestamps, flush_every=ElectromagDiagnostics.h5_flush_never, ) @@ -162,7 +161,6 @@ def test_hierarchy_timestamp_cadence(self, refinement_boxes): ElectromagDiagnostics( quantity=quantity, write_timestamps=timestamps, - compute_timestamps=timestamps, flush_every=ElectromagDiagnostics.h5_flush_never, ) diff --git a/tests/simulator/test_initialization.py b/tests/simulator/test_initialization.py index 9f4ed8ec4..2ea135909 100644 --- a/tests/simulator/test_initialization.py +++ b/tests/simulator/test_initialization.py @@ -167,16 +167,12 @@ def vthz(*xyz): for quantity in ["E", "B"]: ElectromagDiagnostics( - quantity=quantity, - write_timestamps=np.zeros(time_step_nbr), - compute_timestamps=np.zeros(time_step_nbr), + quantity=quantity, write_timestamps=np.zeros(time_step_nbr) ) for quantity in ["density", "bulkVelocity"]: FluidDiagnostics( - quantity=quantity, - write_timestamps=np.zeros(time_step_nbr), - compute_timestamps=np.zeros(time_step_nbr), + quantity=quantity, write_timestamps=np.zeros(time_step_nbr) ) poplist = ["protons", "beam"] if beam else ["protons"] @@ -185,14 +181,12 @@ def vthz(*xyz): FluidDiagnostics( quantity=quantity, write_timestamps=np.zeros(time_step_nbr), - compute_timestamps=np.zeros(time_step_nbr), population_name=pop, ) for quantity in ["domain", "levelGhost", "patchGhost"]: ParticleDiagnostics( quantity=quantity, - compute_timestamps=np.zeros(time_step_nbr), write_timestamps=np.zeros(time_step_nbr), population_name=pop, ) diff --git a/tools/bench/real/bench_harris.py b/tools/bench/real/bench_harris.py index 554e2ce67..3f50c5fb8 100644 --- a/tools/bench/real/bench_harris.py +++ b/tools/bench/real/bench_harris.py @@ -1,85 +1,131 @@ - - import numpy as np -from pyphare.cpp import cpp_lib # must be first +from pyphare.cpp import cpp_lib # must be first + cpp_lib("pybindlibs.cpp_sim_2_1_4") import pyphare.pharein as ph seed = 133333333337 -cells, dl = 100, .2 -patch_sizes = [50,100] -diag_outputs="tools/bench/real/harris/outputs" +cells, dl = 100, 0.2 +patch_sizes = [50, 100] +diag_outputs = "tools/bench/real/harris/outputs" + def density(x, y): L = ph.global_vars.sim.simulation_domain()[1] - return 0.2 + 1./np.cosh((y-L*0.3)/0.5)**2 + 1./np.cosh((y-L*0.7)/0.5)**2 + return ( + 0.2 + + 1.0 / np.cosh((y - L * 0.3) / 0.5) ** 2 + + 1.0 / np.cosh((y - L * 0.7) / 0.5) ** 2 + ) + def by(x, y): sim = ph.global_vars.sim Lx = sim.simulation_domain()[0] Ly = sim.simulation_domain()[1] w1, w2 = 0.2, 1.0 - x0 = (x - 0.5 * Lx) - y1 = (y - 0.3 * Ly) - y2 = (y - 0.7 * Ly) - w3 = np.exp(-(x0*x0 + y1*y1) / (w2*w2)) - w4 = np.exp(-(x0*x0 + y2*y2) / (w2*w2)) - w5 = 2.0*w1/w2 - return (w5 * x0 * w3) + ( -w5 * x0 * w4) - -def S(y, y0, l): return 0.5*(1. + np.tanh((y-y0)/l)) + x0 = x - 0.5 * Lx + y1 = y - 0.3 * Ly + y2 = y - 0.7 * Ly + w3 = np.exp(-(x0 * x0 + y1 * y1) / (w2 * w2)) + w4 = np.exp(-(x0 * x0 + y2 * y2) / (w2 * w2)) + w5 = 2.0 * w1 / w2 + return (w5 * x0 * w3) + (-w5 * x0 * w4) + + +def S(y, y0, l): + return 0.5 * (1.0 + np.tanh((y - y0) / l)) + + def bx(x, y): sim = ph.global_vars.sim Lx = sim.simulation_domain()[0] Ly = sim.simulation_domain()[1] w1, w2 = 0.2, 1.0 - x0 = (x - 0.5 * Lx) - y1 = (y - 0.3 * Ly) - y2 = (y - 0.7 * Ly) - w3 = np.exp(-(x0*x0 + y1*y1) / (w2*w2)) - w4 = np.exp(-(x0*x0 + y2*y2) / (w2*w2)) - w5 = 2.0*w1/w2 - v1, v2 = -1, 1. - return v1 + (v2-v1)*(S(y,Ly*0.3,0.5) -S(y, Ly*0.7, 0.5)) + (-w5*y1*w3) + (+w5*y2*w4) - -def bz(x, y): return 0. -def b2(x, y): return bx(x,y)**2 + by(x, y)**2 + bz(x, y)**2 -def T(x, y): return 1./density(x, y)*(1 - b2(x, y)*0.5) -def vxyz(x, y): return 0. -def vthxyz(x, y): return np.sqrt(T(x, y)) + x0 = x - 0.5 * Lx + y1 = y - 0.3 * Ly + y2 = y - 0.7 * Ly + w3 = np.exp(-(x0 * x0 + y1 * y1) / (w2 * w2)) + w4 = np.exp(-(x0 * x0 + y2 * y2) / (w2 * w2)) + w5 = 2.0 * w1 / w2 + v1, v2 = -1, 1.0 + return ( + v1 + + (v2 - v1) * (S(y, Ly * 0.3, 0.5) - S(y, Ly * 0.7, 0.5)) + + (-w5 * y1 * w3) + + (+w5 * y2 * w4) + ) + + +def bz(x, y): + return 0.0 + + +def b2(x, y): + return bx(x, y) ** 2 + by(x, y) ** 2 + bz(x, y) ** 2 + + +def T(x, y): + return 1.0 / density(x, y) * (1 - b2(x, y) * 0.5) + + +def vxyz(x, y): + return 0.0 + + +def vthxyz(x, y): + return np.sqrt(T(x, y)) + def config(): - ph.Simulation(# strict=True, - smallest_patch_size=patch_sizes[0], largest_patch_size=patch_sizes[1], - time_step_nbr=10, time_step=0.001, - cells=[cells] * 2, dl=[dl] * 2, - resistivity=0.001, hyper_resistivity=0.001, - diag_options={"format": "phareh5", "options": {"dir": diag_outputs, "mode":"overwrite"}}, + ph.Simulation( # strict=True, + smallest_patch_size=patch_sizes[0], + largest_patch_size=patch_sizes[1], + time_step_nbr=10, + time_step=0.001, + cells=[cells] * 2, + dl=[dl] * 2, + resistivity=0.001, + hyper_resistivity=0.001, + diag_options={ + "format": "phareh5", + "options": {"dir": diag_outputs, "mode": "overwrite"}, + }, refinement_boxes={}, ) - ph.MaxwellianFluidModel( bx=bx, by=by, bz=bz, - protons={"charge": 1, "density": density, "init":{"seed": seed}, - **{ "nbr_part_per_cell":100, - "vbulkx": vxyz, "vbulky": vxyz, "vbulkz": vxyz, - "vthx": vthxyz, "vthy": vthxyz, "vthz": vthxyz, - } + ph.MaxwellianFluidModel( + bx=bx, + by=by, + bz=bz, + protons={ + "charge": 1, + "density": density, + "init": {"seed": seed}, + **{ + "nbr_part_per_cell": 100, + "vbulkx": vxyz, + "vbulky": vxyz, + "vbulkz": vxyz, + "vthx": vthxyz, + "vthy": vthxyz, + "vthz": vthxyz, + }, }, ) ph.ElectronModel(closure="isothermal", Te=0.0) from tests.diagnostic import all_timestamps + timestamps = all_timestamps(ph.global_vars.sim) timestamps = np.asarray([timestamps[0], timestamps[-1]]) for quantity in ["E", "B"]: - ph.ElectromagDiagnostics( - quantity=quantity, - write_timestamps=timestamps, - compute_timestamps=timestamps, - ) + ph.ElectromagDiagnostics(quantity=quantity, write_timestamps=timestamps) + -if ph.PHARE_EXE or __name__=="__main__": +if ph.PHARE_EXE or __name__ == "__main__": config() -if __name__=="__main__": +if __name__ == "__main__": from pyphare.simulator.simulator import Simulator + Simulator(ph.global_vars.sim).run()