Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the demo thermal_mechanical_full #18

Open
hw-wu opened this issue Jan 18, 2024 · 7 comments
Open

Question about the demo thermal_mechanical_full #18

hw-wu opened this issue Jan 18, 2024 · 7 comments

Comments

@hw-wu
Copy link

hw-wu commented Jan 18, 2024

Hello everyone,

I've been exploring this code with a keen interest in solving coupling problems. The code successfully passed the benchmark tests and have been able to run demos.hyperelasticity.example without any issues. However, I've encountered a stumbling block while trying to work with the thermal_mechanical_full demo. I'm facing a FileNotFoundError as detailed below:

FileNotFoundError: [Errno 2] No such file or directory: '/home/myname/Desktop/jax-fem/demos/thermal_mechanical_full/input/numpy/points.npy'

I'm wondering if there's something I might miss. Any guidance or suggestions would be greatly appreciated!

@tianjuxue
Copy link
Collaborator

@xwpken Please also push the input data files to Github if they are not too large. Thanks!

@xwpken
Copy link
Collaborator

xwpken commented Jan 20, 2024

@hw-wu Hello, we have uploaded the necessary data files. If you have installed the FEniCS, you may also run the 'fenics.py' in the same folder to genereate these files.

@hw-wu
Copy link
Author

hw-wu commented Jan 21, 2024

@xwpken I really appreciate your reply. It seems that FEniCS is used to generate input file... However, when I installed mshr, it said

File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/hongwei/Desktop/jax-fem/demos/thermal_mechanical_full/fenics.py", line 16, in
domain = Rectangle(Point(0., 0.), Point(L, L)) - Circle(Point(0., 0.), R, 100)
^^^^^^^^^
NameError: name 'Rectangle' is not defined

And after searching, I found Rectangle() and Circle() functions have been deprecated (https://fenicsproject.discourse.group/t/rectangle-and-circle-functions-deprecated/3845).
So we should use an old version of mshr to generate it?

@tianjuxue
Copy link
Collaborator

@xwpken I really appreciate your reply. It seems that FEniCS is used to generate input file... However, when I installed mshr, it said

File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/home/hongwei/Desktop/jax-fem/demos/thermal_mechanical_full/fenics.py", line 16, in domain = Rectangle(Point(0., 0.), Point(L, L)) - Circle(Point(0., 0.), R, 100) ^^^^^^^^^ NameError: name 'Rectangle' is not defined

And after searching, I found Rectangle() and Circle() functions have been deprecated (https://fenicsproject.discourse.group/t/rectangle-and-circle-functions-deprecated/3845). So we should use an old version of mshr to generate it?

You don't need to run FEniCS yourself. I think Weipeng already uploaded the necessary input data to the latest repo. Please pull from Github.

@hw-wu
Copy link
Author

hw-wu commented Jan 21, 2024

Thanks for your instant reply. Yeah, you are right. The example.py can run now.. but I am trying to understand how to generate the mesh like @xwpken did in the demo...

@xwpken
Copy link
Collaborator

xwpken commented Jan 21, 2024

Thanks to Prof Xue for his explanation. For using 'fenics.py' to generate data files, you can first check the version of FEniCS. For my Linux machine, the version of FEniCS (including mshr) is 2019.1.0. In the latest FEniCSx, many APIs have changed, so running errors may occur.

@hw-wu
Copy link
Author

hw-wu commented Jan 22, 2024

Thanks for your reply. It can run now. But I also have a question. It seems that the problem is solved twice by FEniCs and JAX-FEM? I am wondering whether it is possibile to use other mesh generation tool like gmsh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants