Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| recherche:softs:thermocalc [29/01/2025 16:21] – [Connection to the Thermo-Calc PC using X2Go:] julien.favre | recherche:softs:thermocalc [19/06/2025 17:13] (Version actuelle) – jules.lhostis | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | |||
| - | |||
| ===== Connection to the Thermo-Calc PC using X2Go: ===== | ===== Connection to the Thermo-Calc PC using X2Go: ===== | ||
| Ligne 14: | Ligne 12: | ||
| - **Username: | - **Username: | ||
| - **SSH Port:** 22 | - **SSH Port:** 22 | ||
| - | - **Session Type: | + | - **Session Type: |
| 4) Leave the other options as default and save the session. | 4) Leave the other options as default and save the session. | ||
| Ligne 25: | Ligne 23: | ||
| - **Login:** Lic-100117@thermocalc.com | - **Login:** Lic-100117@thermocalc.com | ||
| - | - **Password: | + | - **Password: |
| - | FYI, this activation will generate a permanent key somewhere in your "home folder," | + | FYI, this activation will generate a permanent key somewhere in your hidden files, eliminating the need to repeat this process for future uses. |
| - | 8) **/!\ Once finished, properly close Thermo-Calc!** | + | 8) **/!\ Once finished, properly close the session!** |
| Disconnect by clicking the **Start Menu** -> **Logout**. In the popup window, click **Log out**. | Disconnect by clicking the **Start Menu** -> **Logout**. In the popup window, click **Log out**. | ||
| **Never shut down the PC**, as it would make it inaccessible to all users. | **Never shut down the PC**, as it would make it inaccessible to all users. | ||
| Ligne 109: | Ligne 107: | ||
| ``` | ``` | ||
| (Replace **XXX** with the process ID from `top`.) | (Replace **XXX** with the process ID from `top`.) | ||
| - | ===== Utilisation de TC-Python : ===== | ||
| ----------------------------------------- | ----------------------------------------- | ||
| - | Thermocalc peut être utilisé à travers un API Python, permettant de faire des scripts et des calculs automatiques : https://www2.thermocalc.com/ | + | **Alternative file transfer method (SSH/Linux) - SSH-X/SSHFS** |
| - | Pour utiliser TC-Python, if faut lancer un IDE Python. Deux IDE sont disponibles: | + | If you are connecting to the remote pc with **SSH**, you can 'mount' the remote pc's folders to your computed, and thus not need an **SSH** client. |
| - | Une fois l'IDE lancé, il faut importer tc_python, et bien rajouter des lignes de commande spécifiques à Linux, servant à rajouter les variables d' | + | 1) Install **sshfs** via your package manager (ex: `apt install sshfs` on unbuntu) |
| - | <Code:bash> | + | 2) Create a folder (directory) on **your** computer to act as a mount point (ex: `mkdir ~/ |
| - | import os | + | |
| - | del os.environ[' | + | 3) Use the following command to mount the remote pc folder to the one you just created : |
| - | os.environ[" | + | ``` |
| - | os.environ[" | + | sshfs -o idmap=user |
| - | os.environ[" | + | ``` |
| - | os.environ[" | + | |
| - | os.environ[" | + | to be sure about the right path on the remote server, when in ssh, you can type `pwd` which will show you the path to the current (remote) folder |
| - | os.environ[" | + | |
| - | from tc_python import * | + | 4) *Extra tip* you can even create an alias in your (*local*) terminal to not have to type this big command : |
| - | </ | + | - Edit your (*local*) `~/.bashrc` file and add this at the end of the file (if I am M. Jean Bon, creating the alias `mountemse` or whichever name you choose) : |
| + | |||
| + | ``` | ||
| + | # Custom aliases | ||
| + | alias mountemse="sshfs -o idmap=user jean.bon@193.49.173.62:/home/local/EMSE2000/ | ||
| + | ``` | ||
| + | |||
| + | - Then restart a terminal session so that the change can go into effect, and type the command `mountemse` and after a password prompt, you will mount your remote folder on the thermocalc pc on your local machine, so that you can access its content from your file manager seamlessly. | ||
| + | |||
| + | |||
| + | ----------------------------------------- | ||
| + | |||
| + | ===== Scripting with TC-Python | ||
| + | |||
| + | ----------------------------------------- | ||
| + | |||
| + | Thermo-Calc | ||
| + | 🔗 [TC-Python Documentation](https: | ||
| + | |||
| + | **Using TC-Python** | ||
| + | |||
| + | To use TC-Python, you need to launch a Python IDE. | ||
| + | The recommended IDE is **Spyder**, as it directly utilizes the libraries installed on the PC without requiring a virtual environment. | ||
| + | |||
| + | Click on the **Spyder** icon in the **Programming** section of the Start Menu. | ||
| + | |||
| + | **First-Time Setup** | ||
| + | |||
| + | Once the IDE is launched, make sure to import the **tc_python** library. | ||
| + | |||
| + | Additionally, | ||
| + | ``` | ||
| + | / | ||
| + | ``` | ||
| + | Executing this script will prompt you to enter your **username and password** (the same credentials as before). This process will generate a permanent key, stored in hidden folders, so you won’t need to repeat this step in the future. | ||
| + | |||
| + | **Running Scripts with TC-Python** | ||
| + | |||
| + | Once set up, you can develop or run scripts with **TC-Python**. Example scripts are available at: | ||
| + | ``` | ||
| + | / | ||
| + | ``` | ||
| + | |||
| + | **Documentation** | ||
| - | Pour l' | + | You can also access the official documentation at: |
| + | ``` | ||
| + | / | ||
| + | ``` | ||
| ----------------------------------------- | ----------------------------------------- | ||
| Ligne 205: | Ligne 248: | ||
| # GM(bcc) : énergie de Gibbs molaire de la phase bcc | # GM(bcc) : énergie de Gibbs molaire de la phase bcc | ||
| # HM(*) : enthalpie molaire de toutes les phases | # HM(*) : enthalpie molaire de toutes les phases | ||
| + | |||
| + | # Some of the state variables that can be used in conditions are: | ||
| + | T | ||
| + | P | ||
| + | N total system size (in moles) | ||
| + | B total system site (in grams) | ||
| + | N(< | ||
| + | X(< | ||
| + | B(< | ||
| + | W(< | ||
| + | ACR(< | ||
| + | MUR(< | ||
| + | N(< | ||
| + | X(< | ||
| + | B(< | ||
| + | W(< | ||
| + | ACR(< | ||
| + | MUR(< | ||
| + | H | ||
| + | HM(< | ||
| + | |||
| + | |||
| </ | </ | ||