CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

System("PAUSE") like command for Debugging

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 6, 2014, 06:13
Default System("PAUSE") like command for Debugging
  #1
Member
 
Ashwani
Join Date: Sep 2013
Location: Hyderabad
Posts: 98
Rep Power: 5
AshwaniAssam is on a distinguished road
Hi all,

Can anyone please suggest how while debugging the code in OpenFOAM, we can halt the simulation. I want to print some output, then have the simulation halt and then continue by pressing any key. I am working on my first code in OpenFOAM and also in C++.

Thanks.
AshwaniAssam is offline   Reply With Quote

Old   February 6, 2014, 06:49
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 1,142
Rep Power: 20
akidess will become famous soon enough
Learn how to use GDB. See also http://www.tfd.chalmers.se/~hani/kur...ing.pdf‎
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Join the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oHPxcPqde7HtA2
akidess is offline   Reply With Quote

Old   February 6, 2014, 11:57
Default
  #3
Member
 
Ashwani
Join Date: Sep 2013
Location: Hyderabad
Posts: 98
Rep Power: 5
AshwaniAssam is on a distinguished road
Quote:
Originally Posted by akidess View Post
Thank you for your reply. Actually I was asking for someway to pause the output window, after a desired variable in the code is printed.
As the window refreshes I can't see the output. But definitely, I can use a log file which I thought now.
AshwaniAssam is offline   Reply With Quote

Old   February 6, 2014, 13:07
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 1,142
Rep Power: 20
akidess will become famous soon enough
Use the log file, or interactively with Ctrl+Z (general bash command to send a process to sleep). You can wake it again with the command "fg".
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Join the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oHPxcPqde7HtA2
akidess is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 13:12.