discovery¶
Discovers Comsol installations.
This is an internal 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 folders.
On Windows, the discovery mechanism relies on the Registry to provide
information about install locations. On Linux and macOS, Comsol is expected to
be installed at its respective default location. Though the folder .local in
the user’s home directory is also searched to allow symbolic linking to a
custom location.
Additionally, we also run the shell command where comsol (on Windows) or
which comsol (on Linux and macOS) to find a Comsol installation that isn’t in
a default location, but for which the Comsol executable was added to the
executable search path.
Note that duplicate installations will be ignored. That is, a Comsol installation found in a later step that reports the same version as one found in an earlier step will be ignored, regardless of install location. The one found on the search path, if any, will be prioritized.
- detect_architecture()[source]¶
Detects platform architecture to determine name of platform folder.
Comsol binaries (executables and native libraries) are found in sub-folders with special names specific to the platform architecture, such as
win64ormacarm64. We return the correct folder name based on the detected platform (OS) and CPU architecture.
- parse(version)[source]¶
Parses version information as returned by Comsol executable.
Returns
(name, major, minor, patch, build)wherenameis a string and the rest are numbers. The name is a short-hand based on the major, minor, and patch version numbers, e.g.'5.3a'.Raises
ValueErrorif the input string deviates from the expected format, i.e., the format in which the Comsol executable returns version information.