run ElmerFEM in Google Colab

General discussion about Elmer
Post Reply
gdacanal
Posts: 2
Joined: 21 Apr 2020, 19:40
Antispam: Yes

run ElmerFEM in Google Colab

Post by gdacanal »

Hello everone,

I am currently working on developing a code to execute ElmerFEM's Flow Step example in Google Colab.
This core code is currently under development and aims to utilize the ElmerFEM and Google Colab platform for educational purposes. It enables running ElmerFEM online directly from the GitHub repository, eliminating the need for extra software installation. Suitable for teaching Finite Element Method (FEM) in classes.

Contributions are welcome:
Code for plotting the wireframe mesh.
Code for plotting the color surfaces representing the velocity magnitude and pressure profiles.
Code for plotting the velocity profile at a specific x position.

You can find the code repository at the following link:
https://github.com/gdacanal/ElmerFEM_Colab.git

Best regards,
Gustavo
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: run ElmerFEM in Google Colab

Post by raback »

Hi Gustavo,

Interesting! Will this be run under Jupyter notebooks? How generic can this be? How will the simulation be controlled? Any potential synergies with pyElmer project by Arved?

-Peter
gdacanal
Posts: 2
Joined: 21 Apr 2020, 19:40
Antispam: Yes

Re: run ElmerFEM in Google Colab

Post by gdacanal »

Hi Peter,

Thank you for your feedback! The purpose of running ElmerFEM in Colab is to create a temporary virtual environment that can replicate the same steps as in a Linux OS. However, it's worth mentioning that Colab can be run on any operating system, including Windows, iOS, and Android. Many Python libraries are already pre-installed in Colab, eliminating the need for setting up a local Jupyter environment. Additionally, Colab provides a more powerful CPU compared to the "text editor" desktop setups often used in classes.
In my classes, I also plan to utilize SALOME for building more complex geometries and meshes. Certain steps may require the installation of specific software to enable these features.
Furthermore, I have noticed that the pyelmer library can also be used within Colab, but it has a particular code workflow. For my specific purposes, I intend to use the raw ElmerFEM instead. Certainly, all forms of synergy and collaboration are welcome! Please don't hesitate to share any ideas you may have.

Gustavo
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: run ElmerFEM in Google Colab

Post by kevinarden »

I did a fork on the github, I added a directory for paraview.
In the directory is a batch python script that uses pvpython to generate the velocity, pressure, and wiremesh plot from a batch script.
It assume a vtu file has been created from elmer, and that it is steady state output.
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: run ElmerFEM in Google Colab

Post by annier »

I tried running this ipynb file with jupyter notebook in my local PC (with all requirements pre-installed beforehand), and it works perfect.

In order to run in the notebook within the local computer, I made the following type of change:

Code: Select all

%%shell
ls
with

Code: Select all

#%%shell
!ls
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Post Reply