Specifying coordinates in Fortran code

General discussion about Elmer
Post Reply
lmehdizadegannam
Posts: 24
Joined: 14 Apr 2021, 17:12
Antispam: Yes

Specifying coordinates in Fortran code

Post by lmehdizadegannam »

Hello,

I am using t(1), t(2), t(3), t(4) to get time and x, y, z coordinates in the Fortran code that I am implementing along with the sif file. However, I am getting really small values for t(2) and t(3). (8.1108978441432417E-318 and 3.6912158229071204E-317). It seems I did not get this right. Can you guide me how I can include node coordinates correctly in my model?

Thanks so much.
Best,
Lida
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Specifying coordinates in Fortran code

Post by kevinarden »

I think the index may start with zero. t(0), t(1), t(2), t(...)
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: Specifying coordinates in Fortran code

Post by Rich_B »

Hello,

Take a look at
elmerfem\fem\tests\fsi_beam
this test includes an F90 routine that should be helpful. The first parameter of the function call is 'Model', which gives you access to all of the model variables, such as coordinates.

Rich.
lmehdizadegannam
Posts: 24
Joined: 14 Apr 2021, 17:12
Antispam: Yes

Re: Specifying coordinates in Fortran code

Post by lmehdizadegannam »

Thanks so much Kevin and Rich for your prompt responses. I used the fsi_beam as an example and managed to resolve the issue. Thank you very much for your help.

Kindest regards,
Lida
Post Reply