Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • Stranger Tools Stranger Tools
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 288
    • Issues 288
    • List
    • Boards
    • Service Desk
    • Milestones
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • alyaalya
  • Stranger ToolsStranger Tools
  • Wiki
  • Ansa tools documentation
  • Ansa2mpio

Ansa2mpio · Changes

Page history
Figures added and minor corrections authored Feb 03, 2021 by Samuel Gomez's avatar Samuel Gomez
Hide whitespace changes
Inline Side-by-side
Ansa-tools-documentation/Ansa2mpio.md
View page @ aa4183d8
...@@ -2,40 +2,49 @@ There are two ways to output the mpio format from Ansa, with or without GUI. ...@@ -2,40 +2,49 @@ There are two ways to output the mpio format from Ansa, with or without GUI.
## Using the GUI ## Using the GUI
**Ansa2mpio.py** is set to create a button in the Ansa User Script Button. Addtionally, it can be modified to use it with the options explained in [Running-Python-scripts-in-Ansa](Ansa-tools-documentation/Running-Python-scripts-in-Ansa). **Ansa2mpio.py** is set to create a button in the Ansa User Script Button. Addtionally, it can be modified to use it with the options explained in [Running Python scripts in Ansa](Ansa-tools-documentation/Running-Python-scripts-in-Ansa).
#### USF button #### USF button
In this case, a symbolik link has to be added to your Ansa installation folder. In this case, a symbolik link has to be added to your Ansa installation folder.
``` ```bash
cd /path/ansa/intalation/folder/scripts/CFD/ cd /path/ansa/intalation/folder/scripts/CFD/
ln -fs /path/to/stranger-tools/Ansa/Ansa2mpio/Ansa2mpio.py Ansa2mpio.py ln -fs /path/to/stranger-tools/Ansa/Ansa2mpio/Ansa2mpio.py Ansa2mpio.py
``` ```
Then edit the file which reads these functions. Then edit the file which reads these functions.
``` ```bash
cd /path/ansa/intalation/folder/config/ cd /path/ansa/intalation/folder/config/
vi CFD_TRANSL.py vi CFD_TRANSL.py
``` ```
Finally add the following lines. Finally add the following lines.
``` ```python
##Alya ##Alya
import Ansa2mpio import Ansa2mpio
``` ```
After this the buttom is added to USF:
![usf](../figures/usf.png)
1. USF buttom
1. Ansa2mpio
![Ansa2mpio](../figures/Ansa2mpio.png)
#### As python script #### As python script
This option is much more tedious because every time you start a session in Ansa you have to reload it. That is why I discourage it. In any case, it is explained what to do if you want to use this route. This option is much more tedious because every time you start a session in Ansa you have to reload it. That is why I discourage it. In any case, it is explained what to do if you want to use this route.
Edit **Ansa2mpio.py** and comment the following lines: Edit **Ansa2mpio.py** and comment the following lines:
``` ```python
linked_folder = os.path.dirname(__file__) linked_folder = os.path.dirname(__file__)
path = os.readlink(str(linked_folder) + '/Ansa2mpio.py') path = os.readlink(str(linked_folder) + '/Ansa2mpio.py')
ansa2mpio_folder = os.path.dirname(path) ansa2mpio_folder = os.path.dirname(path)
@session.defbutton('ALYA', 'Ansa2mpio', 'Output the MPIIO Alya format') @session.defbutton('ALYA', 'Ansa2mpio', 'Output the MPIIO Alya format')
``` ```
Then follow [Running-Python-scripts-in-Ansa](Ansa-tools-documentation/Running-Python-scripts-in-Ansa) guidelines. Then follow [Running Python scripts in Ansa](Ansa-tools-documentation/Running-Python-scripts-in-Ansa) guidelines.
## From the terminal ## From the terminal
The tool for this purpose is **nogui_Ansa2mpio.py** and is located in the **Ansa/Ansa2mpio** folder. An explanation to how to run python tools can be found in [Running-Python-scripts-in-Ansa](Ansa-tools-documentation/Running-Python-scripts-in-Ansa). The tool for this purpose is **nogui_Ansa2mpio.py** and is located in the **Ansa/Ansa2mpio** folder. An explanation to how to run python tools can be found in [Running Python scripts in Ansa](Ansa-tools-documentation/Running-Python-scripts-in-Ansa).
Before running the case, we have to edit the input data file **nogui_input.dat**. Located in **Ansa/Ansa2mpio/Auxiliaries** is an example. This must content the setting of your case. All options are listed and explained below. Before running the case, we have to edit the input data file **nogui_input.dat**. Located in **Ansa/Ansa2mpio/Auxiliaries** is an example. This must content the setting of your case. All options are listed and explained below.
...@@ -89,7 +98,7 @@ scaleFactor = 1 ...@@ -89,7 +98,7 @@ scaleFactor = 1
checkInt4 checkInt4
checkInt8 checkInt8
``` ```
**ansafile**: The path to the Ansa file which we mesh we want to output. **ansafile**: The path to the Ansa file which mesh we want to output.
**folder**: Path to the folder where the mesh is going to be output. **folder**: Path to the folder where the mesh is going to be output.
......
Clone repository

Ansa tools documentation

  • Running Python scripts in Ansa
  • Ansa2mpio

pyAlya documentation

  • Alya Python module