TutorialΒΆ

This section introduces the usage of embedded scripting step-by-step. Section Project Setup starts with a definition of a test project, where all input data are still fixed by the .jcm files. The following sections show how embedded scripting will help you to define parameterized projects in an intuitive manner.

The archive PythonInterface.zip contains all tutorial examples in sub-folders, according to the subsections of this tutorial (Project Setup, Keyword Substitution, etc).

To run a project, switch to the respective project directory and execute the driver script run.py. When using your own Python interpreter it is necessary to configure the PYTHONPATH such that the module jcmwave can be loaded (see Getting Started).

Besides run.py, you will find scripts run_geo.py in some of the project folders. These will only generate the mesh file grid.jcm and visualize it, instead of solving the entire project.

Alternatively, you may use the script demo.py (demo_geo.py) placed in the root directory Tutorial which will ask you which problem to solve. This script automatically initializes JCMsuite provided that the environmental variable JCMROOT is set (e.g., on Windows). If this is not the case, the user is prompted to enter the JCMsuite installation path manually.