Custom warp disc simulation#

This simple example shows how to run a simulation of a disc with a custom initial warp

 9 import numpy as np
10
11 import shamrock
12
13 # If we use the shamrock executable to run this script instead of the python interpreter,
14 # we should not initialize the system as the shamrock executable needs to handle specific MPI logic
15 if not shamrock.sys.is_initialized():
16     shamrock.change_loglevel(1)
17     shamrock.sys.init("0:0")

Use shamrock documentation style for matplotlib

22 shamrock.matplotlib.set_shamrock_mpl_style()

Setup units

28 si = shamrock.UnitSystem()
29 sicte = shamrock.Constants(si)
30 codeu = shamrock.UnitSystem(
31     unit_time=3600 * 24 * 365,
32     unit_length=sicte.au(),
33     unit_mass=sicte.sol_mass(),
34 )
35 ucte = shamrock.Constants(codeu)
36 G = ucte.G()

List parameters

 42 # Resolution
 43 Npart = 1000000
 44
 45 # Sink parameters
 46 center_mass = 1.0
 47 center_racc = 0.1
 48
 49 # Disc parameter
 50 disc_mass = 0.01  # sol mass
 51 rout = 60.0  # au
 52 rin = 1.0  # au
 53 H_r_0 = 0.05
 54 q = 0.5
 55 p = 3.0 / 2.0
 56 r0 = 1.0
 57
 58 # Viscosity parameter
 59 alpha_AV = 1.0e-3 / 0.08
 60 alpha_u = 1.0
 61 beta_AV = 2.0
 62
 63 # Integrator parameters
 64 C_cour = 0.3
 65 C_force = 0.25
 66
 67 # Warp parameters
 68 inclination = 30.0
 69
 70
 71 # Disc profiles
 72 def sigma_profile(r):
 73     sigma_0 = 1.0  # We do not care as it will be renormalized
 74     return sigma_0 * (r / r0) ** (-p)
 75
 76
 77 def kep_profile(r):
 78     return (G * center_mass / r) ** 0.5
 79
 80
 81 def omega_k(r):
 82     return kep_profile(r) / r
 83
 84
 85 def cs_profile(r):
 86     cs_in = (H_r_0 * r0) * omega_k(r0)
 87     return ((r / r0) ** (-q)) * cs_in
 88
 89
 90 def inc_profile(r):  # profile of the inclination angle
 91     if r < 10.0:
 92         effective_inc = 0.0
 93     elif r < 30.0 and r > 10:
 94         lx = 0.1 * (1.0 + np.sin((r - 20) * np.pi / 20.0))
 95         lz = np.sqrt(1 - lx * lx)
 96         effective_inc = np.arccos(lz)
 97
 98     else:
 99         lx = 0.2
100         lz = np.sqrt(1 - lx * lx)
101         effective_inc = np.arccos(lz)
102
103     return effective_inc
104
105
106 def psi_profile(r):
107     return 0.0
108
109
110 def k_profile(r):  # profile of the warp direction
111     incl_rad = inc_profile(r) * np.pi / 180.0
112     return (0.0, np.cos(incl_rad), np.sin(incl_rad))

Utility functions and quantities deduced from the base one

118 # Deduced quantities
119 pmass = disc_mass / Npart
120 bmin = (-rout * 2, -rout * 2, -rout * 2)
121 bmax = (rout * 2, rout * 2, rout * 2)
122
123 cs0 = cs_profile(r0)
124
125
126 def rot_profile(r):
127     return ((kep_profile(r) ** 2) - (2 * p + q) * cs_profile(r) ** 2) ** 0.5
128
129
130 def H_profile(r):
131     H = cs_profile(r) / omega_k(r)
132     # fact = (2.**0.5) * 3. # factor taken from phantom, to fasten thermalizing
133     fact = 1.0
134     return fact * H

Start the context The context holds the data of the code We then init the layout of the field (e.g. the list of fields used by the solver)

Attach a SPH model to the data and configure it

148 model = shamrock.get_Model_SPH(context=ctx, vector_type="f64_3", sph_kernel="M4")
149
150 # Generate the default config
151 cfg = model.gen_default_config()
152 # Use disc alpha model viscosity
153 cfg.set_artif_viscosity_ConstantDisc(alpha_u=alpha_u, alpha_AV=alpha_AV, beta_AV=beta_AV)
154 # use the Lodato Price 2007 equation of state
155 cfg.set_eos_locally_isothermalLP07(cs0=cs0, q=q, r0=r0)
156 # Use the given code units
157 cfg.set_units(codeu)
158 # Change particle mass
159 cfg.set_particle_mass(pmass)
160 # Set the CFL
161 cfg.set_cfl_cour(C_cour)
162 cfg.set_cfl_force(C_force)
163
164 # Set the solver config to be the one stored in cfg
165 model.set_solver_config(cfg)
166
167 # Print the solver config
168 model.get_current_config().print_status()
169
170 # We want the patches to split above 10^8 part and merge if smaller than 1 part (e.g. disable patch)
171 model.init_scheduler(int(1e8), 1)
172
173 # Set the simulation box size
174 model.resize_simulation_box(bmin, bmax)
----- SPH Solver configuration -----
[
    {
        "artif_viscosity": {
            "alpha_AV": 0.0125,
            "alpha_u": 1.0,
            "beta_AV": 2.0,
            "type": "constant_disc"
        },
        "boundary_config": {
            "bc_type": "free"
        },
        "cfl_config": {
            "cfl_cour": 0.3,
            "cfl_force": 0.25,
            "cfl_multiplier_stiffness": 2.0,
            "eta_sink": 0.05
        },
        "combined_dtdiv_divcurlv_compute": false,
        "debug_dump_filename": "",
        "do_debug_dump": false,
        "dust_config": {
            "ballabio_ts_limiter": false,
            "drag_mode": {
                "type": "none"
            },
            "evol_mode": {
                "type": "none"
            },
            "mode": {
                "type": "none"
            }
        },
        "enable_particle_reordering": false,
        "eos_config": {
            "Tvec": "f64_3",
            "cs0": 0.31394308776061347,
            "eos_type": "locally_isothermal_lp07",
            "q": 0.5,
            "r0": 1.0
        },
        "epsilon_h": 1e-06,
        "ext_force_config": {
            "force_list": []
        },
        "gpart_mass": 1e-08,
        "h_iter_per_subcycles": 50,
        "h_max_subcycles_count": 100,
        "htol_up_coarse_cycle": 1.1,
        "htol_up_fine_cycle": 1.1,
        "kernel_id": "M4<f64>",
        "mhd_config": {
            "mhd_type": "none"
        },
        "neigh_cache_strategy": "two_stage",
        "particle_killing": [],
        "particle_reordering_step_freq": 1000,
        "save_dt_to_fields": false,
        "scheduler_config": {
            "merge_load_value": 0,
            "split_load_value": 0
        },
        "self_grav_config": {
            "softening_length": 1e-09,
            "softening_mode": "plummer",
            "type": "none"
        },
        "show_cfl_detail": false,
        "show_ghost_stats": false,
        "show_ghost_zone_graph": false,
        "show_neigh_stats": false,
        "smoothing_length_config": {
            "type": "density_based"
        },
        "tree_reduction_level": 3,
        "type_id": "sycl::vec<f64,3>",
        "unit_sys": {
            "unit_current": 1.0,
            "unit_length": 149597870700.0,
            "unit_lumint": 1.0,
            "unit_mass": 1.98847e+30,
            "unit_qte": 1.0,
            "unit_temperature": 1.0,
            "unit_time": 31536000.0
        }
    }
]
------------------------------------

Add the sink particle

179 # null position and velocity
180 model.add_sink(center_mass, (0, 0, 0), (0, 0, 0), center_racc)

Create the setup

185 setup = model.get_setup()
186 gen_disc = setup.make_generator_disc_mc(
187     part_mass=pmass,
188     disc_mass=disc_mass,
189     r_in=rin,
190     r_out=rout,
191     sigma_profile=sigma_profile,
192     H_profile=H_profile,
193     rot_profile=rot_profile,
194     cs_profile=cs_profile,
195     random_seed=666,
196 )
197
198 # apply the custom warp
199 warp = setup.make_modifier_custom_warp(
200     parent=gen_disc,
201     inc_profile=inc_profile,
202     psi_profile=psi_profile,
203     k_profile=k_profile,
204 )
205 # Show the dot graph of the setup
206 shamrock.utils.plot.DotGraph(warp.get_dot())
Warning: make_generator_disc_mc: with the current EOS, cs_profile is ignored     [SPHSetup][rank=0]
G node_0 GeneratorMCDisc node_1 ApplyCustomWarp node_0->node_1 node_3 Simulation node_1->node_3


Apply the setup

SPH setup: generating particles ...
SPH setup: Nstep = 1000000 ( 1.0e+06 ) Ntotal = 1000000 ( 1.0e+06 rank min = 1.4e+05 max = 1.0e+06) rate = 1.000000e+06 N.s^-1
SPH setup: the generation step took : 7.127915168 s
SPH setup: final particle count = 1000000 beginning injection ...
Info: ---------------------------------------------                   [DataInserterUtility][rank=0]
Info: Compute load ...                                                [DataInserterUtility][rank=0]
Info: run scheduler step ...                                          [DataInserterUtility][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 9.69 us    (57.9%)
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 801.00 ns  (0.2%)
   patch tree reduce : 1.96 us    (0.5%)
   gen split merge   : 901.00 ns  (0.2%)
   split / merge op  : 0/0
   apply split merge : 1.04 us    (0.3%)
   LB compute        : 396.15 us  (95.7%)
   LB move op cnt    : 0
   LB apply          : 10.06 us   (2.4%)
Info: patch count stable after 1 runs npatch = 1                      [DataInserterUtility][rank=0]
Info: ---------------------------------------------                   [DataInserterUtility][rank=0]
SPH setup: injected      1000000 / 1000000 => 100.0% | ranks with patchs = 1 / 1  <- global loop -> (msg count : 0)
SPH setup: the injection step took : 0.074872928 s
Info: injection perf report:                                                    [SPH setup][rank=0]
+======+====================+=======+=============+=============+=============+
| rank | rank get (sum/max) |  MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+====================+=======+=============+=============+=============+
| 0    |      0.00s / 0.00s | 0.00s |  15.4% 0.0% |   456.18 MB |     5.29 MB |
+------+--------------------+-------+-------------+-------------+-------------+
SPH setup: the setup took : 7.367645832000001 s

Run a single step to init the integrator and smoothing length of the particles Here the htolerance is the maximum factor of evolution of the smoothing length in each Smoothing length iterations, increasing it affect the performance negatively but increase the convergence rate of the smoothing length this is why we increase it temporely to 1.3 before lowering it back to 1.1 (default value) Note that both change_htolerance can be removed and it will work the same but would converge more slowly at the first timestep

Warning: .change_htolerance(val) is deprecated,                                       [SPH][rank=0]
    -> calling this is replaced internally by .change_htolerances(coarse=val, fine=min(val, 1.1))
    see: https://shamrock-code.github.io/Shamrock/sphinx/user_guide/sph/smoothing_length_tolerance.html
---------------- t = 0, dt = 0 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 29.29 us   (1.7%)
   patch tree reduce : 1.78 us    (0.1%)
   gen split merge   : 1.04 us    (0.1%)
   split / merge op  : 0/0
   apply split merge : 1.29 us    (0.1%)
   LB compute        : 1.63 ms    (96.3%)
   LB move op cnt    : 0
   LB apply          : 11.32 us   (0.7%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 2.73 us    (68.2%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 0.7775978704697806 unconverged cnt = 1000000
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 1.0108772316107149 unconverged cnt = 1000000
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 1.3141404010939293 unconverged cnt = 1000000
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 1.708382521422108 unconverged cnt = 999997
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 2.2208972778487404 unconverged cnt = 999992
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 2.8871664612033627 unconverged cnt = 999979
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 3.7533163995643717 unconverged cnt = 999940
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 4.8793113194336835 unconverged cnt = 999759
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 5.60072695248765 unconverged cnt = 997175
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 5.600726952487574 unconverged cnt = 959603
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 5.600726952487574 unconverged cnt = 869013
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 5.600726952487574 unconverged cnt = 734494
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 5.600726952487574 unconverged cnt = 535905
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 5.600726952487574 unconverged cnt = 248906
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 5.600726952487574 unconverged cnt = 14902
Warning: smoothing length is not converged, rerunning the iterator ...    [Smoothinglength][rank=0]
     largest h = 5.600726952487574 unconverged cnt = 90
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.6712812663812948e-05,-3.742357660784763e-05,-5.166862748633276e-07)
    sum a = (3.4423418976414766e-18,2.371692252312041e-19,-5.124549330888517e-20)
    sum e = 0.025169119456899564
    sum de = -1.2341534739291173e-21
Info: cfl dt = 4.7490971617325104e-05 cfl multiplier : 0.01                    [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 2.4313e+04 | 1000000 |      1 | 4.113e+01 | 0.0% |   0.7% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0 (tsim/hr)                                             [sph::Model][rank=0]
Warning: .change_htolerance(val) is deprecated,                                       [SPH][rank=0]
    -> calling this is replaced internally by .change_htolerances(coarse=val, fine=min(val, 1.1))
    see: https://shamrock-code.github.io/Shamrock/sphinx/user_guide/sph/smoothing_length_tolerance.html

Manipulating the simulation#

Dump files (path relative to where you have started shamrock)

230 dump_folder = "_to_trash"
231 import os
232
233 os.system("mkdir -p " + dump_folder)
234
235 # VTK dump
236 model.do_vtk_dump(dump_folder + "/init_disc.vtk", True)
237
238 # Shamrock restart dump files
239 model.dump(dump_folder + "/init_disc.sham")
240
241 # Phantom dump
242 dump = model.make_phantom_dump()
243 dump.save_dump(dump_folder + "/init_disc.phdump")
Info: dump to _to_trash/init_disc.vtk                                            [VTK Dump][rank=0]
              - took 183.77 ms, bandwidth = 304.73 MB/s
Info: Dumping state to _to_trash/init_disc.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 9.43 us    (53.3%)
Info: dump to _to_trash/init_disc.sham                                      [Shamrock Dump][rank=0]
              - took 47.55 ms, bandwidth = 2.52 GB/s

Single timestep

---------------- t = 0, dt = 4.7490971617325104e-05 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 25.29 us   (6.0%)
   patch tree reduce : 2.03 us    (0.5%)
   gen split merge   : 721.00 ns  (0.2%)
   split / merge op  : 0/0
   apply split merge : 1.01 us    (0.2%)
   LB compute        : 368.12 us  (87.4%)
   LB move op cnt    : 0
   LB apply          : 10.05 us   (2.4%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 2.40 us    (77.2%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.67143331806908e-05,-3.74225111336857e-05,-5.166681845096556e-07)
    sum a = (-3.0357660829594124e-18,-1.3755815063409838e-18,2.2742834633777964e-19)
    sum e = 0.025169119830561946
    sum de = 1.1393748811764762e-07
Info: cfl dt = 0.0016152539232253246 cfl multiplier : 0.34                     [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.6774e+05 | 1000000 |      1 | 5.962e+00 | 0.0% |   0.2% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.02867743923687339 (tsim/hr)                           [sph::Model][rank=0]
Info: iteration since start : 2                                                       [SPH][rank=0]
Info: time since start : 842.081478317 (s)                                            [SPH][rank=0]

Evolve until a given time (code units)

251 model.evolve_until(0.001)
Info: evolve_until (target_time = 0.00s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
---------------- t = 4.7490971617325104e-05, dt = 0.0009525090283826749 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 24.23 us   (5.9%)
   patch tree reduce : 1.83 us    (0.4%)
   gen split merge   : 561.00 ns  (0.1%)
   split / merge op  : 0/0
   apply split merge : 1.03 us    (0.3%)
   LB compute        : 358.42 us  (87.3%)
   LB move op cnt    : 0
   LB apply          : 11.25 us   (2.7%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 2.36 us    (72.6%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.6743304208499407e-05,-3.7402203016346896e-05,-5.163234432154217e-07)
    sum a = (-3.0086610286472748e-18,1.3755815063409838e-18,-5.929230630780102e-21)
    sum e = 0.025169269879472565
    sum de = 2.3968380395134876e-06
Info: cfl dt = 0.002671641473738393 cfl multiplier : 0.56                      [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.6242e+05 | 1000000 |      1 | 6.157e+00 | 0.0% |   0.3% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.5569395612416648 (tsim/hr)                            [sph::Model][rank=0]
Info: iteration since start : 3                                                       [SPH][rank=0]
Info: time since start : 848.6543391890001 (s)                                        [SPH][rank=0]

EvolveUntilResults(reach_target_time=true, reach_niter_max=false, reach_max_walltime=false, iter_count=1)

Get the sinks positions

255 print(model.get_sinks())
[{'pos': (-3.201206156553457e-11, -2.2439065661204272e-11, -3.809220013773858e-13), 'velocity': (-6.392534197996244e-08, -4.495361606348588e-08, -7.618398501202511e-10), 'sph_acceleration': (-6.381673499629233e-05, -4.5036609238485616e-05, -7.618352831499709e-07), 'ext_acceleration': (0.0, 0.0, 0.0), 'mass': 1.0, 'angular_momentum': (0.0, 0.0, 0.0), 'accretion_radius': 0.1}]

Get the fields as python dictionary of numpy arrays

Warning

Do not do this on a large distributed simulation as this gather all data on MPI rank 0 and will use a lot of memory (and crash if the simulation is too large)

265 print(ctx.collect_data())
Info: collected : 1 patches                                                [PatchScheduler][rank=0]
{'xyz': array([[-3.48265920e+01, -4.92137431e+01, -5.52990309e-01],
       [-3.41072603e+01, -4.96717706e+01, -1.12823864e+00],
       [-3.58899844e+01, -4.83668072e+01, -5.08998155e-01],
       ...,
       [ 3.73373919e+01,  4.66978318e+01,  4.27278815e-02],
       [ 3.58954981e+01,  4.86526728e+01,  6.71420488e-01],
       [ 3.39967977e+01,  4.94338653e+01,  1.83425787e-03]],
      shape=(1000000, 3)), 'vxyz': array([[ 0.65146781, -0.45952541, -0.1329461 ],
       [ 0.6588856 , -0.44937258, -0.13446085],
       [ 0.64160958, -0.47472203, -0.13093287],
       ...,
       [-0.62611179,  0.50049394,  0.12776743],
       [-0.64191989,  0.47179621,  0.13099606],
       [-0.6579132 ,  0.45245885,  0.13426352]], shape=(1000000, 3)), 'axyz': array([[ 0.00608901,  0.00735605, -0.00118777],
       [ 0.00625498,  0.00783478, -0.00109351],
       [ 0.00529934,  0.0080356 , -0.00118868],
       ...,
       [-0.00591417, -0.00809715,  0.00119302],
       [-0.00563759, -0.00789741,  0.00089908],
       [-0.00491752, -0.00797435,  0.00220641]], shape=(1000000, 3)), 'axyz_ext': array([[ 6.26443893e-03,  8.85233009e-03,  9.94692222e-05],
       [ 6.14348081e-03,  8.94699740e-03,  2.03221026e-04],
       [ 6.47572511e-03,  8.72695136e-03,  9.18398876e-05],
       ...,
       [-6.88705633e-03, -8.61363319e-03, -7.88135731e-06],
       [-6.40160619e-03, -8.67672181e-03, -1.19741187e-04],
       [-6.20638229e-03, -9.02454018e-03, -3.34858174e-07]],
      shape=(1000000, 3)), 'hpart': array([2.13018117, 2.52393813, 2.11833078, ..., 2.27821443, 2.58657728,
       1.83204166], shape=(1000000,)), 'uint': array([ 4.10774946e-09,  3.62409274e-09,  1.73155931e-09, ...,
       -2.92231455e-09,  4.48182890e-09,  3.88103690e-09],
      shape=(1000000,)), 'duint': array([ 4.10648752e-06,  3.62365656e-06,  1.73050885e-06, ...,
       -2.92235594e-06,  4.48156636e-06,  3.87908362e-06],
      shape=(1000000,))}

Performing a timestep loop

269 dt_stop = 0.001
270 for i in range(10):
271     t_target = i * dt_stop
272     # skip if the model is already past the target
273     if model.get_time() > t_target:
274         continue
275
276     model.evolve_until(i * dt_stop)
277
278     # Dump name is "dump_xxxx.sham" where xxxx is the timestep
279     model.dump(dump_folder + f"/dump_{i:04}.sham")
Info: evolve_until (target_time = 0.00s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
Info: iteration since start : 3                                                       [SPH][rank=0]
Info: time since start : 850.275985988 (s)                                            [SPH][rank=0]
Info: Dumping state to _to_trash/dump_0001.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 20.63 us   (67.7%)
Info: dump to _to_trash/dump_0001.sham                                      [Shamrock Dump][rank=0]
              - took 99.31 ms, bandwidth = 1.21 GB/s
Info: evolve_until (target_time = 0.00s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
---------------- t = 0.001, dt = 0.001 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 10.63 us   (2.4%)
   patch tree reduce : 2.19 us    (0.5%)
   gen split merge   : 971.00 ns  (0.2%)
   split / merge op  : 0/0
   apply split merge : 1.04 us    (0.2%)
   LB compute        : 405.49 us  (92.5%)
   LB move op cnt    : 0
   LB apply          : 11.31 us   (2.6%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 1.72 us    (71.1%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.6744721031310468e-05,-3.740105830322602e-05,-5.163053572216787e-07)
    sum a = (6.369687763352339e-19,-3.855693975901575e-18,-4.648093298057973e-20)
    sum e = 0.02516928868859485
    sum de = 4.794670819265796e-06
Info: cfl dt = 0.003377144283973414 cfl multiplier : 0.7066666666666667        [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.5957e+05 | 1000000 |      1 | 6.267e+00 | 0.0% |   0.4% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.574434439045202 (tsim/hr)                             [sph::Model][rank=0]
Info: iteration since start : 4                                                       [SPH][rank=0]
Info: time since start : 856.700457267 (s)                                            [SPH][rank=0]
Info: Dumping state to _to_trash/dump_0002.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 8.85 us    (61.7%)
Info: dump to _to_trash/dump_0002.sham                                      [Shamrock Dump][rank=0]
              - took 98.00 ms, bandwidth = 1.22 GB/s
Info: evolve_until (target_time = 0.00s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
---------------- t = 0.002, dt = 0.001 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 10.07 us   (3.0%)
   patch tree reduce : 2.00 us    (0.6%)
   gen split merge   : 791.00 ns  (0.2%)
   split / merge op  : 0/0
   apply split merge : 981.00 ns  (0.3%)
   LB compute        : 291.05 us  (86.3%)
   LB move op cnt    : 0
   LB apply          : 3.93 us    (1.2%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 1.91 us    (69.9%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.674461211131213e-05,-3.7400975836242643e-05,-5.16305372886304e-07)
    sum a = (3.9979955110402976e-18,2.4191260973582818e-18,-1.2885488710106044e-19)
    sum e = 0.02516929465030813
    sum de = 7.193176865621702e-06
Info: cfl dt = 0.00385612062581467 cfl multiplier : 0.8044444444444444         [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.6755e+05 | 1000000 |      1 | 5.968e+00 | 0.0% |   0.3% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.6031697441636078 (tsim/hr)                            [sph::Model][rank=0]
Info: iteration since start : 5                                                       [SPH][rank=0]
Info: time since start : 862.8247863900001 (s)                                        [SPH][rank=0]
Info: Dumping state to _to_trash/dump_0003.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 9.81 us    (63.5%)
Info: dump to _to_trash/dump_0003.sham                                      [Shamrock Dump][rank=0]
              - took 99.94 ms, bandwidth = 1.20 GB/s
Info: evolve_until (target_time = 0.00s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
---------------- t = 0.003, dt = 0.001 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 9.84 us    (3.1%)
   patch tree reduce : 2.32 us    (0.7%)
   gen split merge   : 801.00 ns  (0.3%)
   split / merge op  : 0/0
   apply split merge : 1.16 us    (0.4%)
   LB compute        : 294.24 us  (92.2%)
   LB move op cnt    : 0
   LB apply          : 4.23 us    (1.3%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 1.84 us    (73.0%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.6744502873649244e-05,-3.740089390928046e-05,-5.163053999244166e-07)
    sum a = (-1.6940658945086007e-18,4.899238566918873e-18,3.7269449679189215e-20)
    sum e = 0.025169303011205943
    sum de = 9.592169893413152e-06
Info: cfl dt = 0.004187011482181698 cfl multiplier : 0.8696296296296296        [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.7010e+05 | 1000000 |      1 | 5.879e+00 | 0.0% |   0.4% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.6123779528996295 (tsim/hr)                            [sph::Model][rank=0]
Info: iteration since start : 6                                                       [SPH][rank=0]
Info: time since start : 868.8623745900001 (s)                                        [SPH][rank=0]
Info: Dumping state to _to_trash/dump_0004.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 10.63 us   (67.2%)
Info: dump to _to_trash/dump_0004.sham                                      [Shamrock Dump][rank=0]
              - took 98.18 ms, bandwidth = 1.22 GB/s
Info: evolve_until (target_time = 0.01s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
---------------- t = 0.004, dt = 0.001 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 8.56 us    (2.8%)
   patch tree reduce : 1.80 us    (0.6%)
   gen split merge   : 922.00 ns  (0.3%)
   split / merge op  : 0/0
   apply split merge : 971.00 ns  (0.3%)
   LB compute        : 282.10 us  (92.8%)
   LB move op cnt    : 0
   LB apply          : 3.57 us    (1.2%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 1.15 us    (63.9%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.6744393320943846e-05,-3.740081252399747e-05,-5.163054383569792e-07)
    sum a = (3.1170812458958252e-19,6.708500942254059e-19,1.2366681029912785e-19)
    sum e = 0.025169313770556905
    sum de = 1.1991648738678812e-05
Info: cfl dt = 0.0044212910309406545 cfl multiplier : 0.9130864197530864       [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.6681e+05 | 1000000 |      1 | 5.995e+00 | 0.0% |   0.2% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.6004987659681135 (tsim/hr)                            [sph::Model][rank=0]
Info: iteration since start : 7                                                       [SPH][rank=0]
Info: time since start : 875.0099508200001 (s)                                        [SPH][rank=0]
Info: Dumping state to _to_trash/dump_0005.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 8.62 us    (61.1%)
Info: dump to _to_trash/dump_0005.sham                                      [Shamrock Dump][rank=0]
              - took 104.18 ms, bandwidth = 1.15 GB/s
Info: evolve_until (target_time = 0.01s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
---------------- t = 0.005, dt = 0.001 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 10.25 us   (3.8%)
   patch tree reduce : 2.30 us    (0.8%)
   gen split merge   : 1.06 us    (0.4%)
   split / merge op  : 0/0
   apply split merge : 941.00 ns  (0.3%)
   LB compute        : 246.99 us  (91.0%)
   LB move op cnt    : 0
   LB apply          : 3.84 us    (1.4%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 1.45 us    (68.4%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.6744283455810494e-05,-3.7400731682023185e-05,-5.163054882076393e-07)
    sum a = (2.168404344971009e-19,9.012430558785756e-19,2.602508730438838e-19)
    sum e = 0.025169326928391158
    sum de = 1.4391610205310937e-05
Info: cfl dt = 0.004592921852594342 cfl multiplier : 0.9420576131687243        [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.6967e+05 | 1000000 |      1 | 5.894e+00 | 0.0% |   0.6% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.6108166703191835 (tsim/hr)                            [sph::Model][rank=0]
Info: iteration since start : 8                                                       [SPH][rank=0]
Info: time since start : 881.069615845 (s)                                            [SPH][rank=0]
Info: Dumping state to _to_trash/dump_0006.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 13.37 us   (69.8%)
Info: dump to _to_trash/dump_0006.sham                                      [Shamrock Dump][rank=0]
              - took 102.51 ms, bandwidth = 1.17 GB/s
Info: evolve_until (target_time = 0.01s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
---------------- t = 0.006, dt = 0.001 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 9.92 us    (3.4%)
   patch tree reduce : 1.77 us    (0.6%)
   gen split merge   : 991.00 ns  (0.3%)
   split / merge op  : 0/0
   apply split merge : 1.01 us    (0.3%)
   LB compute        : 270.71 us  (91.8%)
   LB move op cnt    : 0
   LB apply          : 4.27 us    (1.4%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 1.81 us    (72.1%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.6744173280897397e-05,-3.740065138498679e-05,-5.163055495015865e-07)
    sum a = (1.0299920638612292e-18,-6.776263578034403e-20,6.88214269644119e-20)
    sum e = 0.02516934248487061
    sum de = 1.6792049815746114e-05
Info: cfl dt = 0.00472427660972074 cfl multiplier : 0.9613717421124829         [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.6891e+05 | 1000000 |      1 | 5.920e+00 | 0.0% |   0.3% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.6080890019927525 (tsim/hr)                            [sph::Model][rank=0]
Info: iteration since start : 9                                                       [SPH][rank=0]
Info: time since start : 887.150048831 (s)                                            [SPH][rank=0]
Info: Dumping state to _to_trash/dump_0007.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 12.59 us   (69.3%)
Info: dump to _to_trash/dump_0007.sham                                      [Shamrock Dump][rank=0]
              - took 106.78 ms, bandwidth = 1.12 GB/s
Info: evolve_until (target_time = 0.01s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
---------------- t = 0.007, dt = 0.001 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 10.89 us   (0.2%)
   patch tree reduce : 1.94 us    (0.0%)
   gen split merge   : 1.01 us    (0.0%)
   split / merge op  : 0/0
   apply split merge : 991.00 ns  (0.0%)
   LB compute        : 4.85 ms    (99.5%)
   LB move op cnt    : 0
   LB apply          : 4.14 us    (0.1%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 2.68 us    (64.3%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.6744062798858952e-05,-3.740057163449582e-05,-5.163056222656141e-07)
    sum a = (-1.6940658945086007e-18,-5.149960319306146e-19,-2.4691010412462855e-19)
    sum e = 0.025169360440281376
    sum de = 1.9192961458645933e-05
Info: cfl dt = 0.004829857236430945 cfl multiplier : 0.9742478280749886        [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.6855e+05 | 1000000 |      1 | 5.933e+00 | 0.0% |   0.4% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.6067727122684179 (tsim/hr)                            [sph::Model][rank=0]
Info: iteration since start : 10                                                      [SPH][rank=0]
Info: time since start : 893.2606510950001 (s)                                        [SPH][rank=0]
Info: Dumping state to _to_trash/dump_0008.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 11.29 us   (68.8%)
Info: dump to _to_trash/dump_0008.sham                                      [Shamrock Dump][rank=0]
              - took 101.73 ms, bandwidth = 1.18 GB/s
Info: evolve_until (target_time = 0.01s, niter_max = -1, max_walltime = -1.00s)       [SPH][rank=0]
---------------- t = 0.008, dt = 0.0010000000000000009 ----------------
Info: Summary (strategy = round robin):                                       [LoadBalance][rank=0]
 - strategy "psweep"      : max = 1000000.0 min = 1000000.0 factor = 1
 - strategy "round robin" : max = 950000.0 min = 950000.0 factor = 0.95
Info: Loadbalance stats :                                                     [LoadBalance][rank=0]
    npatch = 1
    min = 1000000
    max = 1000000
    avg = 1000000
    efficiency = 100.00%
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 9.39 us    (3.5%)
   patch tree reduce : 2.28 us    (0.8%)
   gen split merge   : 841.00 ns  (0.3%)
   split / merge op  : 0/0
   apply split merge : 991.00 ns  (0.4%)
   LB compute        : 248.27 us  (91.3%)
   LB move op cnt    : 0
   LB apply          : 3.90 us    (1.4%)
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 1.67 us    (66.5%)
Info: free boundaries skipping geometry update                            [PositionUpdated][rank=0]
Info: conservation infos :                                                     [sph::Model][rank=0]
    sum v = (1.6743952012362852e-05,-3.740049243216303e-05,-5.163057065290636e-07)
    sum a = (4.187730891225261e-18,-1.9583401740519424e-18,1.418780186650953e-20)
    sum e = 0.025169380795005067
    sum de = 2.1594338214305056e-05
Info: cfl dt = 0.004919004828317812 cfl multiplier : 0.9828318853833258        [sph::Model][rank=0]
Info: Timestep perf report:                                                    [sph::Model][rank=0]
+======+============+=========+========+===========+======+=============+=============+=============+
| rank | rate (N/s) |  Nobj   | Npatch |   tstep   | MPI  | alloc d% h% | mem (max) d | mem (max) h |
+======+============+=========+========+===========+======+=============+=============+=============+
| 0    | 1.6895e+05 | 1000000 |      1 | 5.919e+00 | 0.0% |   0.2% 0.0% |     1.06 GB |     5.29 MB |
+------+------------+---------+--------+-----------+------+-------------+-------------+-------------+
Info: estimated rate : 0.6082151888098778 (tsim/hr)                            [sph::Model][rank=0]
Info: iteration since start : 11                                                      [SPH][rank=0]
Info: time since start : 899.338690734 (s)                                            [SPH][rank=0]
Info: Dumping state to _to_trash/dump_0009.sham                                       [SPH][rank=0]
Info: Scheduler step timings :                                                  [Scheduler][rank=0]
   metadata sync     : 10.39 us   (66.6%)
Info: dump to _to_trash/dump_0009.sham                                      [Shamrock Dump][rank=0]
              - took 102.33 ms, bandwidth = 1.17 GB/s

Plot column integrated density

283 import matplotlib.pyplot as plt
284
285 pixel_x = 1200
286 pixel_y = 1080
287 radius = 30
288 center = (0.0, 0.0, 0.0)
289
290 aspect = pixel_x / pixel_y
291 pic_range = [-radius * aspect, radius * aspect, -radius, radius]
292 delta_x = (radius * 2 * aspect, 0.0, 0.0)
293 delta_y = (0.0, 0.0, radius * 2)
294
295 arr_rho = model.render_cartesian_column_integ(
296     "rho", "f64", center=(0.0, 0.0, 0.0), delta_x=delta_x, delta_y=delta_y, nx=pixel_x, ny=pixel_y
297 )
298
299 import copy
300
301 import matplotlib
302
303 my_cmap = copy.copy(matplotlib.colormaps.get_cmap("gist_heat"))  # copy the default cmap
304 my_cmap.set_bad(color="black")
305
306 fig_width = 6
307 fig_height = fig_width / aspect
308 plt.figure(figsize=(fig_width, fig_height))
309 res = plt.imshow(arr_rho, cmap=my_cmap, origin="lower", extent=pic_range, norm="log", vmin=1e-9)
310
311 cbar = plt.colorbar(res, extend="both")
312 cbar.set_label(r"$\int \rho \, \mathrm{d} z$ [code unit]")
313 # or r"$\rho$ [code unit]" for slices
314
315 plt.title(f"t = {model.get_time():0.3f} [code unit]")
316 plt.xlabel("x")
317 plt.ylabel("z")
318 plt.show()
t = 0.009 [code unit]
Info: compute_column_integ field_name: rho, rays count: 1296000      [sph::CartesianRender][rank=0]
Info: compute_column_integ took 20.16 s                              [sph::CartesianRender][rank=0]

Total running time of the script: (2 minutes 17.527 seconds)

Estimated memory usage: 1263 MB

Gallery generated by Sphinx-Gallery