Skip to content

Note

Click here to download the full example code

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

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:
   {"a": [1.0], "a_m": [0.0], "a_n": [0.1], "h": [2], "m": [3], "n": [2]}

   Default numerical variables:
   {}

   Default boundary conditions variables:
   {}

   Default material variables:
   {}
model_inputs:
   [
    "a",
    "a_m",
    "a_n",
    "h",
    "m",
    "n"
]
model_outputs:
   [
    "a_h",
    "n_dof",
    "cpu_time",
    "error_code",
    "model",
    "load_case",
    "description",
    "job_name",
    "persistent_result_files",
    "n_cpus",
    "date",
    "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:

{'a': array([1.]), 'a_n': array([0.1]), 'h': array([2]), 'n': array([2]), 'a_m': array([0.]), 'm': array([3]), 'a_h': array([0.6]), 'cpu_time': array([0.03069019]), 'date': array(['2025-11-05 22:19:45.012547'], dtype='<U26'), 'description': array([''], dtype='<U1'), 'directory_archive_job': array(['..\\model_runs\\archive\\model_gallery\\MockConvergence\\Dummy\\1'],
      dtype='<U59'), '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(['MockConvergence'], dtype='<U15'), 'n_cpus': array([1]), 'n_dof': array([0.125]), 'persistent_result_files': array([''], dtype='<U1'), 'user': array(['sebastien.bocquet'], dtype='<U17'), 'vims_git_version': array(['95990fa211debd91a91ffe1d89b2b0b4b855f387'], dtype='<U40')}

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

figures = model.plot_results(show=True)

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

Download Python source code: plot_MockConvergence_Dummy.py

Download Jupyter notebook: plot_MockConvergence_Dummy.ipynb

Gallery generated by mkdocs-gallery