Difference between revisions of "HowTo Use OpenFOAM with Eclipse"

From OpenFOAMWiki
(Created page with 'Using Eclipse CDT for developing OpenFOAM Please note: This offering is not approved or endorsed by [http://www.opencfd.co.uk OpenCFD®] Limited, the producer of [http://www.…')
 
Line 1: Line 1:
Using Eclipse CDT for developing OpenFOAM
+
'''Using Eclipse CDT for developing OpenFOAM'''
  
 
Please note: This offering is not approved or endorsed by [http://www.opencfd.co.uk OpenCFD®] Limited, the producer of [http://www.openfoam.com OpenFOAM®] software and owner of the [http://www.openfoam.com OpenFOAM®] and [http://www.opencfd.co.uk OpenCFD®] trademarks.
 
Please note: This offering is not approved or endorsed by [http://www.opencfd.co.uk OpenCFD®] Limited, the producer of [http://www.openfoam.com OpenFOAM®] software and owner of the [http://www.openfoam.com OpenFOAM®] and [http://www.opencfd.co.uk OpenCFD®] trademarks.
Line 16: Line 16:
  
 
''"Eclipse is an open source community whose projects are focused on building an extensible development platform, runtimes and application frameworks for building, deploying and managing software across the entire software lifecycle. Many people know us, and hopefully love us, as a Java IDE but Eclipse is much more than a Java IDE."'' - [http://www.eclipse.org www.eclipse.org]
 
''"Eclipse is an open source community whose projects are focused on building an extensible development platform, runtimes and application frameworks for building, deploying and managing software across the entire software lifecycle. Many people know us, and hopefully love us, as a Java IDE but Eclipse is much more than a Java IDE."'' - [http://www.eclipse.org www.eclipse.org]
 +
 +
Eclipse is a powerful integrated development environment IDE originally developed for Java programming. But with the CDT extension Eclipse becomes a very common IDE for C++ programming.
 +
 +
If you want to work on a project in OpenFOAM, it is even not necessary to import the whole OpenFOAM-folder. Only import the project you are working on and the rest of the code will be linked for developing and debugging.
 +
 +
== Aim of the tutorial ==
 +
 +
In this tutorial we will import a standard OpenFOAM solver and set up Eclipse for OpenFOAM. After a short introduction in Eclipse's developing features for applications and libraries, debugging in the Eclipse environment using the GNU Debugger GDB will be presented. Everything will be carried out with simpleFoam on the test case pitzDaily while having a look at the turbulence models as libraries.
 +
 +
== Download and set up Eclipse ==
 +
 +
To start developing OpenFOAM with Eclipse just download the current version for C/C++ from [http://www.eclipse.org/downloads/ www.eclipse.org/downloads/]. This version already contains the C++ extension CDT (C/C++ Development Tools). Unpack the downloaded file and start Eclipse by clicking on the executable or start Eclipse from the terminal after setting the path variable.
 +
 +
For more information on CDT and CDT installation refer to '''Further information'''.
 +
 +
While launching create your own workspace or use the default workspace (for further information refer to '''Limit number of sources'''). Change developing environment to C++ in the menu bar under ''Window -> Show View -> C/C++ Projects''. Create a new C++ project in the menu bar under ''Files -> New -> C++ Project''. A C++ project can be a test case, an application or a library of OpenFOAM. Deactivate ''Use default location'', then select the folder you want to import. Set a name for your project. Click ''Finish''.
 +
 +
[[File:Eclipse01.png|center|350px|Import simpleFoam]]

Revision as of 12:36, 5 May 2010

Using Eclipse CDT for developing OpenFOAM

Please note: This offering is not approved or endorsed by OpenCFD® Limited, the producer of OpenFOAM® software and owner of the OpenFOAM® and OpenCFD® trademarks.

1 Thanks to ..

Patrik Eder for his help with setting up Eclipse and Holger Marschall for proofreading.

2 Versions

Operating system: openSuse 10.2

OpenFOAM version: OpenFOAM-1.6.x

Eclipse version: eclipse 3.5.1 (eclipse Galileo)

3 Eclipse Capabilities

"Eclipse is an open source community whose projects are focused on building an extensible development platform, runtimes and application frameworks for building, deploying and managing software across the entire software lifecycle. Many people know us, and hopefully love us, as a Java IDE but Eclipse is much more than a Java IDE." - www.eclipse.org

Eclipse is a powerful integrated development environment IDE originally developed for Java programming. But with the CDT extension Eclipse becomes a very common IDE for C++ programming.

If you want to work on a project in OpenFOAM, it is even not necessary to import the whole OpenFOAM-folder. Only import the project you are working on and the rest of the code will be linked for developing and debugging.

4 Aim of the tutorial

In this tutorial we will import a standard OpenFOAM solver and set up Eclipse for OpenFOAM. After a short introduction in Eclipse's developing features for applications and libraries, debugging in the Eclipse environment using the GNU Debugger GDB will be presented. Everything will be carried out with simpleFoam on the test case pitzDaily while having a look at the turbulence models as libraries.

5 Download and set up Eclipse

To start developing OpenFOAM with Eclipse just download the current version for C/C++ from www.eclipse.org/downloads/. This version already contains the C++ extension CDT (C/C++ Development Tools). Unpack the downloaded file and start Eclipse by clicking on the executable or start Eclipse from the terminal after setting the path variable.

For more information on CDT and CDT installation refer to Further information.

While launching create your own workspace or use the default workspace (for further information refer to Limit number of sources). Change developing environment to C++ in the menu bar under Window -> Show View -> C/C++ Projects. Create a new C++ project in the menu bar under Files -> New -> C++ Project. A C++ project can be a test case, an application or a library of OpenFOAM. Deactivate Use default location, then select the folder you want to import. Set a name for your project. Click Finish.

Import simpleFoam