backend

Discovers Comsol installations on the local machine.

This is a helper module that is not part of the public API. It retrieves information about installed Comsol versions, i.e. available simulation back-ends, and locates the installation folder.

The discovery mechanism currently only works on Windows, as it relies on the Registry to provide that information.

versions()[source]

Returns version information of available Comsol installations.

Version information is returned as a list of named tuples containing the major, minor and patch version numbers, the build number, and the installation folder.

Currently, this has only been implemented for the Windows operating system. On other platforms, such as Linux and MacOS, the code here would have to be amended, namely because locating installed software is system-specific.

Raises RuntimeError if no Comsol installation was found. Raises NotImplementedError on operating systems other than Windows.

folder(version=None)[source]

Returns the path to the Comsol installation folder.

A specific Comsol version can be named, if several are installed, for example version='5.3a'. Otherwise the latest version is used.

Relies on versions() to discover installations.

Raises ValueError if the requested version is not installed.

architecture()[source]

Returns the name of the “architecture” folder inside the Comsol root folder.

That folder name is platform-dependent:

  • win64 on Windows

  • glnxa64 on Linux

  • maci64 on Mac OS

These are all builds for 64-bit CPU architectures. As Comsol no longer supports 32-bit architectures, neither does this library.

Raises OSError if the operating system the application runs on is not supported. Currently, these are all operating systems apart from Windows.

inspect(java)[source]

Inspects a Java object representing a Comsol model feature.

This is basically a “pretty-fied” version of the output from the standard dir command. It displays (prints to the console) the methods of a model node, given as a java object as provided by the Comsol API, as well as the node’s “property” names and values, if any are defined.

The node’s name, tag, and documentation reference marker are listed first. These access methods and a few others, which are common to all objects, are suppressed in the method list further down, for the sake of clarity.