IFM Kernel Methods

class ifm.ifm
configureLicense('config')

Configure how FEFLOW selects and uses a license.

Parameters:

config (str) – License configuration string. Supports the following options (case-insensitive): - demo: run FEFLOW in demo mode (max 5 slices with max 2500 nodes) - viewer: run FEFLOW in viewer mode (unlimited size but no write operations) - standard: run FEFLOW in standard mode (license defined by problem class and availability) – DEFAULT - engine: allocate FEFLOW_ENGINE license instead of F3…FMH3. Only available in batch and Python mode - F3|FM3|FH3|FMH3: standard mode but accept only selected license - classroom: run FEFLOW in classroom mode (max 50000 nodes when FEFLOW_CLASSROOM license found) - config=<json_file>: import a JSON configuration file - user=xxx@yyy.com,passwd=ZZZ,feflow:options=FM3,advanced:options=GEODE+PYSMH”

Return type:

None

Example

>>> ifm.configureLicense('standard')
>>> ifm.configureLicense('viewer')
>>> ifm.configureLicense('config=lic_config.json')

Warning

This function is only available from FEFLOW 11

enableScripting(enable)

Enables FEFLOW internal Python scripts.

Parameters:

enable (bool) – True to enable Script execution, False to disable.

forceLicense(options)

Force FEFLOW to use a specific license option when opening the model.

Parameters:

options (str) – license options - e.g. “FM2”, “FMH3”, “Viewer”

Example

>>> doc = ifm.forceLicense("Viewer")

Warning

This function is only available until FEFLOW 10. From FEFLOW 11, please have a look at the function “configureLicense”.

getDocument(document_id)

Get an active FEFLOW document. Used in Multi-Document operations when multiple FEFLOW models are loaded by the ifm at the same time.

Parameters:

document_id (int) – The id of the document.

Returns:

The requested FEFLOW document.

Return type:

ifm.FeflowDoc

getKernelRevision()

Retrieve build system version number Currently, this version number corresponds with the SVN revision of the source code control system.

Returns:

Returns decimal FEM kernel version, e.g., 18503 for FEFLOW 7.3.0.18503

Return type:

int

getKernelVersion()

Retrieve FEFLOW kernel version

Returns:

Returns decimal FEM kernel version, e.g., 7000 for FEFLOW 7.0

Return type:

int

getNumberOfDocuments()

Get the total number of active FEFLOW documents.

Returns:

The total number of active FEFLOW documents.

Return type:

int

loadDocument(filename)

Load a FEFLOW model (.fem) or FEFLOW results file (.dac) as a FEFLOW document.

Parameters:

filename (str) – path to FEFLOW model .

Returns:

Returns decimal FEM kernel version, e.g., 7000 for FEFLOW 7.0

Return type:

ifm.FeflowDoc

Example

>>> doc = ifm.loadDocument("MyModel.fem")
registerIfmModules(module_path)

Register IFM module(s) to the current user’s profile

Parameters:

module (str or list of str) – module_path or list of module_paths

setThreads(threads_assembly, threads_solver)

Set threads for matrix assembly and matrix solving

Parameters:
  • threads_assembly (int) – number of threads for matrix assembly

  • threads_solver (int, optional) – number of threads for matrix solving

Example

>>> n_threads = 4
>>> doc = ifm.setThreads(n_threads)
>>> n_threads_solver = 2
>>> doc = ifm.setThreads(n_threads, n_threads_solver)
unregisterIfmModules(module_id)

Unregister IFM module(s) from the current user’s profile

Parameters:

module_id – Module_id or list of module ids.