These instructions have been updated for Plugin SDK v1.0 R11 for Pointwise 18.1. See previous versions of this README if using older SDK distibutions.
To build the OpenFOAM plugin you must integrate the OpenFOAM source code into your local PluginSDK installation. These instructions assume you have already downloaded, installed, and verified the Pointwise Plugin SDK. Be sure the SDK you are using is compatible with the version of Pointwise you are targeting.
To integrate the OpenFOAM source code, you must first create a plugin project
in your SDK using the steps shown below. You may replace MyOpenFOAM
with any
unique name you choose. Even though the SDK builds with C++ compilers, the
OpenFOAM plugin uses the C-style entry points. Consequently, you must use the
-c
option with mkplugin
below.
If you plan on building the plugin for multiple platforms, I suggest that you place the SDK on a network drive. That way you can build the OpenFOAM plugin using the same SDK installation. You only need to create the plugin project one time. Once a plugin project is created, it can be accessed and built on all platforms supported by Pointwise.
In the sections below, the PluginSDK
folder is shorthand for the full path
to the PluginSDK
folder of your SDK installation. That is, PluginSDK
is shorthand for \some\long\path\to\your\install\of\PluginSDK
.
% cd PluginSDK
% mkplugin -caeu -c MyOpenFOAM
% make CaeUnsMyOpenFOAM-dr
C:> cd PluginSDK
C:> mkplugin -caeu -c MyOpenFOAM
C:> exit
- Choose the File > Open > Project/Solution... menu
- Select the file
PluginSDK\PluginSDK_vs2015.sln
- In the Solution Explorer window
- Right-click on the Plugins folder
- Choose Add > Existing Project... in the popup menu
- Select
PluginSDK\src\plugins\CaeUnsMyOpenFOAM\CaeUnsMyOpenFOAM.vcxproj
- Right-click on the CaeUnsMyOpenFOAM project
- Choose Build in the popup menu
If all goes well above, you should be able to build the CaeUnsMyOpenFOAM plugin without errors or warnings. The plugin does not do anything yet. Building at this point was done to be sure we are ready to integrate the OpenFOAM source code from this repository.
Once the CaeUnsMyOpenFOAM
project is created and builds correctly as
explained above, integrate the source code from this repository into
your project by copying the repository files into the
PluginSDK\src\plugins\CaeUnsMyOpenFOAM
folder. This overwrites the files
generated by mkplugin
.
Edit the file PluginSDK\src\plugins\CaeUnsMyOpenFOAM\rtCaepInitItems.h
.
Change the plugin's name from
"OpenFOAM", /* const char *name */
to
"MyOpenFOAM", /* const char *name */
Save the file.
If using Visual Studio 2015:
- Right-click on the CaeUnsMyOpenFOAM project
- Choose Add Exisiting Item... in the popup menu
- Select
PluginSDK\src\plugins\CaeUnsMyOpenFOAM\vctypes.h
You can now build the CaeUnsMyOpenFOAM
plugin on your platform. If all
builds correctly, you now have a CaeUnsMyOpenFOAM plugin that is functionally
equivalent to the OpenFOAM plugin distributed with Pointwise. You are now ready
to make your changes to the CaeUnsMyOpenFOAM plugin.
See the Building a CAE Plugin for information on configuring your SDK build environment.
If you plan on publicly releasing source or binary builds of your version of the OpenFOAM plugin, you need to be careful about your choice of site id, site group name, plugin id, and plugin name. See documentation for site.h for details. Your plugin may not load correctly into Pointwise if the values you choose conflict with other CAE plugins.
Being open source, we would like to see any enhancements or bug fixes you make to the OpenFOAM plugin integrated back into the main Pointwise build. Please do not hesitate to send us git pull requests for your changes. We will evaluate your changes and integrate them as appropriate.