Skip to content

Note

Click here to download the full example code

Overview of the MockCurvesXRange 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 = "MockCurvesXRange"
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 MockCurvesXRange: 

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_left": [-0.5], "x_right": [0.5], "y_max": [1.0]}

   Default numerical variables:
   {}

   Default boundary conditions variables:
   {}

   Default material variables:
   {}
model_inputs:
   [
    "x_left",
    "x_right",
    "y_max"
]
model_outputs:
   [
    "x_left",
    "x_right",
    "y_axis",
    "y",
    "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_left': array([-0.5]), 'x_right': array([0.5]), 'y_max': array([1.]), 'cpu_time': array([1.85438347]), 'date': array(['2025-11-05 22:19:51.413435'], dtype='<U26'), 'description': array([''], dtype='<U1'), 'directory_archive_job': array(['..\\model_runs\\archive\\model_gallery\\MockCurvesXRange\\Dummy\\1'],
      dtype='<U60'), '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(['MockCurvesXRange'], dtype='<U16'), '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([4.99223491e-01, 4.80104069e-01, 4.61190193e-01, 4.42504527e-01,
       4.24068265e-01, 4.05901175e-01, 3.88021655e-01, 3.70446778e-01,
       3.53192344e-01, 3.36272932e-01, 3.19701952e-01, 3.03491697e-01,
       2.87653389e-01, 2.72197236e-01, 2.57132480e-01, 2.42467444e-01,
       2.28209582e-01, 2.14365527e-01, 2.00941134e-01, 1.87941527e-01,
       1.75371140e-01, 1.63233761e-01, 1.51532568e-01, 1.40270170e-01,
       1.29448643e-01, 1.19069560e-01, 1.09134027e-01, 9.96427143e-02,
       9.05958775e-02, 8.19933888e-02, 7.38347566e-02, 6.61191462e-02,
       5.88453963e-02, 5.20120329e-02, 4.56172794e-02, 3.96590627e-02,
       3.41350144e-02, 2.90424673e-02, 2.43784445e-02, 2.01396407e-02,
       1.63223933e-02, 1.29226389e-02, 9.93585077e-03, 7.35694796e-03,
       5.18016101e-03, 3.39882650e-03, 2.00505438e-03, 9.89139398e-04,
       3.38357018e-04, 3.36837598e-05, 3.54172010e-05, 3.55769622e-04,
       1.04004269e-03, 2.10823879e-03, 3.57373695e-03, 5.44674104e-03,
       7.73554550e-03, 1.04471536e-02, 1.35876267e-02, 1.71622995e-02,
       2.11759202e-02, 2.56327453e-02, 3.05366039e-02, 3.58909420e-02,
       4.16988515e-02, 4.79630884e-02, 5.46860818e-02, 6.18699362e-02,
       6.95164275e-02, 7.76269944e-02, 8.62027254e-02, 9.52443412e-02,
       1.04752174e-01, 1.14726146e-01, 1.25165736e-01, 1.36069958e-01,
       1.47437323e-01, 1.59265805e-01, 1.71552805e-01, 1.84295110e-01,
       1.97488850e-01, 2.11129455e-01, 2.25211612e-01, 2.39729210e-01,
       2.54675297e-01, 2.70042025e-01, 2.85820598e-01, 3.02001218e-01,
       3.18573030e-01, 3.35524066e-01, 3.52841188e-01, 3.70510029e-01,
       3.88514937e-01, 4.06838915e-01, 4.25463565e-01, 4.44369031e-01,
       4.63533940e-01, 4.82935348e-01, 5.02548687e-01, 5.22347711e-01]), 'y_axis': array([-0.5       , -0.48989899, -0.47979798, -0.46969697, -0.45959596,
       -0.44949495, -0.43939394, -0.42929293, -0.41919192, -0.40909091,
       -0.3989899 , -0.38888889, -0.37878788, -0.36868687, -0.35858586,
       -0.34848485, -0.33838384, -0.32828283, -0.31818182, -0.30808081,
       -0.2979798 , -0.28787879, -0.27777778, -0.26767677, -0.25757576,
       -0.24747475, -0.23737374, -0.22727273, -0.21717172, -0.20707071,
       -0.1969697 , -0.18686869, -0.17676768, -0.16666667, -0.15656566,
       -0.14646465, -0.13636364, -0.12626263, -0.11616162, -0.10606061,
       -0.0959596 , -0.08585859, -0.07575758, -0.06565657, -0.05555556,
       -0.04545455, -0.03535354, -0.02525253, -0.01515152, -0.00505051,
        0.00505051,  0.01515152,  0.02525253,  0.03535354,  0.04545455,
        0.05555556,  0.06565657,  0.07575758,  0.08585859,  0.0959596 ,
        0.10606061,  0.11616162,  0.12626263,  0.13636364,  0.14646465,
        0.15656566,  0.16666667,  0.17676768,  0.18686869,  0.1969697 ,
        0.20707071,  0.21717172,  0.22727273,  0.23737374,  0.24747475,
        0.25757576,  0.26767677,  0.27777778,  0.28787879,  0.2979798 ,
        0.30808081,  0.31818182,  0.32828283,  0.33838384,  0.34848485,
        0.35858586,  0.36868687,  0.37878788,  0.38888889,  0.3989899 ,
        0.40909091,  0.41919192,  0.42929293,  0.43939394,  0.44949495,
        0.45959596,  0.46969697,  0.47979798,  0.48989899,  0.5       ])}

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="b7888595-f831-44f0-b23a-5c5a33bcb2a6" class="plotly-graph-div" style="height:525px; width:100%;"></div>            <script type="text/javascript">                                    window.PLOTLYENV=window.PLOTLYENV || {};                                    if (document.getElementById("b7888595-f831-44f0-b23a-5c5a33bcb2a6")) {                    Plotly.newPlot(                        "b7888595-f831-44f0-b23a-5c5a33bcb2a6",                        [{"line":{"color":"blue","dash":"solid","width":2},"mode":"lines","name":"y","showlegend":true,"x":[-0.5,-0.4898989898989899,-0.4797979797979798,-0.4696969696969697,-0.4595959595959596,-0.4494949494949495,-0.4393939393939394,-0.4292929292929293,-0.41919191919191917,-0.40909090909090906,-0.398989898989899,-0.3888888888888889,-0.3787878787878788,-0.3686868686868687,-0.35858585858585856,-0.3484848484848485,-0.33838383838383834,-0.3282828282828283,-0.3181818181818182,-0.30808080808080807,-0.29797979797979796,-0.28787878787878785,-0.2777777777777778,-0.2676767676767676,-0.25757575757575757,-0.24747474747474746,-0.23737373737373735,-0.22727272727272724,-0.21717171717171713,-0.20707070707070707,-0.19696969696969696,-0.18686868686868685,-0.17676767676767674,-0.16666666666666663,-0.15656565656565652,-0.1464646464646464,-0.13636363636363635,-0.12626262626262624,-0.11616161616161613,-0.10606060606060602,-0.09595959595959591,-0.0858585858585858,-0.07575757575757575,-0.06565656565656564,-0.055555555555555525,-0.045454545454545414,-0.035353535353535304,-0.025252525252525193,-0.015151515151515138,-0.0050505050505050275,0.005050505050505083,0.015151515151515249,0.025252525252525304,0.03535353535353536,0.045454545454545525,0.05555555555555558,0.06565656565656575,0.0757575757575758,0.08585858585858586,0.09595959595959602,0.10606060606060608,0.11616161616161624,0.1262626262626263,0.13636363636363646,0.14646464646464652,0.15656565656565657,0.16666666666666674,0.1767676767676768,0.18686868686868696,0.19696969696969702,0.20707070707070718,0.21717171717171724,0.2272727272727273,0.23737373737373746,0.24747474747474751,0.2575757575757577,0.26767676767676774,0.2777777777777778,0.28787878787878796,0.297979797979798,0.3080808080808082,0.31818181818181823,0.3282828282828284,0.33838383838383845,0.3484848484848485,0.3585858585858587,0.36868686868686873,0.3787878787878789,0.38888888888888895,0.3989898989898991,0.40909090909090917,0.4191919191919192,0.4292929292929294,0.43939393939393945,0.4494949494949496,0.45959595959595967,0.4696969696969697,0.4797979797979799,0.48989898989898994,0.5],"y":[0.4992234907487867,0.4801040689642866,0.4611901931494789,0.44250452737409735,0.4240682646738294,0.4059011751222011,0.3880216551438206,0.37044677776898316,0.3531923435487933,0.3362729318685457,0.3197019524150508,0.30349169657083486,0.28765338852462713,0.2721972359032143,0.25713247974455083,0.24246744364590508,0.2282095819337488,0.2143655267140151,0.2009411336721789,0.18794152650230714,0.17537113985268063,0.1632337606827059,0.1515325679314846,0.14027017040240397,0.12944864277024032,0.11906955961721037,0.1091340274017836,0.0996427142583113,0.0905958775159267,0.08199338881069643,0.07383475664426276,0.06611914621324168,0.05884539629362787,0.05201203290936123,0.04561727943807416,0.03965906270094621,0.03413501443387973,0.029042467322441663,0.02437844446861651,0.020139640685826136,0.01632239329056433,0.012922638895557094,0.009935850772393826,0.007356947962350958,0.005180161008381714,0.0033988265002523636,0.0020050543767699087,0.0009891393979050405,0.0003383570179341432,3.368375982130128e-05,3.541720102170677e-05,0.00035576962194699556,0.0010400426934982388,0.002108238785584202,0.0035737369453425665,0.005446741044034632,0.007735545500994219,0.010447153604931203,0.013587626708224023,0.017162299492027834,0.021175920237034157,0.02563274533359915,0.03053660393191063,0.03589094200310087,0.04169885151903557,0.04796308842232786,0.054686081835285956,0.06186993619142014,0.06951642747780715,0.07762699444659873,0.08620272542877008,0.09524434122646887,0.10475217444953581,0.11472614558254457,0.12516573601170072,0.13606995819988207,0.14743732316874586,0.15926580542624885,0.17155280546403673,0.1842951099405187,0.19748884966097524,0.21112945546498965,0.22521161213329163,0.23972921043031073,0.2546752974050779,0.2700420250813116,0.2858205976774315,0.3020012175086942,0.3185730297365339,0.3355240661444416,0.352841188135214,0.370510029161131,0.3885149368164562,0.4068389148405875,0.4254635653001189,0.44436903123894456,0.4635339401072945,0.4829353483031174,0.5025486871824708,0.5223477109194146],"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.097 seconds)

Download Python source code: plot_MockCurvesXRange_Dummy.py

Download Jupyter notebook: plot_MockCurvesXRange_Dummy.ipynb

Gallery generated by mkdocs-gallery