Search found 11 matches

by szlyc0706
16 Apr 2024, 18:55
Forum: General
Topic: Storing an variable from UDF at each iteration step
Replies: 2
Views: 179

Re: Storing an variable from UDF at each iteration step

I've made some progress! writing in is using call ListAddConsReal(Model%Simulation,'Name',newXVec) it is working because I can get values out by ListGetConstReal( Model % Simulation, 'Name', found) I am able to write into model%simulation. Is this the right method to be used and the 'Model%Simulatio...
by szlyc0706
16 Apr 2024, 18:09
Forum: General
Topic: Storing an variable from UDF at each iteration step
Replies: 2
Views: 179

Storing an variable from UDF at each iteration step

Hi Elmer users, I am writing a UDF which has input 'xVec' and output 'newXVec', and newXVec is calculated based on current and previous value of xVec in the iteration. So ideally I need somewhere to store an array, and at each node when my UDF is called the array size +1, so the history of newXVec i...
by szlyc0706
04 Apr 2024, 16:41
Forum: General
Topic: Unexpected value for 'n' in UDF
Replies: 10
Views: 572

Re: Unexpected value for 'n' in UDF

Hi Both, Thanks very much for your replies, please see the attachment for my mesh file, .sif and .f90. The book <<ELMER Guide to FEM simulations>> is at link :https://diposit.ub.edu/dspace/bitstream/2445/143918/1/ELMER-Guide_to_FEM_simulations_v03.pdf , the sentence about the format of UDF is on pag...
by szlyc0706
04 Apr 2024, 12:53
Forum: General
Topic: Unexpected value for 'n' in UDF
Replies: 10
Views: 572

Re: Unexpected value for 'n' in UDF

Yes, I think I know what you are trying to explain, but the problem is: The input variables of my UDF seems to be (model, 'unknown', coordinate x, coordinate y, coordinate z). Following one of the previous post using UDF: https://www.elmerfem.org/forum/viewtopic.php?p=30127&hilit=model%2C+n#p301...
by szlyc0706
03 Apr 2024, 19:08
Forum: General
Topic: Unexpected value for 'n' in UDF
Replies: 10
Views: 572

Re: Unexpected value for 'n' in UDF

Hi, Here is the detail of function 'xecRealFunction' in Elmer code: RECURSIVE FUNCTION execrealfunction(fptr, model, node, val) RESULT(realval) IMPLICIT NONE INTEGER(KIND=AddrInt) :: fptr TYPE(Model_t), POINTER :: model INTEGER :: node REAL(KIND=dp) :: val(*) REAL(KIND=dp) :: realval INTERFACE FUNCT...
by szlyc0706
03 Apr 2024, 18:19
Forum: General
Topic: Unexpected value for 'n' in UDF
Replies: 10
Views: 572

Re: Unexpected value for 'n' in UDF

Hi Kevinarden, Thanks very much for your reply! but i am still confusing. I have tried more variable in the 'catch' using code: MyFunc(Model,n, x, y, k,w)RESULT(br) it seems that n stays as the old value, x, y, k catch the coordinate of xyz, w returns no value. if the code of call is the right one t...
by szlyc0706
03 Apr 2024, 16:52
Forum: General
Topic: Unexpected value for 'n' in UDF
Replies: 10
Views: 572

Unexpected value for 'n' in UDF

Hi Everyone, I am meeting a problem when writing my UDF: From the book <<ELMER guide to FRM>> p38. Says that UDF should has format FUNCTION name_func ( model, n, var ) RESULT(result) where n is the node, also from the Elmer source code, the way that UDF is called is by xecRealFunction( ptr % PROCEDU...
by szlyc0706
27 Mar 2024, 14:13
Forum: General
Topic: Non-linear demagnetization curve input for magnet material
Replies: 6
Views: 1002

Re: Non-linear demagnetization curve input for magnet material

Thanks very much for your help! working now
by szlyc0706
27 Mar 2024, 13:32
Forum: General
Topic: Non-linear demagnetization curve input for magnet material
Replies: 6
Views: 1002

Re: Non-linear demagnetization curve input for magnet material

Thanks very much!!!! now my .dll file is successfully generated. But now i am facing another problem. Do you know where do I store it so it can be recognized by Elmer? because when I try to call this function in my .sif file it says: Loading user function library: [GetWorkingPoint]...[GetWorkingPoin...
by szlyc0706
26 Mar 2024, 20:34
Forum: General
Topic: Non-linear demagnetization curve input for magnet material
Replies: 6
Views: 1002

Re: Non-linear demagnetization curve input for magnet material

Thanks very much for your reply Kevinarden, Now I am having a problem about compiling the .f90 file into .dll. Accroading to your reply of a post 15 years ago, there are two ways of doing this: 1:I clicked on Run -> compiler -> select the .f90 file, the following message is shown in the compiler log...