Skip to main content

Convert Salomé-Meca MED meshes and Code_Aster .comm files into NumPy-ready Python data.

Project description

Salome2Py

CLI that converts a Salomé-Meca MED mesh plus its matching Code_Aster .comm file into NumPy-friendly Python arrays (node, elem, mater, pdof, nodf, etc.).

Installation (pipx)

pipx keeps console tools isolated per-virtualenv and works the same on Linux, macOS, and Windows.

  1. Install pipx

    • Linux/macOS:
      python3 -m pip install --user pipx
      python3 -m pipx ensurepath
      
    • Windows (PowerShell):
      py -m pip install --user pipx
      py -m pipx ensurepath
      

    Reload the shell so the pipx path is active.

  2. Install Salome2Py

    • From PyPI (once published):
      pipx install Salome2Py
      
    • From a local clone:
      pipx install .
      

This exposes the Salome2Py command globally without polluting your base interpreter. (You can still run python main.py ... directly if you prefer.)

Usage

Salome2Py [-m] [-b] [-o output.py] path/to/case.med path/to/case.comm
  • -m, --mater — include the material matrix parsed from DEFI_MATERIAU (AFFE_MATERIAU must map groups to materials).
  • -b, --boundary — include prescribed DOFs (pdof) and nodal loads (nodf) derived from DDL_IMPO / FORCE_FACE.
  • -o, --output — optional destination file (defaults to <case_folder>.py).

By default, the generated Python file is written to the directory where you invoke the command (e.g., running inside /tmp creates /tmp/input.py for an Input/ case). Use -o to override the path.

Without -m or -b, the generator writes only node, elem, eltp, and bc_method, skipping the more expensive parsing steps automatically.

Development

Install deps once (if you are not using the packaged CLI):

python -m pip install --break-system-packages meshio h5py

Then run the tool directly:

python main.py -m -b Input/DoubleCubeCase.med Input/DoubleCubeCase.comm

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

salome2py-0.6.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

salome2py-0.6.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file salome2py-0.6.0.tar.gz.

File metadata

  • Download URL: salome2py-0.6.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for salome2py-0.6.0.tar.gz
Algorithm Hash digest
SHA256 810d096c0b37eed2925f9f279b6ad5b61d0927260ca110d127a93c131aeb0a78
MD5 7cdc9a1672b30a5af57ceb9247be1e64
BLAKE2b-256 98f9f51aebe7271ce461237177d642944800745c286c8e438ca3edf4a5c82caf

See more details on using hashes here.

File details

Details for the file salome2py-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: salome2py-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for salome2py-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 458a42b2e6966861a123860e6c39f0e8874a92f00ccf40a407ef660592efaaf8
MD5 7491c04ab51fd63b8edb376eca0adc7d
BLAKE2b-256 8941b7413a697deb72d092fdec6209190a99072b606344cffe0bfd5d70556c15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page