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([0.16191387]), 'date': array(['2026-03-26 14:54:08.993871'], dtype='<U26'), 'description': array([''], dtype='<U1'), 'directory_archive_job': array(['/home/sebastien.bocquet/PycharmProjects/vimseo/docs/runnable_examples/model_runs/archive/model_gallery/MockCurvesXRange/Dummy/2'],
      dtype='<U127'), 'directory_archive_root': array(['/home/sebastien.bocquet/PycharmProjects/vimseo/docs/runnable_examples/model_runs/archive/model_gallery'],
      dtype='<U102'), 'directory_scratch_job': array([''], dtype='<U1'), 'directory_scratch_root': array(['/home/sebastien.bocquet/PycharmProjects/vimseo/docs/runnable_examples/model_runs/scratch/model_gallery'],
      dtype='<U102'), 'error_code': array([0]), 'job_name': array([''], dtype='<U1'), 'load_case': array(['Dummy'], dtype='<U5'), 'machine': array(['IPF7101'], dtype='<U7'), '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(['d0050d8de498c8354552cdde540fb3e524454871'], 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)

Plot of y_vs_y_axis

figures["y_vs_y_axis"]

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

Download Python source code: plot_MockCurvesXRange_Dummy.py

Download Jupyter notebook: plot_MockCurvesXRange_Dummy.ipynb

Gallery generated by mkdocs-gallery