Skip to content

A python script as part of my thesis work. Imported from the original GitLab instance of my Uni.

Notifications You must be signed in to change notification settings

chagatai777/flux-to-fenics-mesh-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

FLUX TO FENICS MESH EXPORTER

A python script for exporting the finite element mesh generated by Altair Flux software, in a compatible xml format that is ready to be imported into FEniCS. The script is written both to be run within Flux's PyFlux interpreter, and also from a Linux command line using the python2 or python3 interpreter. When run within Flux, the script first writes the mesh nodes, mesh faces, and the user-defined names assigned to the physical faces into their own respective txt files inside the current working directory. Then, the script feeds these txt files as inputs, and extracts relevant information for building the xml files for the mesh and the physical descriptions that are importable into FEniCS, and then creates two xml files within the working directory. When the script is run in a Linux terminal with a python interpreter, the script expects three input txt files, which are exported from Flux. And in the end, again, creates two xml files describing the mesh ready to be imported into FEniCS.

Getting Started

Download and move the python script into your working directory, which is your Flux working directory, or houses the exported txt files from Flux.

Prerequisites

The script is compatible with both python2 and python3 interpreters.

When run from a Linux terminal, script needs three txt file inputs, and two output filenames. The proper usage pattern can be seen by calling the script with -h flag:

$ python3 flux_to_fenics_mesh_transfer.py -h

When run from within Flux, the script can be run without needing any input file specification.

Running the script

To run the script within Flux, just import the script into the Flux, and run it. This will create a bunch of files into the Flux working directory:

  1. mesh-node-export-first-order.txt
  2. mesh-face-export-first-order.txt
  3. face-physical-description.txt
  4. node_element_file_cleaned.txt
  5. face_element_file_cleaned.txt
  6. face_element_node_info.txt
  7. face_element_face_info.txt
  8. face_number_reference.txt
  9. mesh.xml
  10. physical_region.xml

Of these files, first, second, and third are main inputs to the script. The eighth, ninth, and tenth files are the main outputs of the script.

For details on these files, check the project wiki.

On the other hand, user can run this python script on a Linux terminal. In this case, the user has to provide the script with the main input files mentioned above. The user also has to specify the names of the output files to be created.

An example for proper script call from a Linux terminal is given below:

python3 flux_to_fenics_mesh_transfer.py -i mesh-node-export-first-order.txt -i mesh-face-export-first-order.txt -i face-physical-description.txt -o mesh.xml -o physical_region.xml

Here, three -i flags denote the filenames of input files, and the two -o flags denote the filenames of the output files that are going to be created. The input files should have been exported from Flux software previously. This can be done by initially running the script within Flux.

Authors

  • Cagatay "Chagatai" Eren

About

A python script as part of my thesis work. Imported from the original GitLab instance of my Uni.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages