Getting Started¶
Warning
Since Verion 7.4 JCMsuite no longer provides a bundled Python distribution. Instead it relies on your system’s python installation. Please make sure that the packages NumPy/Scipy [1] and optionally MatplotLib [2] are available.
To use|JCMsuite| within your Python interpreter you must import the module jcmwave that is placed in the sub-folder ThirdPartySupport/Python of your JCMsuite installation. Please add this path your PYTHONPATH environment variable. Alternatively, the python search path can be updated within Python before importing the module jcmwave:
import sys
import os
jcm_root = <JCMROOT> # -> set your JCMROOT installation directory
sys.path.append(os.path.join(jcm_root, 'ThirdPartySupport', 'Python'))
Or, when the environmental variable JCMROOT is set, e.g., on Windows:
import sys
import os
sys.path.append(os.path.join(os.getenv('JCMROOT'), 'ThirdPartySupport', 'Python'))
Use the command info to check that the Python interface is now properly available:
# now import jcmwave
import jcmwave
# call jcmwave.info to check the JCMsuite installation
jcmwave.info()
The entire Python interface consists of the following routines:
edit.py: Opens files in JCMsuite’s editor
JCMcontrol.geo.py: Wraps JCMsuite’s command line tool
JCMgeo.info.py: Prints installation and system details.
jcmt2jcm.py: Tool for Embedded Scripting support.
loadcartesianfields.py: Loads cartesian fieldbag in
.jcmformat.loadtable.py: Loads table in
.jcmformat.set_memory_limit.py: Sets the maximum amount of RAM used by the JCMsolve.
set_num_threads.py: Sets number of used CPU cores.
set_gpus.py: Sets usage of GPUs.
set_ooc_drive.py: Sets swapping directory for out-of-core computation.
resultbag.py: Stores computational results.
solve.py: Wraps JCMsuite’s command line tool
JCMsolve.startup.py: Initialize the matlab interface.
view.py: Wraps JCMsuite’s fieldbag viewer.
Daemon Command Reference: This bunch of python routines helps to parallelize jobs on a computer cluster.
All routines provide detailed online help, e.g., use
help(jcmwave.solve)
to obtain help on jcmwave.solve.