Non-linear material

Discussion about building and installing Elmer
Sayan
Posts: 112
Joined: 06 Dec 2020, 12:44
Antispam: Yes

Non-linear material

Post by Sayan »

Hiii,
From the tutorial I have learnt that a user defined material property can be included in Elmer by compiling the UMAT format. As I am not that much expert in dealing with this compilation it would be really helpful if anyone suggest me how can I create and compile bilinear material property in Elmer.

Thanks and regards,
Sayan
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Non-linear material

Post by kevinarden »

viewtopic.php?f=18&t=6943

viewtopic.php?f=18&t=6929

https://github.com/mrkearden/UMATLIB

Elmer comes with the compiler elmerf90

elmerf90 myumat.f90 -o myumatlib
will compile the subroutine

Material input from sif
Number of Material Constants = Integer 8
Number of State Variables = Integer 0
! List material constants as {}:
Material Constants(8) = Real 0.0 0.002 57000. 0.162 63025. 1.0 63.0 5.0
Density = 1.0
Reference Temperature = 293.0
UMAT Subroutine = File "myumatlib" "bi_linear"
Name = "bi_linear" ! This specifies the CMNAME argument of UMAT
Sayan
Posts: 112
Joined: 06 Dec 2020, 12:44
Antispam: Yes

Re: Non-linear material

Post by Sayan »

hiii,
Thanking so much...I have downloaded the myUMATlib file..but when I am running my sif file the following errors are coming, though I have copied the myumat file to the specific directory in the elmersolver..What am I doing wrong here?...
Error:
Can not find myUMATLib.
Can not find myUMATLib.dll.
Can not find .\myUMATLib.
Can not find .\myUMATLib.dll.
Can not find C:\Program Files\Elmer 9.0-Release/share/elmersolver/lib\myUMATLib.
Can not find C:\Program Files\Elmer 9.0-Release/share/elmersolver/lib\myUMATLib.dll.

I have also attached my sif file.
Following error is also coming while trying to compile myUMATlib.F90 file using fortran.
Compiling Fortran...
C:\Program Files\Elmer 9.0-Release\share\elmersolver\lib\myUMATLib.F90
C:\Program Files\Elmer 9.0-Release\share\elmersolver\lib\myUMATLib.F90(18): error FOR1531: cannot find module TYPES
Error executing fl32.exe.
myUMATLib.obj - 1 error(s), 0 warning(s)
Attachments
case.sif
(2.76 KiB) Downloaded 158 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Non-linear material

Post by raback »

Did you do this?

Code: Select all

elmerf90 myumat.f90 -o myumatlib.dll
-Peter
Sayan
Posts: 112
Joined: 06 Dec 2020, 12:44
Antispam: Yes

Re: Non-linear material

Post by Sayan »

Nooo.... I really didn't understand what to do with this...Can you please guide me what to do with this? Whether I have to add this anywhere or anything else?
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Non-linear material

Post by kevinarden »

The myumat compiled version on github was compiled on linux. You have to compile the source code on wondows to make a dll, like Peter said, you have to open a command window change to the directory where the source code is and type

elmerf90 myumat.f90 -o myumatlib.dll

elmerf90 is a elmer supplied compiler
Last edited by kevinarden on 25 Feb 2021, 23:39, edited 1 time in total.
Sayan
Posts: 112
Joined: 06 Dec 2020, 12:44
Antispam: Yes

Re: Non-linear material

Post by Sayan »

After installing MinGw when I tried to compile using command window as you guiided, it's showing following error
Compiling Fortran...
C:\Users\User\Downloads\UMATLIB-plasticsolver\UMATbi_linear.F90
C:\Users\User\Downloads\UMATLIB-plasticsolver\UMATbi_linear.F90(14): error FOR1531: cannot find module TYPES
C:\Program Files\Elmer 9.0-Release\share\elmersolver\lib\myUMATLib.F90
C:\Program Files\Elmer 9.0-Release\share\elmersolver\lib\myUMATLib.F90(18): error FOR1531: cannot find module TYPES
Error executing fl32.exe.
myUMATLib.exe - 2 error(s), 0 warning(s)

I don't have much knowledge about Fortran....Can you tell me how can I fix this error?
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Non-linear material

Post by kevinarden »

You have to use the Elmer supplied compiler, elmerf90
Sayan
Posts: 112
Joined: 06 Dec 2020, 12:44
Antispam: Yes

Re: Non-linear material

Post by Sayan »

Hiii,
Thank you very much all experts for supporting an amateur like me in this forum who doesn't have any knowledge about coding.. I tried hard the way you all guided...firstly it was looking simple...but every time I may be coming up with silly question to you...This time also I am asking for a favor, if possible, can you elaborately describe the step to compile the bi_linear material so that I can run my sif file... Last time you told to compile with elmerf90..But I frankly don't know from where I can open it in my system..I have only Elmer Gui installed in my system..Where there is a tab "Run" under which there is an option "compiler".. Is it elmerf90 compiler? When I am clicking on this, a compiler log is opening up...But when running myUMATLib file which is downloaded at "download" file of "c" drive it's showing the following message:
"C:\Program Files\Elmer 9.0-Release/stripped_gfortran/bin/x86_64-w64-mingw32-gfortran.exe" -o C:/Users/User/Downloads/myUMATLib.dll C:/Users/User/Downloads/myUMATLib.F90 -DCONTIG= -DMINGW32 -DWIN32 -DHAVE_EXECUTECOMMANDLINE -DUSE_ISO_C_BINDINGS -DUSE_ARPACK -O3 -DNDEBUG -O3 -shared -I"C:\Program Files\Elmer 9.0-Release/share/elmersolver/include" -L"C:\Program Files\Elmer 9.0-Release/bin" -shared -lelmersolver

Ready

after which
i don't have any option to proceed.... So i believe it's not the same command program which you told me to open and type "elmerf90 myumat.f90 -o myumatlib.dll" to generate dll file...Hence I am begging to you if you can help me in any other way by giving a step by step instruction like from where to open command window and how to change the directory, which directory need to include etc., then it will vey much easy for a novish like me..
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Non-linear material

Post by kevinarden »

Unfortunately the Elmer compiler, and other programs, such as ElmerGrid, are not graphical interface and are not started from the menu nor a desktop icon. They have to be executed from a command terminal. Unless you update your system PATH variable you have to fully qualify file names in the command.

For example if I search my hard drive for elmerf90 it is located in C:\fea\elmer\bin

I would then go down to the menu and search for command prompt and click on open
this would open a command prompt window
I would then use dos commands to switch to the directory where the subroutine was typing
cd c:\fea\mymodel\bilinear
then I would type
c:\fea\elmer\bin\elmerf90 myumat.f90 -o myumatlib.dll
Post Reply