Is it possible to use a measure as input to the user input values of a subroutine? I want to use the previous values of a contact force in order to change the force's value in the current step i.e., I want to create a measure of a contact force and use it as input to its user written subroutine (cnfsub).
In general, don't use measures, use requests. But in this case, it might be different.
But in practicality, measures are just solver variables that are not checked for error during the numerical solving process. So it would be better for you to create a solver variable for the contact force and use that one.
But either one should be able to be referenced by your subroutine by calling SYSFNC with a VARVAL argument.
Wouldn't the input to the VARVAL argument still have to be a measure of the contact force? What would the difference be then? Unless I don't understand what you mean by solver variable correctly.
A measure is a solver variable. Only difference is that there is no error control on measures.
But compared to requests, they should be calculated at every integration step whereas the requests are only calculated at output steps. At least this was the case when I last used a measure and draw the conclusion that they are more or less useless. And I never looked at them since.
Thanks for the advice, I shall take this into account.
Would it be possible to tell me how to reference the contact force though? Is there a similar call to the DISP or FORCE statements? I wasn't able to find anything similar in the documentation.
This was the syntax for VARVAL I found in the documentation. That's why I am asking.
This is the way I am using it right now. I believe it's the same as you suggested. Still, this way I get wrong values, different from the ones that I'd get when plotting the same component in the ppt.
To be more precise, I made sure that my function always returns a value of 1000 as force. When reviewing the ppt results there is indeed a constant value of 1000 for the contact force, but when printing the results of the evaluation of VAR/1, there are some random values like 2000 or - 1000 when the contact force should be zero. As JSlat suggested, this might be due to the fact that contact measures aren't corrected before output or by the fact that I used c_sysfnc to output the VAR/1 value perhaps?