CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Unable to abort OF when file not found in subroutine (https://www.cfd-online.com/Forums/openfoam-programming-development/244986-unable-abort-when-file-not-found-subroutine.html)

quarkz September 8, 2022 03:43

Unable to abort OF when file not found in subroutine
 
Hi,

I have written a code to deform/rotate my mesh.

I need it to read in the rotation rate from a text file, and abort OF if the file is not found.

I googled and also search the forums. I tried:

1. exit(1);
2 .exit();

elevatorRotation_simpleFB.C:133:9: error: no matching function for call to ‘exit()’
133 | exit();


3. stopAt(Time::saNoWriteNow);

elevatorRotation_simpleFB.C: In member function ‘virtual Foam::septernion Foam::solidBodyMotionFunctions::elevatorRotation_s impleFB::transformation() const’:
elevatorRotation_simpleFB.C:135:4: error: ‘stopAt’ was not declared in this scope
135 | stopAt(Time::saNoWriteNow);
| ^~~~~~

4. abort();

elevatorRotation_simpleFB.C: In member function ‘virtual Foam::septernion Foam::solidBodyMotionFunctions::elevatorRotation_s impleFB::transformation() const’:
elevatorRotation_simpleFB.C:137:10: error: no matching function for call to ‘abort()’
137 | abort();
| ^


but all can't work, giving error msgs as shown above during compilation.

Can someone help? Did I miss out some include files?

Thanks


All times are GMT -4. The time now is 11:28.