Skip to content

Note

Click here to download the full example code

Overview of the MockCurves for load case Dummy

from __future__ import annotations

from vimseo import EXAMPLE_RUNS_DIR
from vimseo.api import create_model
from vimseo.core.model_settings import IntegratedModelSettings

First, let's instantiate the model for a given load case:

model_name = "MockCurves"
load_case = "Dummy"
model = create_model(
    model_name,
    load_case,
    check_subprocess=True,
    model_options=IntegratedModelSettings(
        directory_archive_root=EXAMPLE_RUNS_DIR / "archive/model_gallery",
        directory_scratch_root=EXAMPLE_RUNS_DIR / "scratch/model_gallery",
        cache_file_path=EXAMPLE_RUNS_DIR
        / f"caches/model_gallery/{model_name}_{load_case}_cache.hdf",
    ),
)

The model description can be accessed like this:

print(model.description)

Out:

Model MockCurves: 

Load case:
   Load case Dummy: A dummy load case.

   Boundary condition variables:
   []

   Plot parameters:
   {
    "curves": []
}
   Load:
   Load(direction='', sign='', type='')

Default values:

   Default geometrical variables:
   {"x": [1.0], "x_1": [1.0]}

   Default numerical variables:
   {}

   Default boundary conditions variables:
   {}

   Default material variables:
   {}
model_inputs:
   [
    "x",
    "x_1"
]
model_outputs:
   [
    "y",
    "y_axis",
    "error_code",
    "model",
    "load_case",
    "description",
    "job_name",
    "persistent_result_files",
    "n_cpus",
    "date",
    "cpu_time",
    "user",
    "machine",
    "vims_git_version",
    "directory_archive_root",
    "directory_archive_job",
    "directory_scratch_root",
    "directory_scratch_job"
]

An illustration of the load case:

model.show_image()

The model is executed with its default input values:

model.execute()

Out:

{'x': array([1.]), 'x_1': array([1.]), 'cpu_time': array([0.01268196]), 'date': array(['2025-11-05 22:19:48.415473'], dtype='<U26'), 'description': array([''], dtype='<U1'), 'directory_archive_job': array(['..\\model_runs\\archive\\model_gallery\\MockCurves\\Dummy\\1'],
      dtype='<U54'), 'directory_archive_root': array(['C:\\Users\\sebastien.bocquet\\PycharmProjects\\vims\\docs\\runnable_examples\\model_runs\\archive\\model_gallery'],
      dtype='<U103'), 'directory_scratch_job': array([''], dtype='<U1'), 'directory_scratch_root': array(['C:\\Users\\sebastien.bocquet\\PycharmProjects\\vims\\docs\\runnable_examples\\model_runs\\scratch\\model_gallery'],
      dtype='<U103'), 'error_code': array([0]), 'job_name': array([''], dtype='<U1'), 'load_case': array(['Dummy'], dtype='<U5'), 'machine': array(['B20191729'], dtype='<U9'), 'model': array(['MockCurves'], dtype='<U10'), 'n_cpus': array([1]), 'persistent_result_files': array([''], dtype='<U1'), 'user': array(['sebastien.bocquet'], dtype='<U17'), 'vims_git_version': array(['95990fa211debd91a91ffe1d89b2b0b4b855f387'], dtype='<U40'), 'y': array([1.        , 1.01010101, 1.02020202, 1.03030303, 1.04040404,
       1.05050505, 1.06060606, 1.07070707, 1.08080808, 1.09090909,
       1.1010101 , 1.11111111, 1.12121212, 1.13131313, 1.14141414,
       1.15151515, 1.16161616, 1.17171717, 1.18181818, 1.19191919,
       1.2020202 , 1.21212121, 1.22222222, 1.23232323, 1.24242424,
       1.25252525, 1.26262626, 1.27272727, 1.28282828, 1.29292929,
       1.3030303 , 1.31313131, 1.32323232, 1.33333333, 1.34343434,
       1.35353535, 1.36363636, 1.37373737, 1.38383838, 1.39393939,
       1.4040404 , 1.41414141, 1.42424242, 1.43434343, 1.44444444,
       1.45454545, 1.46464646, 1.47474747, 1.48484848, 1.49494949,
       1.50505051, 1.51515152, 1.52525253, 1.53535354, 1.54545455,
       1.55555556, 1.56565657, 1.57575758, 1.58585859, 1.5959596 ,
       1.60606061, 1.61616162, 1.62626263, 1.63636364, 1.64646465,
       1.65656566, 1.66666667, 1.67676768, 1.68686869, 1.6969697 ,
       1.70707071, 1.71717172, 1.72727273, 1.73737374, 1.74747475,
       1.75757576, 1.76767677, 1.77777778, 1.78787879, 1.7979798 ,
       1.80808081, 1.81818182, 1.82828283, 1.83838384, 1.84848485,
       1.85858586, 1.86868687, 1.87878788, 1.88888889, 1.8989899 ,
       1.90909091, 1.91919192, 1.92929293, 1.93939394, 1.94949495,
       1.95959596, 1.96969697, 1.97979798, 1.98989899, 2.        ]), 'y_axis': array([0.        , 0.01010101, 0.02020202, 0.03030303, 0.04040404,
       0.05050505, 0.06060606, 0.07070707, 0.08080808, 0.09090909,
       0.1010101 , 0.11111111, 0.12121212, 0.13131313, 0.14141414,
       0.15151515, 0.16161616, 0.17171717, 0.18181818, 0.19191919,
       0.2020202 , 0.21212121, 0.22222222, 0.23232323, 0.24242424,
       0.25252525, 0.26262626, 0.27272727, 0.28282828, 0.29292929,
       0.3030303 , 0.31313131, 0.32323232, 0.33333333, 0.34343434,
       0.35353535, 0.36363636, 0.37373737, 0.38383838, 0.39393939,
       0.4040404 , 0.41414141, 0.42424242, 0.43434343, 0.44444444,
       0.45454545, 0.46464646, 0.47474747, 0.48484848, 0.49494949,
       0.50505051, 0.51515152, 0.52525253, 0.53535354, 0.54545455,
       0.55555556, 0.56565657, 0.57575758, 0.58585859, 0.5959596 ,
       0.60606061, 0.61616162, 0.62626263, 0.63636364, 0.64646465,
       0.65656566, 0.66666667, 0.67676768, 0.68686869, 0.6969697 ,
       0.70707071, 0.71717172, 0.72727273, 0.73737374, 0.74747475,
       0.75757576, 0.76767677, 0.77777778, 0.78787879, 0.7979798 ,
       0.80808081, 0.81818182, 0.82828283, 0.83838384, 0.84848485,
       0.85858586, 0.86868687, 0.87878788, 0.88888889, 0.8989899 ,
       0.90909091, 0.91919192, 0.92929293, 0.93939394, 0.94949495,
       0.95959596, 0.96969697, 0.97979798, 0.98989899, 1.        ])}

And the results are visualised with the pre-defined plots:

figures = model.plot_results(show=True)

Out:

{'text/html': '<div>            <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script>                <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n        <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script>                <div id="30d19b3e-b5a8-4b3e-8a74-c19e88642445" class="plotly-graph-div" style="height:525px; width:100%;"></div>            <script type="text/javascript">                                    window.PLOTLYENV=window.PLOTLYENV || {};                                    if (document.getElementById("30d19b3e-b5a8-4b3e-8a74-c19e88642445")) {                    Plotly.newPlot(                        "30d19b3e-b5a8-4b3e-8a74-c19e88642445",                        [{"line":{"color":"blue","dash":"solid","width":2},"mode":"lines","name":"y","showlegend":true,"x":[0.0,0.010101010101010102,0.020202020202020204,0.030303030303030304,0.04040404040404041,0.05050505050505051,0.06060606060606061,0.07070707070707072,0.08080808080808081,0.09090909090909091,0.10101010101010102,0.11111111111111112,0.12121212121212122,0.13131313131313133,0.14141414141414144,0.15151515151515152,0.16161616161616163,0.17171717171717174,0.18181818181818182,0.19191919191919193,0.20202020202020204,0.21212121212121213,0.22222222222222224,0.23232323232323235,0.24242424242424243,0.25252525252525254,0.26262626262626265,0.27272727272727276,0.2828282828282829,0.29292929292929293,0.30303030303030304,0.31313131313131315,0.32323232323232326,0.33333333333333337,0.3434343434343435,0.3535353535353536,0.36363636363636365,0.37373737373737376,0.38383838383838387,0.393939393939394,0.4040404040404041,0.4141414141414142,0.42424242424242425,0.43434343434343436,0.4444444444444445,0.4545454545454546,0.4646464646464647,0.4747474747474748,0.48484848484848486,0.494949494949495,0.5050505050505051,0.5151515151515152,0.5252525252525253,0.5353535353535354,0.5454545454545455,0.5555555555555556,0.5656565656565657,0.5757575757575758,0.5858585858585859,0.595959595959596,0.6060606060606061,0.6161616161616162,0.6262626262626263,0.6363636363636365,0.6464646464646465,0.6565656565656566,0.6666666666666667,0.6767676767676768,0.686868686868687,0.696969696969697,0.7070707070707072,0.7171717171717172,0.7272727272727273,0.7373737373737375,0.7474747474747475,0.7575757575757577,0.7676767676767677,0.7777777777777778,0.787878787878788,0.797979797979798,0.8080808080808082,0.8181818181818182,0.8282828282828284,0.8383838383838385,0.8484848484848485,0.8585858585858587,0.8686868686868687,0.8787878787878789,0.888888888888889,0.8989898989898991,0.9090909090909092,0.9191919191919192,0.9292929292929294,0.9393939393939394,0.9494949494949496,0.9595959595959597,0.9696969696969697,0.9797979797979799,0.98989898989899,1.0],"y":[1.0,1.0101010101010102,1.02020202020202,1.0303030303030303,1.0404040404040404,1.0505050505050506,1.0606060606060606,1.0707070707070707,1.0808080808080809,1.0909090909090908,1.101010101010101,1.1111111111111112,1.121212121212121,1.1313131313131313,1.1414141414141414,1.1515151515151516,1.1616161616161615,1.1717171717171717,1.1818181818181819,1.191919191919192,1.202020202020202,1.2121212121212122,1.2222222222222223,1.2323232323232323,1.2424242424242424,1.2525252525252526,1.2626262626262625,1.2727272727272727,1.2828282828282829,1.2929292929292928,1.303030303030303,1.3131313131313131,1.3232323232323233,1.3333333333333335,1.3434343434343434,1.3535353535353536,1.3636363636363638,1.3737373737373737,1.3838383838383839,1.393939393939394,1.404040404040404,1.4141414141414141,1.4242424242424243,1.4343434343434343,1.4444444444444444,1.4545454545454546,1.4646464646464648,1.474747474747475,1.4848484848484849,1.494949494949495,1.5050505050505052,1.5151515151515151,1.5252525252525253,1.5353535353535355,1.5454545454545454,1.5555555555555556,1.5656565656565657,1.5757575757575757,1.5858585858585859,1.595959595959596,1.606060606060606,1.6161616161616164,1.6262626262626263,1.6363636363636365,1.6464646464646466,1.6565656565656566,1.6666666666666667,1.676767676767677,1.6868686868686869,1.696969696969697,1.7070707070707072,1.7171717171717171,1.7272727272727273,1.7373737373737375,1.7474747474747474,1.7575757575757578,1.7676767676767677,1.7777777777777777,1.787878787878788,1.797979797979798,1.8080808080808082,1.8181818181818183,1.8282828282828283,1.8383838383838385,1.8484848484848486,1.8585858585858586,1.8686868686868687,1.878787878787879,1.8888888888888888,1.8989898989898992,1.9090909090909092,1.9191919191919191,1.9292929292929295,1.9393939393939394,1.9494949494949496,1.9595959595959598,1.9696969696969697,1.97979797979798,1.98989898989899,2.0],"type":"scatter"}],                        {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"title":{"text":""},"xaxis":{"title":{"text":"y_axis"},"showgrid":true},"yaxis":{"title":{"text":""},"showgrid":true}},                        {"responsive": true}                    )                };                            </script>        </div>'}

Plot of y_vs_y_axis

figures["y_vs_y_axis"]

Total running time of the script: ( 0 minutes 0.106 seconds)

Download Python source code: plot_MockCurves_Dummy.py

Download Jupyter notebook: plot_MockCurves_Dummy.ipynb

Gallery generated by mkdocs-gallery