Storing an variable from UDF at each iteration step
Posted: 16 Apr 2024, 18:09
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 is recoreded.
From post https://www.elmerfem.org/forum/viewtopic.php?t=1383, it is suggesting that I need to store iterative value of newXVec into Variable_t % Values. But I couldn't find any example.
Anyone has any idea about what method I need to use for storing my variable into Variable_t % Values and where I need my store it into?
I appreciate for your help,
Eric
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 is recoreded.
From post https://www.elmerfem.org/forum/viewtopic.php?t=1383, it is suggesting that I need to store iterative value of newXVec into Variable_t % Values. But I couldn't find any example.
Anyone has any idea about what method I need to use for storing my variable into Variable_t % Values and where I need my store it into?
I appreciate for your help,
Eric