Plugin creation for pointwise
Hi
I am currently trying to create a plugin for a solver in poitwise . but i am having trouble writing runtimeWrite.c file in order for it to write the grid file in the format i want (netcdf) . Has anybody got any experience in this area and give me guidence or if you have a sample file to write grid in a different file format . Your help will be appreciated . Thanks |
In case you were not aware, in the plugin SDK there are two example plugins - unstructured and structured. I've only written unstructured plugins and I used the unstructured example as a good starting point. There is another document that gives a good overview the SDK here http://www.pointwise.com/plugins/CAEPluginSDK-101.pdf but it looks like the link is broken right now.
Some one from Pointwise - hopefully a dev - will have to give you more details. Quote:
|
Here to help
New One,
First of all, did you download the .zip version of the SDK? If so, I am sorry to say it is BAD! It has the incorrect contents. If you download the .tar.gz version of the SDK, it is correct. Please use the .tar.gz distro. Correction: The SDK download links are now fixed! I would be more than happy to help. However, I would need more details on the difficulties you are experiencing. On which platform are you building: win32, win64, macOSX, linux32, linux64? I assume you have already followed the steps outlined in the Building a CAE Plugin section and verified your SDK installation? As Chris suggested, a good place to start is with the example XML plugins included with the SDK. They are located in the folders:
Correction: The link to CAEPluginSDK-101.pdf is now fixed! Understanding the Grid Model used in the CAE Plugin SDK is very important. See the SDK docs Modules page, the CAEPluginSDK-101.pdf file and my posts at the Pointwise blog for details. enough for now. |
Thanks guys for the help .This document is quite helpful and would have saved me alot of time if i had found it before been using the website and user manual till now and i am not a programmer by trade so getting use to handles and other stuff.But till now i have made changes in the header files and am able to write some of my grid data in ASCII file but my problem is writng it in netcdf format . and yeah i am using Linux64 platform. Your suggestions are welcome and will have to ask you guys for help if i run into further road blocks.
Thanks |
Glad to hear that the ASCII version of your plugin is functional.
You said you are building for linux_x86_64. I will focus my comments below to building on this platform. However, this can be extrapolated to the other platforms if you have the appropriate netcdf link libs. You said you were not a programmer by trade. However, I will assume you have some experience with make files and the "advanced" topic of linking in third party libraries like netcdf. In the text below, I use the following conventions/assumptions:
You will also need the appropriate netcdf header files. Your plugin will need to include these files. To make building your plugin on multiple platforms simpler, I suggest you create a platform specific folder structure within your SDK installation. Copy the linux_x86_64 libnetcdf.a and/or libnetcdf .so files to this folder: Code:
$ cd …/PluginSDK Code:
$ cd …/PluginSDK Code:
$ cd …/PluginSDK/src/plugins/CaeXxxPlugin Code:
CaeXxxPlugin_INCL_PRIVATE := \ Code:
CaeXxxPlugin_LIBS_PRIVATE := \ You can verify the changes using this make command: Code:
$ make print.machine Code:
machine=linux_x86_64 I will not be able to help you (much) with regard to using the netcdf API. Please refer to their documentation. If you have more specific questions about the SDK or grid model, don't hesitate to ask. |
Hey,
I didn't look in the forums a few days, so I missed this thread... Maybe you recognized my post a few weeks ago, where I asked how to write binary. Well, I was also working on a plugin creating netCDF output as input for the TAU solver. I also tried to use the netCDF libraries but failed to include them and also was not sure how to make them work properly together with Pointwise regarding things like output file creation/handling. As I found the classic netCDF format not too difficult I used standard c functions to write the binary file. It works quite fine now, although it is surely not the nicest way to create the output file.... Have you managed to use the netCDF libraries? |
adkay and the new one,
As you both have discovered, working with 3rd party libraries in a multi-platform environment can be frustrating/difficult task. Writing the binary files directly (as adkay did) can be simpler sometimes. However, if the file format changes in the future, your plugin may need significant rework! Third party APIs like netcdf will "hide" these changes internally and make updates as simple as downloading/building new netcdf libs and then recompiling and linking the plugin. |
Hey guys,
think should look at this post more .have not got far as was busy with other stuff. dgarlisch thanks for the help . adkay looks like you already did what i am supposed to do as i am also trying to make a pointwise plugin for the same solver as you . what we have now decided is to link the solver libraries and header files to the poitnwise plugin (havent accomplished that yet) and use the same functions defined in the solver to write the grid in netcdf format by copying grid data to from plugin data structures to solver data structures.what are your suggestions about going about that way as you probably know both the solver and plugin structures and have experience with both . Or would just save me alot of time to try and write binary files the way you did as it seems to be working for you. thanks |
isn't tau using the netCDF libraries for file handling?
I'm also not very deep into that topic. Started working on my thesis only a few weeks ago and had never before to do something with tau or pointwise ;) I think if your approach to create the plugin is serious you should try to use the official libraries for the reasons dgarlisch mentioned. When using standard c I had to come around with some workarounds for the big/little endian issue. And there are still some limitations so our plugin is not able to output "2D" grids (not coded). Also I think the performance is not very good, compared to the official cgns plugin. As the main topic of my thesis is not the plugin, I'm quite fine with that ;) If you can live with that I can give you some code extracts to give you an idea if you want... |
Yes it uses netCDF for file hadling but there are alreay functions written in the solver to write the grid in that format our approach is to utilize those function .As is said i am not that far into it .
And it would be really nice of you if you could give me some code extracts maybe it will help me understand the grid structure better and make my job easier and as i said i am not a programmer still getting use to it so might learn some new things from it . |
The information in Post #3 on May 29, 2013, 11:47 is a good place to start. Especially the blog post links. They cover in painful detail how the Pointwise plugin grid model is structured.
Then, looking at the sample XML plugins included in the SDK show how to use the grid model API to access the data. |
First I made some definitions for the binary output:
Here you can find how the netCDF format has to look like: http://www.unidata.ucar.edu/software...rmat_spec.html Code:
//++++++++++++++Definitionen fuer Binaerausgabe++++++++++++++++++ For example using something like this: Code:
static int As you have to write the marker info in the header of the file you also need a function to do that, for example something like that: Code:
const void Code:
writeHeader(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL model) Code:
void fwrite_BEint64(int64_t uui, int size, int count, FILE * stream){ Difference here is, that you have to check when you have to put a ";" instead of a "," when you write ASCII. Not so for binary of course.... Example for a function that writes the nodes per Tet element: Code:
static void All these functions are called (if necessary) from the runtimeWrite function or subfunctions. Code:
..... |
I know this is an old post.
However, for anyone who stumbles across this looking for Plugin and TAU information, the full code for the TAU plugin shipped with Pointwise is available on github (and plugins too!). https://github.com/pointwise/CaeUnsTAU |
The full code for the TAU plugin shipped with Pointwise is available on github (and plugins too!).
https://github.com/pointwise/CaeUnsTAU |
All times are GMT -4. The time now is 11:48. |