In [1]:
%%javascript
IPython.OutputArea.prototype._should_scroll = function(lines) {
    return false;
}
In [2]:
# Import packages
import numpy as np
import matplotlib.pyplot as pl
from flumyx import *
from flumyx.api import *
from collections import Counter
In [3]:
# Global configuration
trace_level = TL_WARNING # 0: None, 1: Fatal, 2: Error, 3: Warning, 4: Info, 5: Debug
# Verbose mode
#trace_level = TL_DEBUG
In [4]:
# Just a function which displays the Flumy version currently loaded
def printVersion(simu):
    old_tl = simu.getTracer().getTraceLevel()
    simu.getTracer().setTraceLevel(TL_DEBUG)
    simu.printVersion()
    simu.getTracer().setTraceLevel(old_tl)
In [5]:
def runSimu(simu, factor=1, turb=False, vargr=False, optim=False, proxy=False, tmpidx=0) :
    
    print("Running simulation...")

    # Check input flags
    if (optim):
        if (proxy): print("proxy and optim cannot be True all together => using optim")
        proxy = False
        vargr = True
    if (proxy):
        optim = False
        vargr = True     
    
    # Print Flumy version
    printVersion(simu)

    # Reset the simulation (return at age 0)
    simu.getTracer().setTraceLevel(TL_WARNING)
    simu.clear()
    simu.getTracer().setTraceLevel(trace_level)
     
    # Configure the environement
    if (turb) :
        # Turbidite simulation
        simu.getParameters().setUsingTurbi()
    else :
        # Fluvial simulation
        simu.getParameters().setUsingFluvi()
        
    # Use variable grain size in PB/LAPs ?
    simu.getParameters().setParamBool(KEY_GR_PB, vargr)
    simu.getParameters().setParamBool(KEY_GR_PB_OPTIM, optim)
    simu.getParameters().setParamBool(KEY_GR_PB_PROXY, proxy)

    # Update parameters
    hmax = simu.getParameters().getParamDouble(KEY_CHNL_MAX_DEPTH)
    hmax = hmax * factor
    applyNexus(simu, hmax = hmax, adaptGrid=False)
    zul = 3 * hmax

    # Simulation root seed
    seed = 665544
    
    # Launch the simulation up to zul
    print(simu.getParameters().getParamsDesc(all = False))
    runFlumy(simu, 0, seed, zul=zul, trace_level=trace_level)
    
    print("Simulation finished!")
In [6]:
# Create simulator and show Flumy version
simu = iSimulator.createSimulator()
printVersion(simu)
Flumy (8.000) / 2025-02-03
In [7]:
runSimu(simu)
showGrainDist(getGrainDist(simu, True), "Default fluvial", 0.6)
Running simulation...
Flumy (8.000) / 2025-02-03
AG_OB_POISSON = 80 (70) [1, 2147483647]
AV_LOC_POISSON = 320 (280) [1, 2147483647]
AV_REG_POISSON = 600 (500) [1, 2147483647]
AG_EXP_DEC_THICK = 944 (919) [5, 1e+30]
AG_OB_NORM_MEAN = 0.1 (0.1) [0, 1e+30]
CHNL_FLW_DIR = 90 (90) [-360, 360]
CHNL_MAX_DEPTH = 3 (3) [0.5, 15]
CHNL_WAVELENGTH = 375 (375) [10, 10000]
CHNL_WIDTH = 30 (30) [5, 500]
EROD_COEF = 4e-08 (4e-08) [0, 2e-07]

Simulation finished!
No description has been provided for this image
In [8]:
runSimu(simu, turb=True)
showGrainDist(getGrainDist(simu, True), "Default turbidites", 0.6)
Running simulation...
[0] Flumy (8.000) / 2025-02-03
AG_OB_POISSON = 24 (24) [1, 2147483647]
AV_LOC_POISSON = 264 (288) [1, 2147483647]
AV_REG_POISSON = 470 (470) [1, 2147483647]
AG_EXP_DEC_THICK = 7993 (8107) [100, 1e+30]
AG_OB_NORM_MEAN = 2 (2) [0, 1e+30]
CHNL_FLW_DIR = 90 (90) [-360, 360]
CHNL_MAX_DEPTH = 40 (40) [10, 500]
CHNL_WAVELENGTH = 4000 (4000) [100, 20000]
CHNL_WIDTH = 800 (800) [20, 4000]
EROD_COEF = 4e-08 (4e-08) [0, 2e-07]

Simulation finished!
No description has been provided for this image
In [9]:
runSimu(simu, vargr=True)
showGrainDist(getGrainDist(simu, True), "Default fluvial (Rouse)", 0.6)
Running simulation...
[0] Flumy (8.000) / 2025-02-03
AG_OB_POISSON = 80 (70) [1, 2147483647]
AV_LOC_POISSON = 320 (280) [1, 2147483647]
AV_REG_POISSON = 600 (500) [1, 2147483647]
AG_EXP_DEC_THICK = 944 (919) [5, 1e+30]
AG_OB_NORM_MEAN = 0.1 (0.1) [0, 1e+30]
CHNL_FLW_DIR = 90 (90) [-360, 360]
CHNL_MAX_DEPTH = 3 (3) [0.5, 15]
CHNL_WAVELENGTH = 375 (375) [10, 10000]
CHNL_WIDTH = 30 (30) [5, 500]
EROD_COEF = 4e-08 (4e-08) [0, 2e-07]

Simulation finished!
No description has been provided for this image
In [10]:
runSimu(simu, turb=True, vargr=True)
showGrainDist(getGrainDist(simu, True), "Default turbidites (Rouse)", 0.6)
Running simulation...
[0] Flumy (8.000) / 2025-02-03
AG_OB_POISSON = 24 (24) [1, 2147483647]
AV_LOC_POISSON = 264 (288) [1, 2147483647]
AV_REG_POISSON = 470 (470) [1, 2147483647]
AG_EXP_DEC_THICK = 7993 (8107) [100, 1e+30]
AG_OB_NORM_MEAN = 2 (2) [0, 1e+30]
CHNL_FLW_DIR = 90 (90) [-360, 360]
CHNL_MAX_DEPTH = 40 (40) [10, 500]
CHNL_WAVELENGTH = 4000 (4000) [100, 20000]
CHNL_WIDTH = 800 (800) [20, 4000]
EROD_COEF = 4e-08 (4e-08) [0, 2e-07]

Simulation finished!
No description has been provided for this image
In [11]:
runSimu(simu, vargr=True, optim=True)
showGrainDist(getGrainDist(simu, True), "Default fluvial (Optimized)", 0.6)
Running simulation...
[0] Flumy (8.000) / 2025-02-03
AG_OB_POISSON = 80 (70) [1, 2147483647]
AV_LOC_POISSON = 320 (280) [1, 2147483647]
AV_REG_POISSON = 600 (500) [1, 2147483647]
AG_EXP_DEC_THICK = 944 (919) [5, 1e+30]
AG_OB_NORM_MEAN = 0.1 (0.1) [0, 1e+30]
CHNL_FLW_DIR = 90 (90) [-360, 360]
CHNL_MAX_DEPTH = 3 (3) [0.5, 15]
CHNL_WAVELENGTH = 375 (375) [10, 10000]
CHNL_WIDTH = 30 (30) [5, 500]
EROD_COEF = 4e-08 (4e-08) [0, 2e-07]

Simulation finished!
No description has been provided for this image
In [12]:
runSimu(simu, turb=True, vargr=True, optim=True)
showGrainDist(getGrainDist(simu, True), "Default turbidites (Optimized)", 0.6)
Running simulation...
[0] Flumy (8.000) / 2025-02-03
AG_OB_POISSON = 24 (24) [1, 2147483647]
AV_LOC_POISSON = 264 (288) [1, 2147483647]
AV_REG_POISSON = 470 (470) [1, 2147483647]
AG_EXP_DEC_THICK = 7993 (8107) [100, 1e+30]
AG_OB_NORM_MEAN = 2 (2) [0, 1e+30]
CHNL_FLW_DIR = 90 (90) [-360, 360]
CHNL_MAX_DEPTH = 40 (40) [10, 500]
CHNL_WAVELENGTH = 4000 (4000) [100, 20000]
CHNL_WIDTH = 800 (800) [20, 4000]
EROD_COEF = 4e-08 (4e-08) [0, 2e-07]

Simulation finished!
No description has been provided for this image
In [13]:
runSimu(simu, vargr=True, proxy=True)
showGrainDist(getGrainDist(simu, True), "Default fluvial (Proxy)", 0.6)
Running simulation...
[0] Flumy (8.000) / 2025-02-03
AG_OB_POISSON = 80 (70) [1, 2147483647]
AV_LOC_POISSON = 320 (280) [1, 2147483647]
AV_REG_POISSON = 600 (500) [1, 2147483647]
AG_EXP_DEC_THICK = 944 (919) [5, 1e+30]
AG_OB_NORM_MEAN = 0.1 (0.1) [0, 1e+30]
CHNL_FLW_DIR = 90 (90) [-360, 360]
CHNL_MAX_DEPTH = 3 (3) [0.5, 15]
CHNL_WAVELENGTH = 375 (375) [10, 10000]
CHNL_WIDTH = 30 (30) [5, 500]
EROD_COEF = 4e-08 (4e-08) [0, 2e-07]

Simulation finished!
No description has been provided for this image
In [14]:
runSimu(simu, turb=True, vargr=True, proxy=True)
showGrainDist(getGrainDist(simu, True), "Default turbidites (Proxy)", 0.6)
Running simulation...
[0] Flumy (8.000) / 2025-02-03
AG_OB_POISSON = 24 (24) [1, 2147483647]
AV_LOC_POISSON = 264 (288) [1, 2147483647]
AV_REG_POISSON = 470 (470) [1, 2147483647]
AG_EXP_DEC_THICK = 7993 (8107) [100, 1e+30]
AG_OB_NORM_MEAN = 2 (2) [0, 1e+30]
CHNL_FLW_DIR = 90 (90) [-360, 360]
CHNL_MAX_DEPTH = 40 (40) [10, 500]
CHNL_WAVELENGTH = 4000 (4000) [100, 20000]
CHNL_WIDTH = 800 (800) [20, 4000]
EROD_COEF = 4e-08 (4e-08) [0, 2e-07]

Simulation finished!
No description has been provided for this image
In [ ]: