recherche:softs:thermocalc

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

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.favrerecherche: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:** Your EMSE username   - **Username:** Your EMSE username  
 - **SSH Port:** 22   - **SSH Port:** 22  
-- **Session Type:** LXDE  +- **Session Type:** ICEWM  
  
 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:** This password can be requested via email from **Quentin Gaillard** or **Julien Favre**.+- **Password:** Please contact Quentin Gaillard or Julien Favre by e-mail to request this password. The cost of obtaining the password is a coffee and a croissant.
  
-FYI, this activation will generate a permanent key somewhere in your "home folder,eliminating the need to repeat this process for future uses.+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 96: Ligne 94:
 8) **If your X2Go session is frozen**, you can log in via a simple SSH terminal (without the X11 option) and use the following commands to close the stuck X2Go session: 8) **If your X2Go session is frozen**, you can log in via a simple SSH terminal (without the X11 option) and use the following commands to close the stuck X2Go session:
  
-   - View running processes:  +   - View running processes: 
      ```      ```
      top      top
Ligne 108: 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/downloads/support/python/python/index.html+**Alternative file transfer method (SSH/Linux) - SSH-X/SSHFS**
  
-Pour utiliser TC-Pythonif faut lancer un IDE Python. Deux IDE sont disponibles: Spyder, et PyCharm. Pour lancer Spyder, taper la commande "spyder3" dans une console. Pour lancer PyCharm, cliquer sur l'icone Pycharm dans la section "Programmation" du menu démarrerou bien exécuter la commande "/opt/pycharm-community-2020.1/bin/pycharm.sh"+If you are connecting to the remote pc with **SSH**you can 'mount' the remote pc's folders to your computedand 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'environnement manquantes dans l'environnement Python. Donc bien mettre ceci dans votre script:+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 ~/thermocalc-remote`, meaning you create a directory called `thermocalc-remote` in your personnal folder) 
-import os + 
-del os.environ['SSH_CONNECTION'] +3) Use the following command to mount the remote pc folder to the one you just created : 
-os.environ["PATH"]+=":/opt/Thermo-Calc/2020b+  ``` 
-os.environ["PATH"]+=":/opt/Thermo-Calc/2020b/SDK/TCAPI" +  sshfs -o idmap=user <your EMSE id>@193.49.173.62:/home/local/EMSE2000/<your EMSE id~/thermocalc-remote 
-os.environ["PATH"]+=":/opt/Thermo-Calc/2020b/SDK/TQ" +  ``` 
-os.environ["TC20B_HOME"]="/opt/Thermo-Calc/2020b" +   
-os.environ["LSHOST"]="NO-NET" +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["LSERVRC"]="/opt/Thermo-Calc/lservrc" + 
-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 : 
-</Code>+- 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/jean.bon ~/thermocalc-remote
 +  ``` 
 +   
 +- 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 can be used through a Python API, allowing for scripting and automated calculations:   
 +🔗 [TC-Python Documentation](https://thermocalc.com/support/documentation/tc-python-help/) 
 + 
 +**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, for the first use, you must run the Python script located at  
 +``` 
 +/opt/Thermo-Calc/2025a/SDK/TC-Python/Examples/Miscellaneous/pyex_M_04_license.py 
 +``` 
 +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:   
 +``` 
 +/opt/Thermo-Calc/2025a/SDK/TC-Python/Examples/ 
 +``` 
 + 
 +**Documentation**
  
-Pour l'utilisation de TC-Python, se référer aux exemples qui sont disponibles dans le dossier /opt/Thermo-Calc/2020a/SDK/TC-Python/Examples, ainsi que sur l'aide en ligne et sur la documentation Thermo-Calc.+You can also access the official documentation at:   
 +``` 
 +/opt/Thermo-Calc/2025a/Manuals/TC-Python/index.html 
 +```
  
 ----------------------------------------- -----------------------------------------
Ligne 204: 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     temperature in the system
 +    P     pressure in the system
 +    N     total system size (in moles)
 +    B     total system site (in grams)
 +    N(<component> mole number of a component in the system
 +    X(<component> mole fraction of a component in the system
 +    B(<component> mass (grams) of a component in the system
 +    W(<component> mass fraction of a component in the system
 +    ACR(<component> activity of a component in the system
 +    MUR(<component> chemical potential of a component in the system
 +    N(<phase>,<component> mole number of a component in a phase
 +    X(<phase>,<component> mole fraction of a component in a phase
 +    B(<phase>,<component> mass (grams) of a component in a phase
 +    W(<phase>,<component> mass fraction of a component in a phase
 +    ACR(<phase>,<component> activity of a component in a phase
 +    MUR(<phase>,<component> chemical potential of a component in a phase
 +    H             enthalpy in the whole system
 +    HM(<phase>  enthalpy of a phase (per mole)
 +
 +
 </Code> </Code>
  
  • recherche/softs/thermocalc.1738164066.txt.gz
  • Dernière modification : 29/01/2025 16:21
  • de julien.favre