{"id":23792,"date":"2024-05-30T09:08:23","date_gmt":"2024-05-30T07:08:23","guid":{"rendered":"https:\/\/info.gwdg.de\/news\/?p=23792"},"modified":"2024-07-08T16:41:45","modified_gmt":"2024-07-08T14:41:45","slug":"openfoam-debugging","status":"publish","type":"post","link":"https:\/\/info.gwdg.de\/news\/openfoam-debugging\/","title":{"rendered":"OpenFOAM Debugging"},"content":{"rendered":"<p class=\"part\" data-startline=\"3\" data-endline=\"7\">Debugging is often an essential part of software development. In the scope of this tutorial, I will present a couple of tools with OpenFOAM as a practical example of a C++based scientific simulation code. After a brief reminder aboute the installation procedure of the OpenFOAM flavor foam-extend 4.1, the blog article introduces debugging with gdb and the IDEs Visual Studio Code and Qtcreator.<\/p>\n<p class=\"part\" data-startline=\"9\" data-endline=\"10\">The demo problem is based on the pitzDaily tutorial in foam-extend and uses the scalarTransportFoam solver which implements the equation:<br \/>\n<span class=\"mathjax\"><span id=\"MathJax-Element-1-Frame\" class=\"MathJax\" tabindex=\"0\" role=\"presentation\" data-mathml=\"&lt;math xmlns=&quot;http:\/\/www.w3.org\/1998\/Math\/MathML&quot;&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;&amp;#x03B4;&lt;\/mi&gt;&lt;mi&gt;T&lt;\/mi&gt;&lt;\/mrow&gt;&lt;mrow&gt;&lt;mi&gt;&amp;#x03B4;&lt;\/mi&gt;&lt;mi&gt;t&lt;\/mi&gt;&lt;\/mrow&gt;&lt;\/mfrac&gt;&lt;mo&gt;+&lt;\/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;\/mi&gt;&lt;mo&gt;&amp;#x22C5;&lt;\/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;\/mo&gt;&lt;mi&gt;u&lt;\/mi&gt;&lt;mi&gt;T&lt;\/mi&gt;&lt;mo&gt;)&lt;\/mo&gt;&lt;\/mrow&gt;&lt;mo&gt;&amp;#x2212;&lt;\/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;\/mi&gt;&lt;mo&gt;&amp;#x22C5;&lt;\/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;\/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;&amp;#x2207;&lt;\/mi&gt;&lt;msub&gt;&lt;mi&gt;D&lt;\/mi&gt;&lt;mi&gt;T&lt;\/mi&gt;&lt;\/msub&gt;&lt;mi&gt;T&lt;\/mi&gt;&lt;mo&gt;)&lt;\/mo&gt;&lt;\/mrow&gt;&lt;mo&gt;=&lt;\/mo&gt;&lt;mi&gt;S&lt;\/mi&gt;&lt;\/math&gt;\"><span id=\"MathJax-Span-1\" class=\"math\"><span id=\"MathJax-Span-2\" class=\"mrow\"><span id=\"MathJax-Span-3\" class=\"mfrac\"><span id=\"MathJax-Span-4\" class=\"mrow\"><span id=\"MathJax-Span-5\" class=\"mi\">\ud835\udeff<\/span><span id=\"MathJax-Span-6\" class=\"mi\">\ud835\udc47<\/span><\/span><span id=\"MathJax-Span-7\" class=\"mrow\"><span id=\"MathJax-Span-8\" class=\"mi\">\ud835\udeff<\/span><span id=\"MathJax-Span-9\" class=\"mi\">\ud835\udc61<\/span><\/span><\/span><span id=\"MathJax-Span-10\" class=\"mo\">+<\/span><span id=\"MathJax-Span-11\" class=\"mi\">\u2207<\/span><span id=\"MathJax-Span-12\" class=\"mo\">\u22c5<\/span><span id=\"MathJax-Span-13\" class=\"mrow\"><span id=\"MathJax-Span-14\" class=\"mo\">(<\/span><span id=\"MathJax-Span-15\" class=\"mi\">\ud835\udc62<\/span><span id=\"MathJax-Span-16\" class=\"mi\">\ud835\udc47<\/span><span id=\"MathJax-Span-17\" class=\"mo\">)<\/span><\/span><span id=\"MathJax-Span-18\" class=\"mo\">\u2212<\/span><span id=\"MathJax-Span-19\" class=\"mi\">\u2207<\/span><span id=\"MathJax-Span-20\" class=\"mo\">\u22c5<\/span><span id=\"MathJax-Span-21\" class=\"mrow\"><span id=\"MathJax-Span-22\" class=\"mo\">(<\/span><span id=\"MathJax-Span-23\" class=\"mi\">\u2207<\/span><span id=\"MathJax-Span-24\" class=\"msubsup\"><span id=\"MathJax-Span-25\" class=\"mi\">\ud835\udc37<\/span><span id=\"MathJax-Span-26\" class=\"mi\">\ud835\udc47<\/span><\/span><span id=\"MathJax-Span-27\" class=\"mi\">\ud835\udc47<\/span><span id=\"MathJax-Span-28\" class=\"mo\">)<\/span><\/span><span id=\"MathJax-Span-29\" class=\"mo\">=<\/span><span id=\"MathJax-Span-30\" class=\"mi\">\ud835\udc46<\/span><\/span><\/span><\/span><\/span><\/p>\n<p class=\"part\" data-startline=\"12\" data-endline=\"13\">The geometry of the case is shown in Paraview below:<br \/>\n<a href=\"https:\/\/info.gwdg.de\/news\/wp-content\/uploads\/2024\/05\/OpenFoam.png\" class=\"external\" rel=\"nofollow\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23800\" style=\"width: 100%; height: 100%;\" src=\"https:\/\/info.gwdg.de\/news\/wp-content\/uploads\/2024\/05\/OpenFoam.png\" alt=\"\" width=\"1600\" height=\"733\" \/><\/a><\/p>\n<h2 id=\"Requirements---OpenFOAM-base-installation-Ubuntu-2004-LTS\" class=\"part\" data-startline=\"15\" data-endline=\"15\">Requirements &#8211; OpenFOAM base installation Ubuntu 20.04 LTS<\/h2>\n<p class=\"part\" data-startline=\"16\" data-endline=\"17\">The tutorial assumes that you are running a system with Ubuntu 20.04 LTS installed. It is based on the installation instructions from the <a href=\"https:\/\/openfoamwiki.net\/index.php\/Installation\/Linux\/foam-extend-4.1\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">OpenFOAMwiki<\/a>. The required base packages can be then installed using the following commands:<\/p>\n<pre class=\"part\" data-startline=\"18\" data-endline=\"24\"><code class=\"Bash hljs\">sudo apt-<span class=\"hljs-built_in\">get<\/span> <span class=\"hljs-keyword\">update<\/span> \r\nsudo apt-<span class=\"hljs-built_in\">get<\/span> install git-core build-essential binutils-<span class=\"hljs-built_in\">dev<\/span> cmake \r\n                     flex zlib1g-<span class=\"hljs-built_in\">dev<\/span> libncurses5-<span class=\"hljs-built_in\">dev<\/span> curl bison \\\r\n                     libxt-<span class=\"hljs-built_in\">dev<\/span> rpm mercurial graphviz python \\ \r\n                     python-<span class=\"hljs-built_in\">dev<\/span> gcc<span class=\"hljs-number\">-7<\/span> g++<span class=\"hljs-number\">-7<\/span> paraview gdb\r\n\r\n<\/code><\/pre>\n<p class=\"part\" data-startline=\"25\" data-endline=\"25\">The source code of foam-extend 4.1 is available as a git repository at <a href=\"http:\/\/Sourceforge.net\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">Sourceforge.net<\/a> and can be cloned using the following commands:<\/p>\n<pre class=\"part\" data-startline=\"26\" data-endline=\"30\"><code class=\"Bash hljs\"><span class=\"hljs-built_in\">mkdir<\/span> ~\/foam\r\n<span class=\"hljs-keyword\">cd<\/span> ~\/foam\r\ngit clone http:\/\/git.code.<span class=\"hljs-keyword\">sf<\/span>.net\/<span class=\"hljs-keyword\">p<\/span>\/foam-<span class=\"hljs-built_in\">extend<\/span>\/foam-<span class=\"hljs-built_in\">extend<\/span>-<span class=\"hljs-number\">4.1<\/span> foam-<span class=\"hljs-built_in\">extend<\/span>-<span class=\"hljs-number\">4.1\r\n<\/span>\r\n<\/code><\/pre>\n<p class=\"part\" data-startline=\"32\" data-endline=\"32\">For a successful building of foam-extend-4.1, we will use here GCC-7. In order to configure foam-extend to use it we need to add the following lines to etc\/prefs.sh in the OpenFOAM folder:<\/p>\n<pre class=\"part\" data-startline=\"33\" data-endline=\"36\"><code class=\"Bash hljs\"><span class=\"hljs-builtin-name\">export<\/span> <span class=\"hljs-attribute\">WM_CC<\/span>=<span class=\"hljs-string\">'gcc-7'<\/span>\r\n<span class=\"hljs-builtin-name\">export<\/span> <span class=\"hljs-attribute\">WM_CXX<\/span>=<span class=\"hljs-string\">'g++-7'\r\n\r\n<\/span>\r\n<\/code><\/pre>\n<p class=\"part\" data-startline=\"37\" data-endline=\"37\">We apply the changes by sourcing the OpenFOAM bashrc file by executing the following line in the terminal:<\/p>\n<pre class=\"part\" data-startline=\"38\" data-endline=\"40\"><code class=\"Bash hljs\"><span class=\"hljs-built_in\">source<\/span> etc\/bashrc\r\n<\/code><\/pre>\n<pre class=\"part\" data-startline=\"42\" data-endline=\"48\"><code>sed -i -e 's=rpmbuild --define=rpmbuild --define \\\r\n            \"_build_id_links none\" --define=' \\\r\n            ThirdParty\/tools\/makeThirdPartyFunctionsForRPM\r\nsed -i -e 's\/gcc\/\\$(WM_CC)\/' wmake\/rules\/linux64Gcc\/c\r\nsed -i -e 's\/g++\/\\$(WM_CXX)\/' wmake\/rules\/linux64Gcc\/c++\r\n\r\n<\/code><\/pre>\n<p class=\"part\" data-startline=\"50\" data-endline=\"56\">In order to use both the productive and debug versions easily, it is convienient to define correseponding aliases. In order to do so the two lines should be added to the .bashrc file in the home directory. This can be either done by copying and pasting the following two lines to the terminal window or by manually adding the text between the quotation marks with your favorite text editor.<\/p>\n<pre class=\"part\" data-startline=\"57\" data-endline=\"63\"><code class=\"Bash hljs\"><span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"alias fe41='source \\ \r\n            \\$HOME\/foam\/foam-extend-4.1\/etc\/bashrc'\"<\/span> &gt;&gt; ~\/.bashrc\r\n<span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"alias fe41_debug='source \\\r\n            \\$HOME\/foam\/foam-extend-4.1\/etc\/bashrc \\\r\n            WM_COMPILE_OPTION=Debug'\"<\/span> &gt;&gt; ~\/.bashrc\r\n\r\n<\/code><\/pre>\n<p class=\"part\" data-startline=\"65\" data-endline=\"66\">With this setup it is possible to compile both the optimized and the debug version using the following commands:<\/p>\n<pre class=\"part\" data-startline=\"67\" data-endline=\"72\"><code class=\"Bash hljs\">cd ~<span class=\"hljs-regexp\">\/foam\/<\/span>foam-extend-<span class=\"hljs-number\">4.1<\/span>\r\n<span class=\"hljs-keyword\">source<\/span> ~<span class=\"hljs-regexp\">\/foam\/<\/span>foam-extend-<span class=\"hljs-number\">4.1<\/span><span class=\"hljs-regexp\">\/etc\/<\/span>bashrc\r\n.\/Allwmake.firstInstall\r\nWM_COMPILE_OPTION=Debug .\/Allwmake\r\n\r\n<\/code><\/pre>\n<p class=\"part\" data-startline=\"74\" data-endline=\"75\">The discussed IDEs QtCreator and Visual Studio Code are installed using<br \/>\nthe package management system using:<\/p>\n<pre class=\"part\" data-startline=\"76\" data-endline=\"79\"><code class=\"Bash hljs\">sudo apt-<span class=\"hljs-keyword\">get<\/span> install qtcreator\r\nsnap install code <span class=\"hljs-comment\">--classic\r\n<\/span>\r\n<\/code><\/pre>\n<p class=\"part\" data-startline=\"81\" data-endline=\"81\">The code needed for this tutorial can be found <a href=\"https:\/\/docs.gwdg.de\/lib\/exe\/fetch.php?media=en:services:application_services:high_performance_computing:coffee:code_openfoam_debugging.gz\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">here<\/a>.<\/p>\n<h3 id=\"Debugging-Tools\" class=\"part\" data-startline=\"82\" data-endline=\"82\">Debugging Tools<\/h3>\n<p class=\"part\" data-startline=\"86\" data-endline=\"86\">Basic debugging can be accomplished by sending text messages to the terminal through the addition of \u201cInfo\u201d sections. This approach helps in understanding the execution flow of the code and pinpointing where it stops working.<\/p>\n<pre class=\"part\" data-startline=\"88\" data-endline=\"96\"><code class=\"{.c++ hljs\">Info&lt;&lt; <span class=\"hljs-string\">\"\\nStarting time loop\\n\"<\/span> &lt;&lt; endl;\r\n\r\n<span class=\"hljs-keyword\">while<\/span> (runTime.<span class=\"hljs-built_in\">loop<\/span>())\r\n{\r\n    Info&lt;&lt; <span class=\"hljs-string\">\"Time = \"<\/span> &lt;&lt; runTime.<span class=\"hljs-built_in\">timeName<\/span>() &lt;&lt; nl &lt;&lt; endl;\r\n      ...\r\n}\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>However, there are some downsides to this method. It offers no control over the code during execution, requires modifying and recompiling the code, and necessitates cleaning up the code after successful debugging.<\/p>\n<h3 id=\"Understanding-Debug-Switches-in-OpenFOAM\" class=\"part\" data-startline=\"100\" data-endline=\"100\">Understanding Debug Switches in OpenFOAM<\/h3>\n<p class=\"part\" data-startline=\"102\" data-endline=\"102\">In OpenFOAM, debug switches offer a flexible way to manage debugging information without the need for recompilation, unlike traditional \u201cInfo\u201d statements. These switches can be turned on and off and are defined in the <code>controlDict<\/code> for a specific case, allowing users to set different debug levels to control the verbosity of the output.<\/p>\n<h4 id=\"Key-Features-of-Debug-Switches\" class=\"part\" data-startline=\"104\" data-endline=\"104\">Key Features of Debug Switches<\/h4>\n<ul class=\"part\" data-startline=\"106\" data-endline=\"115\">\n<li class=\"\" data-startline=\"106\" data-endline=\"109\"><strong>Debug Levels<\/strong>:<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>0: No debug information.<\/li>\n<li>Levels 1, 2, 3, etc.: Increasing levels of verbosity.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul class=\"part\" data-startline=\"106\" data-endline=\"115\">\n<li style=\"list-style-type: none;\"><\/li>\n<li class=\"\" data-startline=\"110\" data-endline=\"112\"><strong>No Recompilation Required<\/strong>:<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Unlike \u201cInfo\u201d statements, which require modifying and recompiling the code, debug switches are built-in and can be activated or deactivated without recompilation.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul class=\"part\" data-startline=\"106\" data-endline=\"115\">\n<li class=\"\" data-startline=\"113\" data-endline=\"115\"><strong>Class-Specific Statements<\/strong>:<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Debug statements are defined for most classes within OpenFOAM, providing targeted and relevant debugging information.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4 id=\"Using-Debug-Switches\" class=\"part\" data-startline=\"116\" data-endline=\"116\">Using Debug Switches<\/h4>\n<p class=\"part\" data-startline=\"118\" data-endline=\"118\">To view and manage active debug switches, OpenFOAM offers specific commands:<\/p>\n<ul class=\"part\" data-startline=\"120\" data-endline=\"127\">\n<li class=\"\" data-startline=\"120\" data-endline=\"123\"><strong>Listing Registered Switches<\/strong>:<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>For OpenFOAM Foundation and ESI versions: <code>pisoFoam -listRegisteredSwitches<\/code><\/li>\n<li>For foam-extend versions: <code>pisoFoam -dumpControlSwitches<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul class=\"part\" data-startline=\"120\" data-endline=\"127\">\n<li class=\"\" data-startline=\"124\" data-endline=\"127\"><strong>Activating Debug Switches<\/strong>:<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>For OpenFOAM Foundation and ESI versions: <code>pisoFoam -debug-switch &lt;name=val&gt;<\/code><\/li>\n<li>For foam-extend versions: <code>pisoFoam -DebugSwitches &lt;key1=val1,key2=val2,...&gt;<\/code>\n<ul>\n<li style=\"list-style-type: none;\"><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"part\" data-startline=\"128\" data-endline=\"128\">These commands allow users to dynamically list and activate debug switches, providing an efficient way to control and monitor the execution flow and behavior of solvers within OpenFOAM.<\/p>\n<h3 id=\"Using-GDB-for-Debugging-in-OpenFOAM\" class=\"part\" data-startline=\"131\" data-endline=\"131\">Using GDB for Debugging in OpenFOAM<\/h3>\n<p class=\"part\" data-startline=\"133\" data-endline=\"133\">The GNU Debugger (gdb) is a powerful tool for studying the run-time behavior of your code, examining variables, and making changes to the program while it is running. This capability makes gdb an invaluable tool for in-depth debugging and analysis. However, there are some trade-offs to consider.<\/p>\n<h4 id=\"Key-Features-of-gdb\" class=\"part\" data-startline=\"135\" data-endline=\"135\">Key Features of gdb<\/h4>\n<ol>\n<li><strong>Run-Time Behavior Analysis<\/strong>:<br \/>\ngdb allows you to closely study how your code behaves during execution, providing insights that are difficult to obtain through static analysis.<\/li>\n<li><strong>Examining Variables<\/strong>:<br \/>\nYou can inspect the values of variables at various points during execution, helping to identify bugs and understand program flow.<\/li>\n<li><strong>Modifying Programs at Run-Time<\/strong>:<br \/>\ngdb enables you to make changes to your program while it is running, offering a dynamic way to test fixes and alterations.<\/li>\n<\/ol>\n<h4 id=\"Downsides-of-Using-gdb\" class=\"part\" data-startline=\"146\" data-endline=\"146\">Downsides of Using gdb<\/h4>\n<ul class=\"part\" data-startline=\"148\" data-endline=\"153\">\n<li class=\"\" data-startline=\"148\" data-endline=\"150\"><strong>Increased Disk Space Usage<\/strong>:<br \/>\nThe debug information required by gdb can significantly increase the size of your binaries, consuming more disk space.<\/li>\n<li class=\"\" data-startline=\"151\" data-endline=\"153\"><strong>Slower Execution Time<\/strong>:<br \/>\nPrograms run more slowly under gdb due to the additional overhead of debugging information and checks.<\/li>\n<\/ul>\n<h4 id=\"Setting-Up-gdb-for-OpenFOAM\" class=\"part\" data-startline=\"154\" data-endline=\"154\">Setting Up gdb for OpenFOAM<\/h4>\n<p class=\"part\" data-startline=\"156\" data-endline=\"156\">To use gdb with your own solver or library in OpenFOAM, you need to modify the <code>Make\/options<\/code> file to include the necessary debugging flags:<\/p>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\">EXE_INC = -O0 -fdefault-inline -ggdb -DFULLDEBUG<\/code><code class=\"bash hljs\"><\/code><\/pre>\n<p data-startline=\"165\" data-endline=\"165\">This configuration ensures that your code is compiled with debugging information, disabling optimizations (-O0) to make the debugging process more straightforward and effective. By using these settings, you can leverage gdb to gain a deeper understanding of your code\u2019s execution and address any issues more effectively.<\/p>\n<h3 id=\"Visual-Studio-Code-for-OpenFOAM-Development\" class=\"part\" data-startline=\"165\" data-endline=\"165\">Visual Studio Code for OpenFOAM Development<\/h3>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<p class=\"part\" data-startline=\"167\" data-endline=\"167\">Visual Studio Code (VS Code) is a multi-platform Integrated Development Environment (IDE) available for Windows, macOS, and Linux. It is also well-suited for OpenFOAM development due to its extensive features and support for various programming languages.<\/p>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<h4 id=\"Key-Features-of-Visual-Studio-Code\" class=\"part\" data-startline=\"169\" data-endline=\"169\">Key Features of Visual Studio Code<\/h4>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<ol>\n<li><strong>Multi-Platform Support<\/strong>:<br \/>\nVS Code runs on Windows, macOS, and Linux, making it a flexible choice for developers working in different environments.<\/li>\n<li><strong>Open Source Variant<\/strong>:<br \/>\nVSCodium is an open-source version of VS Code that comes without telemetry, offering a more privacy-focused option. However, not all extensions of VSCode work with VSCodium.<\/li>\n<li><strong>Supported Languages<\/strong>:<br \/>\nVS Code supports a wide range of programming languages, including C, C#, C++, JavaScript, Julia, Perl, and Rust, among others. This makes it a comprehensive tool for diverse development needs.<\/li>\n<li><strong>Syntax Highlighting and Auto-Completion<\/strong>:<br \/>\nThese features enhance coding efficiency and accuracy by providing visual cues and code suggestions.<\/li>\n<li><strong>Revision Management<\/strong>:<br \/>\nIntegrated version control supports Git and other source control systems, facilitating efficient code management and collaboration.<\/li>\n<li><strong>Graphical Debugging<\/strong>:<br \/>\nVS Code offers powerful debugging capabilities with a graphical interface, making it easier to set breakpoints, inspect variables, and control code execution flow.<\/li>\n<\/ol>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<h3 id=\"Qt-Creator-for-OpenFOAM-Development\" class=\"part\" data-startline=\"191\" data-endline=\"191\">Qt Creator for OpenFOAM Development<\/h3>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<p class=\"part\" data-startline=\"193\" data-endline=\"193\">Qt Creator is a cross-platform C++, JavaScript, Python and QML integrated development environment which simplifies GUI application development.<\/p>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<h4 id=\"Key-Features-of-Qt-Creator\" class=\"part\" data-startline=\"195\" data-endline=\"195\">Key Features of Qt Creator<\/h4>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<ol>\n<li><strong>Multi-Platform Support<\/strong>:<br \/>\nQt Creator runs on Windows, macOS, and Linux, providing flexibility for developers working across different operating systems.<\/li>\n<li><strong>Integration with Qt Framework<\/strong>:<br \/>\nQt Creator is based on and integrated with the Qt framework, offering a robust environment for developing applications with rich user interfaces.<\/li>\n<li><strong>Supported Languages<\/strong>:<br \/>\nQt Creator supports a variety of programming languages, including C++, Java, Markdown, JavaScript, Python, and QML. This wide range of language support makes it suitable for diverse development tasks.<\/li>\n<li><strong>Syntax Highlighting and Auto-Completion<\/strong>:<br \/>\nThese features help improve coding efficiency and reduce errors by providing visual cues and code suggestions as you type.<\/li>\n<li><strong>Revision Management<\/strong>:<br \/>\nIntegrated version control supports Git and other source control systems, allowing for efficient code management and collaboration.<\/li>\n<li><strong>Graphical Debugging<\/strong>:<br \/>\nQt Creator includes powerful graphical debugging tools, enabling developers to set breakpoints, inspect variables, and control the execution flow of their applications visually.<\/li>\n<\/ol>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<p class=\"part\" data-startline=\"215\" data-endline=\"215\">By utilizing the comprehensive features of Qt Creator, developers can enhance their productivity and streamline the development and debugging process in OpenFOAM projects.<\/p>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<h2 data-startline=\"414\" data-endline=\"414\">Author<\/h2>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<p><a href=\"mailto: patrick.hoehn@uni-goettingen.de\">Patrick H\u00f6hn<\/a><\/p>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<h2 id=\"References\" class=\"part\" data-startline=\"414\" data-endline=\"414\">References<\/h2>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<ul>\n<li>Training Session &#8222;OpenFOAM Code Debugging and Profiling&#8220; 18th OpenFOAM Workshop<\/li>\n<li><a href=\"https:\/\/www.tfd.chalmers.se\/~hani\/kurser\/OS_CFD_2022\/lectureNotes\/24_debugging.pdf\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">https:\/\/www.tfd.chalmers.se\/~hani\/kurser\/OS_CFD_2022\/lectureNotes\/24_debugging.pdf<\/a><\/li>\n<li><a href=\"https:\/\/openfoamwiki.net\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">https:\/\/openfoamwiki.net<\/a><\/li>\n<li><a href=\"https:\/\/cs.brown.edu\/courses\/cs033\/docs\/guides\/gdb.pdf\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">https:\/\/cs.brown.edu\/courses\/cs033\/docs\/guides\/gdb.pdf<\/a><\/li>\n<li>R. Stallman, R. Pesch, and S. Shebs. Debugging with GDB: The GNU Source-Level debugger. GNU Press, Free Software Foundation Inc., 9th edition, 2002.<\/li>\n<li><a href=\"https:\/\/wikis.ovgu.de\/lss\/doku.php?id=guide:qtcreater_for_openfoam\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">https:\/\/wikis.ovgu.de\/lss\/doku.php?id=guide:qtcreater_for_openfoam<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Rvadrabade\/Debugging-OpenFOAM-with-Visual-Studio-Code\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">https:\/\/github.com\/Rvadrabade\/Debugging-OpenFOAM-with-Visual-Studio-Code<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/FoamScience\/foamUT\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">https:\/\/github.com\/FoamScience\/foamUT<\/a><\/li>\n<li><a href=\"https:\/\/users.ece.utexas.edu\/~adnan\/gdb-refcard.pdf\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">https:\/\/users.ece.utexas.edu\/~adnan\/gdb-refcard.pdf<\/a><\/li>\n<li><a href=\"https:\/\/info.gwdg.de\/news\/en\/configuring-vscode-to-access-gwdgs-hpc-cluster\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">https:\/\/info.gwdg.de\/news\/en\/configuring-vscode-to-access-gwdgs-hpc-cluster<\/a><\/li>\n<\/ul>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n<p><strong>A more permanent version to this article with updates and fixes can be found at <\/strong><strong><a title=\"https:\/\/gitlab-ce.gwdg.de\/hpc-team-public\/science-domains-blog\" href=\"https:\/\/gitlab-ce.gwdg.de\/hpc-team-public\/science-domains-blog\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"external\">https:\/\/gitlab-ce.gwdg.de\/hpc-team-public\/science-domains-blog<\/a><\/strong><\/p>\n<pre class=\"part\" data-startline=\"158\" data-endline=\"160\"><code class=\"bash hljs\"><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Debugging is often an essential part of software development. In the scope of this tutorial, I will present a couple of tools with OpenFOAM as a practical example of a C++based scientific simulation code. After a brief reminder aboute the installation procedure of the OpenFOAM flavor foam-extend 4.1, the blog article introduces debugging with gdb &#8230; <a title=\"OpenFOAM Debugging\" class=\"read-more\" href=\"https:\/\/info.gwdg.de\/news\/openfoam-debugging\/\" aria-label=\"Mehr Informationen \u00fcber OpenFOAM Debugging\">Weiterlesen<\/a><\/p>\n","protected":false},"author":166,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129],"tags":[],"class_list":["post-23792","post","type-post","status-publish","format-standard","hentry","category-wissenschaftliche-domaenen"],"_links":{"self":[{"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/posts\/23792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/users\/166"}],"replies":[{"embeddable":true,"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/comments?post=23792"}],"version-history":[{"count":48,"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/posts\/23792\/revisions"}],"predecessor-version":[{"id":23948,"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/posts\/23792\/revisions\/23948"}],"wp:attachment":[{"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/media?parent=23792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/categories?post=23792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/info.gwdg.de\/news\/wp-json\/wp\/v2\/tags?post=23792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}