Restart and resolution change

Fluidsim provides 2 command-line tools to restart a simulation (fluidsim-restart) and create a new file with a modified resolution (fluidsim-modif-resolution). Let’s present these very useful tools!

First, one can get help by invoking these tools with the -h option:

!fluidsim-restart -h
usage: fluidsim-restart [-h] [-oc] [-oi] [--modify-params MODIFY_PARAMS]
                        [--new-dir-results] [--t_approx T_APPROX]
                        [--add-to-t_end ADD_TO_T_END]
                        [--add-to-it_end ADD_TO_IT_END] [--t_end T_END]
                        [--it_end IT_END] [--merge-missing-params]
                        [--max-elapsed MAX_ELAPSED]
                        path

Restart a fluidsim simulation

positional arguments:
  path                  Path of the directory or file from which to restart

options:
  -h, --help            show this help message and exit
  -oc, --only-check     Only check what should be done
  -oi, --only-init      Only run initialization phase
  --modify-params MODIFY_PARAMS
                        Code modifying the `params` object.
  --new-dir-results     Create a new directory for the new simulation
  --t_approx T_APPROX   Approximate time to choose the file from which to
                        restart
  --add-to-t_end ADD_TO_T_END
                        Time added to params.time_stepping.t_end
  --add-to-it_end ADD_TO_IT_END
                        Number of steps added to params.time_stepping.it_end
  --t_end T_END         params.time_stepping.t_end
  --it_end IT_END       params.time_stepping.it_end
  --merge-missing-params
                        Can be used to load old simulations carried out with
                        an old fluidsim version.
  --max-elapsed MAX_ELAPSED
                        Maximum elapsed time.
!fluidsim-modif-resolution -h
usage: fluidsim-modif-resolution [-h] [--t_approx T_APPROX]
                                 path coef_modif_resol

Create a new state file with a different resolution

positional arguments:
  path                 Input: path towards a directory or a file
  coef_modif_resol     Input: coefficient of resolution change

options:
  -h, --help           show this help message and exit
  --t_approx T_APPROX  Approximate time to choose the file from which to
                       restart

Hide code cell content

from pathlib import Path
import shutil

path_fls = "/tmp/sim_data"
path_base = Path(path_fls) / "doc_aniso"
shutil.rmtree(path_base, ignore_errors=True)

Hide code cell content

import os

os.environ["FLUIDSIM_PATH"] = path_fls
os.environ["TRANSONIC_BACKEND"] = "python"

Then, let’s use these tools. First we need a simulation directory.

from fluidsim.util.scripts.turb_trandom_anisotropic import main

params, sim = main(
    args=(
        '--sub-directory "doc_aniso" -nz 12 --ratio-nh-nz 2 --t_end 1 '
        '--modify-params "params.output.periods_print.print_stdout = 0.25; '
        'params.output.periods_save.spect_energy_budg = 0"'
    )
)
Namespace(only_print_params_as_code=False, only_print_params=False, only_plot_forcing=False, nz=12, ratio_nh_nz=2, t_end=1.0, N=10.0, nu=None, nu4=None, Rb=None, Rb4=None, coef_nu4=1.0, forced_field='polo', init_velo_max=0.01, nh_forcing=3, ratio_kfmin_kf=0.5, ratio_kfmax_kf=2.0, F=0.3, delta_F=0.1, spatiotemporal_spectra=False, projection=None, disable_no_vz_kz0=False, disable_NO_SHEAR_MODES=False, max_elapsed='23:50:00', coef_dealiasing=0.8, periods_save_phys_fields=1.0, sub_directory='doc_aniso', modify_params='params.output.periods_print.print_stdout = 0.25; params.output.periods_save.spect_energy_budg = 0')
Input horizontal Froude number: 0.1
eta * k_max = 1.902e-01
Resolution too coarse, we add order-4 hyper viscosity nu_4=4.524e-05.
angle = 17.46°
params.forcing.nkmin_forcing = 2.5
params.forcing.nkmax_forcing = 6
*************************************
Program fluidsim
sim:                <class 'fluidsim.solvers.ns3d.strat.solver.Simul'>
sim.output:         <class 'fluidsim.solvers.ns3d.strat.output.Output'>
sim.oper:           <class 'fluidsim.operators.operators3d.OperatorsPseudoSpectral3D'>
sim.state:          <class 'fluidsim.solvers.ns3d.strat.state.StateNS3DStrat'>
sim.time_stepping:  <class 'fluidsim.solvers.ns3d.time_stepping.TimeSteppingPseudoSpectralNS3D'>
sim.init_fields:    <class 'fluidsim.solvers.ns3d.init_fields.InitFieldsNS3D'>
sim.forcing:        <class 'fluidsim.solvers.ns3d.forcing.ForcingNS3D'>

solver ns3d.strat, RK4 and sequential,
type fft: fluidfft.fft3d.with_pyfftw
nx =     24 ; ny =     24 ; nz =     12
Lx = 3 ; Ly = 3 ; Lz = 1.5
path_run =
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33
init_fields.type: noise

To plot the forcing modes, you can use:
sim.forcing.forcing_maker.plot_forcing_region()

Initialization outputs:
sim.output.cross_corr:             <class 'fluidsim.base.output.cross_corr3d.CrossCorrelations'>
sim.output.kolmo_law:              <class 'fluidsim.base.output.kolmo_law.KolmoLaw'>
sim.output.phys_fields:            <class 'fluidsim.base.output.phys_fields3d.PhysFieldsBase3D'>
sim.output.spatial_means:          <class 'fluidsim.solvers.ns3d.strat.output.spatial_means.SpatialMeansNS3DStrat'>
sim.output.spatiotemporal_spectra: <class 'fluidsim.solvers.ns3d.output.spatiotemporal_spectra.SpatioTemporalSpectraNS3D'>
sim.output.spectra:                <class 'fluidsim.solvers.ns3d.strat.output.spectra.SpectraNS3DStrat'>
sim.output.spect_energy_budg:      <class 'fluidsim.solvers.ns3d.strat.output.spect_energy_budget.SpectralEnergyBudgetNS3DStrat'>
sim.output.temporal_spectra:       <class 'fluidsim.base.output.temporal_spectra.TemporalSpectra3D'>

Memory usage at the end of init. (equiv. seq.): 246.82421875 Mo
Size of state_spect (equiv. seq.): 0.239616 Mo
*************************************
Beginning of the computation
save state_phys in file state_phys_t000.000.nc
    compute until t =          1
it =      0 ; t =            0 ; deltat  =    0.03927
              energy = 8.258e-06 ; Delta energy = +0.000e+00
MEMORY_USAGE:                  247.3671875 Mo
it =      7 ; t =     0.274889 ; deltat  =    0.03927
              energy = 7.868e-02 ; Delta energy = +7.867e-02
              estimated remaining duration = 0:00:03
MEMORY_USAGE:                  248.71875 Mo
it =     13 ; t =     0.510509 ; deltat  =    0.03927
              energy = 9.740e-02 ; Delta energy = +1.872e-02
              estimated remaining duration = 0:00:02
MEMORY_USAGE:                  248.87109375 Mo
it =     20 ; t =     0.785398 ; deltat  =    0.03927
              energy = 1.037e-01 ; Delta energy = +6.248e-03
              estimated remaining duration = 0:00:01
MEMORY_USAGE:                  249.02734375 Mo
it =     26 ; t =      1.02102 ; deltat  =    0.03927
              energy = 1.070e-01 ; Delta energy = +3.327e-03
MEMORY_USAGE:                  249.171875 Mo
save state_phys in file state_phys_t001.021.nc
Computation completed in  3.92154 s
path_run =
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33

# To visualize the output with Paraview, create a file states_phys.xmf with:

fluidsim-create-xml-description /tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33

# To visualize with fluidsim:

fluidsim-ipy-load /tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33

# in IPython:

sim.output.phys_fields.set_equation_crosssection('x=1.5')
sim.output.phys_fields.animate('b')

We then define a variable with the path of the directory containing the results of the simulation.

sim.output.path_run
'/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33'
from pprint import pprint


def ls_path_run(glob="*"):
    pprint(sorted(p.name for p in Path(sim.output.path_run).glob(glob)))


ls_path_run()
['coarse-oper-info.txt',
 'cross_corr1d.h5',
 'cross_corr3d.h5',
 'cross_corr_kzkh.h5',
 'info_solver.xml',
 'params_simul.xml',
 'spatial_means.txt',
 'spectra1d.h5',
 'spectra3d.h5',
 'spectra_kzkh.h5',
 'state_phys_t000.000.nc',
 'state_phys_t001.021.nc',
 'stdout.txt']
sim.output.spatial_means.plot()
../_images/d22e64e4a3a879a318a9d3d1ac8b1a3be55866f7c91057635e3b0e5a2382adb4.png ../_images/093a8264706f395aed9928f971c2fe967e00df9548c516c2a771059b0a7f0141.png

Ah, we see that t_end = 1 was not enough to obtain a statistically steady state. We need to run the simulation longer. Let’s restart it to run until t_end = 2:

!fluidsim-restart {sim.output.path_run} --t_end 2.0
Namespace(path='/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33', only_check=False, only_init=False, modify_params=None, new_dir_results=False, t_approx=None, add_to_t_end=None, add_to_it_end=None, t_end=2.0, it_end=None, merge_missing_params=False, max_elapsed=None)
/home/docs/checkouts/readthedocs.org/user_builds/fluidsim/envs/latest/lib/python3.11/site-packages/fluidsim/operators/operators2d.py:36: UserWarning: operators2d.py has to be pythranized to be efficient! Install pythran and recompile.
  warn(
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/state_phys_t001.021.nc
*************************************
Program fluidsim
sim:                <class 'fluidsim.solvers.ns3d.strat.solver.Simul'>
sim.output:         <class 'fluidsim.solvers.ns3d.strat.output.Output'>
sim.oper:           <class 'fluidsim.operators.operators3d.OperatorsPseudoSpectral3D'>
sim.state:          <class 'fluidsim.solvers.ns3d.strat.state.StateNS3DStrat'>
sim.time_stepping:  <class 'fluidsim.solvers.ns3d.time_stepping.TimeSteppingPseudoSpectralNS3D'>
sim.init_fields:    <class 'fluidsim.solvers.ns3d.init_fields.InitFieldsNS3D'>
sim.forcing:        <class 'fluidsim.solvers.ns3d.forcing.ForcingNS3D'>

solver ns3d.strat, RK4 and sequential,
type fft: fluidfft.fft3d.with_pyfftw
nx =     24 ; ny =     24 ; nz =     12
Lx = 3 ; Ly = 3 ; Lz = 1.5
path_run =
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33
init_fields.type: from_file

Load state from file:
[...]3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/state_phys_t001.021.nc

To plot the forcing modes, you can use:
sim.forcing.forcing_maker.plot_forcing_region()

Initialization outputs:
sim.output.cross_corr:             <class 'fluidsim.base.output.cross_corr3d.CrossCorrelations'>
sim.output.kolmo_law:              <class 'fluidsim.base.output.kolmo_law.KolmoLaw'>
sim.output.phys_fields:            <class 'fluidsim.base.output.phys_fields3d.PhysFieldsBase3D'>
sim.output.spatial_means:          <class 'fluidsim.solvers.ns3d.strat.output.spatial_means.SpatialMeansNS3DStrat'>
sim.output.spatiotemporal_spectra: <class 'fluidsim.solvers.ns3d.output.spatiotemporal_spectra.SpatioTemporalSpectraNS3D'>
sim.output.spectra:                <class 'fluidsim.solvers.ns3d.strat.output.spectra.SpectraNS3DStrat'>
sim.output.spect_energy_budg:      <class 'fluidsim.solvers.ns3d.strat.output.spect_energy_budget.SpectralEnergyBudgetNS3DStrat'>
sim.output.temporal_spectra:       <class 'fluidsim.base.output.temporal_spectra.TemporalSpectra3D'>

Memory usage at the end of init. (equiv. seq.): 230.41015625 Mo
Size of state_spect (equiv. seq.): 0.239616 Mo
*************************************
Beginning of the computation
    compute until t =          2
it =     26 ; t =      1.02102 ; deltat  =    0.03927
              energy = 1.070e-01 ; Delta energy = +0.000e+00

MEMORY_USAGE:                  230.4609375 Mo
it =     32 ; t =      1.25664 ; deltat  =    0.03927
              energy = 1.141e-01 ; Delta energy = +7.157e-03
              estimated remaining duration = 0:00:03
MEMORY_USAGE:                  232.296875 Mo
it =     39 ; t =      1.53153 ; deltat  =    0.03927
              energy = 1.224e-01 ; Delta energy = +8.255e-03
              estimated remaining duration = 0:00:02
MEMORY_USAGE:                  232.40625 Mo
it =     45 ; t =      1.76715 ; deltat  =    0.03927
              energy = 1.250e-01 ; Delta energy = +2.609e-03
              estimated remaining duration = 0:00:01
MEMORY_USAGE:                  232.56640625 Mo
it =     51 ; t =      2.00277 ; deltat  =    0.03927
              energy = 1.240e-01 ; Delta energy = -9.659e-04
MEMORY_USAGE:                  232.671875 Mo
save state_phys in file state_phys_t002.003.nc
Computation completed in    3.712 s
path_run =
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33

# To visualize with IPython:

fluidsim-ipy-load /tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33
ls_path_run()
['coarse-oper-info.txt',
 'cross_corr1d.h5',
 'cross_corr3d.h5',
 'cross_corr_kzkh.h5',
 'info_solver.xml',
 'params_simul.xml',
 'spatial_means.txt',
 'spectra1d.h5',
 'spectra3d.h5',
 'spectra_kzkh.h5',
 'state_phys_t000.000.nc',
 'state_phys_t001.021.nc',
 'state_phys_t002.003.nc',
 'stdout.txt']
sim.output.spatial_means.plot()
../_images/eb1237da48f77eabaa8ad4fc38be95d99731b390666823131da6522a983c32ff.png ../_images/ed3125c2d2830c1bb4a397011308ce1e46dae3fd9ca71442f04fb390b57e0e63.png

Finally, we are not far from a statistically steady state. We can relaunch the simulation to save results about this state. Here we show how to restart a simulation with the spatiotemporal spectra output activated:

!fluidsim-restart {sim.output.path_run} --t_end 3.0 --modify-params "params.output.periods_save.spatiotemporal_spectra = 2 * pi / (4 * params.N)"
Namespace(path='/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33', only_check=False, only_init=False, modify_params='params.output.periods_save.spatiotemporal_spectra = 2 * pi / (4 * params.N)', new_dir_results=False, t_approx=None, add_to_t_end=None, add_to_it_end=None, t_end=3.0, it_end=None, merge_missing_params=False, max_elapsed=None)
/home/docs/checkouts/readthedocs.org/user_builds/fluidsim/envs/latest/lib/python3.11/site-packages/fluidsim/operators/operators2d.py:36: UserWarning: operators2d.py has to be pythranized to be efficient! Install pythran and recompile.
  warn(
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/state_phys_t002.003.nc
*************************************
Program fluidsim
sim:                <class 'fluidsim.solvers.ns3d.strat.solver.Simul'>
sim.output:         <class 'fluidsim.solvers.ns3d.strat.output.Output'>
sim.oper:           <class 'fluidsim.operators.operators3d.OperatorsPseudoSpectral3D'>
sim.state:          <class 'fluidsim.solvers.ns3d.strat.state.StateNS3DStrat'>
sim.time_stepping:  <class 'fluidsim.solvers.ns3d.time_stepping.TimeSteppingPseudoSpectralNS3D'>
sim.init_fields:    <class 'fluidsim.solvers.ns3d.init_fields.InitFieldsNS3D'>
sim.forcing:        <class 'fluidsim.solvers.ns3d.forcing.ForcingNS3D'>

solver ns3d.strat, RK4 and sequential,
type fft: fluidfft.fft3d.with_pyfftw
nx =     24 ; ny =     24 ; nz =     12
Lx = 3 ; Ly = 3 ; Lz = 1.5
path_run =
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33
init_fields.type: from_file

Load state from file:
[...]3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/state_phys_t002.003.nc

To plot the forcing modes, you can use:
sim.forcing.forcing_maker.plot_forcing_region()

Initialization outputs:
sim.output.cross_corr:             <class 'fluidsim.base.output.cross_corr3d.CrossCorrelations'>
sim.output.kolmo_law:              <class 'fluidsim.base.output.kolmo_law.KolmoLaw'>
sim.output.phys_fields:            <class 'fluidsim.base.output.phys_fields3d.PhysFieldsBase3D'>
sim.output.spatial_means:          <class 'fluidsim.solvers.ns3d.strat.output.spatial_means.SpatialMeansNS3DStrat'>
sim.output.spatiotemporal_spectra: <class 'fluidsim.solvers.ns3d.output.spatiotemporal_spectra.SpatioTemporalSpectraNS3D'>
sim.output.spectra:                <class 'fluidsim.solvers.ns3d.strat.output.spectra.SpectraNS3DStrat'>
sim.output.spect_energy_budg:      <class 'fluidsim.solvers.ns3d.strat.output.spect_energy_budget.SpectralEnergyBudgetNS3DStrat'>
sim.output.temporal_spectra:       <class 'fluidsim.base.output.temporal_spectra.TemporalSpectra3D'>

Memory usage at the end of init. (equiv. seq.): 230.90234375 Mo
Size of state_spect (equiv. seq.): 0.239616 Mo
*************************************
Beginning of the computation
    compute until t =          3
it =     51 ; t =      2.00277 ; deltat  =    0.03927
              energy = 1.240e-01 ; Delta energy = +0.000e+00

MEMORY_USAGE:                  230.9375 Mo
it =     58 ; t =      2.27765 ; deltat  =    0.03927
              energy = 1.213e-01 ; Delta energy = -2.778e-03
              estimated remaining duration = 0:00:03
MEMORY_USAGE:                  232.5703125 Mo
it =     64 ; t =      2.51327 ; deltat  =    0.03927
              energy = 1.192e-01 ; Delta energy = -2.034e-03
              estimated remaining duration = 0:00:02
MEMORY_USAGE:                  232.765625 Mo
it =     71 ; t =      2.78816 ; deltat  =    0.03927
              energy = 1.169e-01 ; Delta energy = -2.298e-03
              estimated remaining duration = 0:00:01
MEMORY_USAGE:                  232.875 Mo
it =     77 ; t =      3.02378 ; deltat  =    0.03927
              energy = 1.132e-01 ; Delta energy = -3.748e-03

MEMORY_USAGE:                  233.015625 Mo
save state_phys in file state_phys_t003.024.nc
Computation completed in  3.86334 s
path_run =
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33

# To visualize with IPython:

fluidsim-ipy-load /tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33
ls_path_run()
['coarse-oper-info.txt',
 'cross_corr1d.h5',
 'cross_corr3d.h5',
 'cross_corr_kzkh.h5',
 'info_solver.xml',
 'params_simul.xml',
 'spatial_means.txt',
 'spatiotemporal',
 'spectra1d.h5',
 'spectra3d.h5',
 'spectra_kzkh.h5',
 'state_phys_t000.000.nc',
 'state_phys_t001.021.nc',
 'state_phys_t002.003.nc',
 'state_phys_t003.024.nc',
 'stdout.txt']

spatiotemporal is a directory containing the data that can be used to compute spatiotemporal spectra:

ls_path_run("spatiotemporal/*")
['rank00000_tmin002.003.h5']
sim.output.spatial_means.plot()
../_images/460bca4ba3a0de0ab3f31398a3f67d18cb70752a311341e4ceca774e833b3d59.png ../_images/3eb046d9eef4f46f84e3b7e2434c66a0922fb23c25e3475ef1fadb2b166c28bf.png

We want to start a larger simulation from the last state of this small simulation. We first need to create a larger file:

!fluidsim-modif-resolution {sim.output.path_run} 5/4
Namespace(path='/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33', coef_modif_resol='5/4', t_approx=None)
Changing resolution of the state contained in
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/state_phys_t003.024.nc
/home/docs/checkouts/readthedocs.org/user_builds/fluidsim/envs/latest/lib/python3.11/site-packages/fluidsim/operators/operators2d.py:36: UserWarning: operators2d.py has to be pythranized to be efficient! Install pythran and recompile.
  warn(
Memory usage after init operator "input":    0.188 Go
Memory usage after init operator "output":   0.188 Go
Memory usage after init fields:              0.188 Go
size field2:                                 0.000 Go
Memory usage after init field2:              0.188 Go
size field2_spect:                           0.000 Go
Memory usage after init field2_spect:        0.188 Go
Saving file state_phys_t003.024.nc...
get_var("vx")
- reading field from disk...    done in 0:00:00.005639
- forward fft smaller field...  done in 0:00:00.000071
- filling field2_fft...         done in 0:00:00.001032
- backward fft field2...        done in 0:00:00.000074
get_var("vy")
- reading field from disk...    done in 0:00:00.005063
- forward fft smaller field...  done in 0:00:00.000059
- filling field2_fft...         done in 0:00:00.000987
- backward fft field2...        done in 0:00:00.000069
get_var("vz")
- reading field from disk...    done in 0:00:00.004652
- forward fft smaller field...  done in 0:00:00.000056
- filling field2_fft...         done in 0:00:00.000994
- backward fft field2...
done in 0:00:00.000071
get_var("b")
- reading field from disk...    done in 0:00:00.004680
- forward fft smaller field...  done in 0:00:00.000057
- filling field2_fft...         done in 0:00:00.000991
- backward fft field2...        done in 0:00:00.000070
File state_phys_t003.024.nc saved in:
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/State_phys_30x30x15
total duration: 0:00:01.054767

We can now launch the last simulation from the file just created.

path_new_state = next(Path(sim.output.path_run).glob("State_phys*"))
str(path_new_state)
'/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/State_phys_30x30x15'
!fluidsim-restart {path_new_state} --t_end 3.1 --modify-params "params.NEW_DIR_RESULTS = True; params.nu_2 /= 2; params.output.periods_print.print_stdout = 0.05; params.output.periods_save.spatial_means = 0.01;"
Namespace(path='/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/State_phys_30x30x15', only_check=False, only_init=False, modify_params='params.NEW_DIR_RESULTS = True; params.nu_2 /= 2; params.output.periods_print.print_stdout = 0.05; params.output.periods_save.spatial_means = 0.01;', new_dir_results=False, t_approx=None, add_to_t_end=None, add_to_it_end=None, t_end=3.1, it_end=None, merge_missing_params=False, max_elapsed=None)
load params from file
[...]olo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/State_phys_30x30x15/state_phys_t003.024.nc
/home/docs/checkouts/readthedocs.org/user_builds/fluidsim/envs/latest/lib/python3.11/site-packages/fluidsim/operators/operators2d.py:36: UserWarning: operators2d.py has to be pythranized to be efficient! Install pythran and recompile.
  warn(
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/State_phys_30x30x15/state_phys_t003.024.nc
*************************************
Program fluidsim
sim:                <class 'fluidsim.solvers.ns3d.strat.solver.Simul'>
sim.output:         <class 'fluidsim.solvers.ns3d.strat.output.Output'>
sim.oper:           <class 'fluidsim.operators.operators3d.OperatorsPseudoSpectral3D'>
sim.state:          <class 'fluidsim.solvers.ns3d.strat.state.StateNS3DStrat'>
sim.time_stepping:  <class 'fluidsim.solvers.ns3d.time_stepping.TimeSteppingPseudoSpectralNS3D'>
sim.init_fields:    <class 'fluidsim.solvers.ns3d.init_fields.InitFieldsNS3D'>
sim.forcing:        <class 'fluidsim.solvers.ns3d.forcing.ForcingNS3D'>

solver ns3d.strat, RK4 and sequential,
type fft: fluidfft.fft3d.with_pyfftw
nx =     30 ; ny =     30 ; nz =     15
Lx = 3 ; Ly = 3 ; Lz = 1.5
path_run =
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_30x30x15_V3x3x1.5_N10_2026-07-23_09-32-55
init_fields.type: from_file

Load state from file:
[...]0e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33/State_phys_30x30x15/state_phys_t003.024.nc

To plot the forcing modes, you can use:
sim.forcing.forcing_maker.plot_forcing_region()

Initialization outputs:
sim.output.cross_corr:             <class 'fluidsim.base.output.cross_corr3d.CrossCorrelations'>
sim.output.kolmo_law:              <class 'fluidsim.base.output.kolmo_law.KolmoLaw'>
sim.output.phys_fields:            <class 'fluidsim.base.output.phys_fields3d.PhysFieldsBase3D'>
sim.output.spatial_means:          <class 'fluidsim.solvers.ns3d.strat.output.spatial_means.SpatialMeansNS3DStrat'>
sim.output.spatiotemporal_spectra: <class 'fluidsim.solvers.ns3d.output.spatiotemporal_spectra.SpatioTemporalSpectraNS3D'>
sim.output.spectra:                <class 'fluidsim.solvers.ns3d.strat.output.spectra.SpectraNS3DStrat'>
sim.output.spect_energy_budg:      <class 'fluidsim.solvers.ns3d.strat.output.spect_energy_budget.SpectralEnergyBudgetNS3DStrat'>
sim.output.temporal_spectra:       <class 'fluidsim.base.output.temporal_spectra.TemporalSpectra3D'>

Memory usage at the end of init. (equiv. seq.): 232.41796875 Mo
Size of state_spect (equiv. seq.): 0.4608 Mo
*************************************
Beginning of the computation
save state_phys in file state_phys_t003.024.nc
    compute until t =        3.1
it =     77 ; t =      3.02378 ; deltat  =    0.03927
              energy = 1.132e-01 ; Delta energy = +0.000e+00

MEMORY_USAGE:                  232.52734375 Mo
it =     78 ; t =      3.06305 ; deltat  =    0.03927
              energy = 1.161e-01 ; Delta energy = +2.947e-03
              estimated remaining duration = 0:00:00
MEMORY_USAGE:                  235.52734375 Mo
it =     79 ; t =      3.10232 ; deltat  =    0.03927
              energy = 1.153e-01 ; Delta energy = -8.224e-04

MEMORY_USAGE:                  236.0546875 Mo
save state_phys in file state_phys_t003.102.nc
Computation completed in 0.542145 s
path_run =
/tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_30x30x15_V3x3x1.5_N10_2026-07-23_09-32-55

# To visualize with IPython:

fluidsim-ipy-load /tmp/sim_data/doc_aniso/ns3d.strat_polo_Fh1.000e-01_30x30x15_V3x3x1.5_N10_2026-07-23_09-32-55
[p.name for p in path_base.glob("*")]
['ns3d.strat_polo_Fh1.000e-01_24x24x12_V3x3x1.5_N10_2026-07-23_09-32-33',
 'ns3d.strat_polo_Fh1.000e-01_30x30x15_V3x3x1.5_N10_2026-07-23_09-32-55']