how to stop the solver from continuing the solution
Hi everyone
I'm doing research on adding state-space trajectory and hopefully use it to speeding up the solution. At some point in the "while (runTime.run())" loop, I need to define a condition and tell the algorithm if the condition is satisfied stops the solution, and read some data. I'm having a hard time finding how should I tell the algorithm to stop the solution. Is there a specific function to do so? or stop a specific parameter to terminate the solution? I'll be grateful if you could guide me. Thanks |
Quote:
Hi, Will this be helpful? https://www.openfoam.com/documentati...e-control.html |
Hi,
Thanks a lot for your reply. That actually helped a lot, Thanks. But what I'm looking for is a way to stop the solution inside the solver. I want to define my condition inside the solver's source code and then I could continue my work from there. I want to write this function object's code inside the solver, so I could stop the solution without crashing the job and I could do other calculations. what I don't know is what parameter or function should I stop or call to do inside the source code? |
Quote:
Code:
bool exitFlag (false); |
Thanks for your reply
Yes, That's actually what I'm looking for. Thank you. but can I use it as : Code:
while ((runTime.run()) && (!exitFlag)) Instead of using the (iterationCounter < maxNumberOfIterations) I use the runTime.run() of the solver? |
Quote:
Just a note, I do not know if you need to do any changes to run this in parallel! |
Thanks for the warning, I don't know about this code I haven't used the bool type variable in my codes.
I added other mathematical functions to OpenFOAM's solvers and it didn't bothered me as long as I wrote them using "foam" namespace. MPI and parallelization wasn't a problem so far for me. |
All times are GMT -4. The time now is 00:14. |