DEFINE_ADJUST & Domain...
Hi!
I am doing an instationnary simulation and I have several iterations per time step. There are some variables that I would like to reset at each time step but also at each iteration. I am of course working with a UDF. To reset after a time step, I am using the DEFINE_EXECUTE_AT_END fuction, and it's working well. But I do not succeed to reset my variables at each iteration. To do so, I am trying to use the DEFINE_ADJUST function, but it need some domain, and I don't know what to do. First : why does it need a domain? The function that reset after each time step doesn't need one... Anyway, I don't know which domain I should put in. I am working on someone else code, how could I get the domain, I don't see it? All I know is that the variables that I want to reset are in a Define_Source which is working on a (c,thread). I thought my domain would be 'thread', but... When I put 'thread' or 'domain', I have no errors, but it's not working. Thank you! |
Re: DEFINE_ADJUST & Domain...
The domain pointer is automatically passed to the DEFINE_ADJUST macro from the solver
|
Re: DEFINE_ADJUST & Domain...
You mean that it should be done automatically?
What should I type, then? DEFINE_ADJUST(name,domain) ? I tried, it didn't work... |
Re: DEFINE_ADJUST & Domain...
paste your DEFINE_ADJUST code here so we can see if there are any mistakes
|
Re: DEFINE_ADJUST & Domain...
Ok, thanks.
I just type this: DEFINE_ADJUST(name,domain) { x=0; } There is no error at compilation, but the variable x is not reset to zero. What's wrong? |
Re: DEFINE_ADJUST & Domain...
how are you checking the value of x? The define source macro is also called every iteration (but after define adjust), if the value of the variable isn't checked before it is reset than that could be the cause
|
Re: DEFINE_ADJUST & Domain...
I am sure the DEFINE_ADJUST isn't done because I put some printf command in it, but this printing is never done.
|
Re: DEFINE_ADJUST & Domain...
Are you sure that you have hooked your Adjust-Function:
Define/User-Defined/Function-Hooks? Max |
Re: DEFINE_ADJUST & Domain...
I was thinking the same thing...
|
Re: DEFINE_ADJUST & Domain...
Yes, I hooked it. I had forgotten, but now it is done, and still not working :(
|
All times are GMT -4. The time now is 06:52. |