CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Pointwise & Gridgen (http://www.cfd-online.com/Forums/pointwise/)
-   -   Plugin creation - how to export binary? (http://www.cfd-online.com/Forums/pointwise/117275-plugin-creation-how-export-binary.html)

adkay May 6, 2013 03:45

Plugin creation - how to export binary?
 
Hello there,

I'm currently working on a Pointwise export plugin for directly saving the CAE output in a format that is uses by one of the solvers at my university.
Generally it works quite fine, but I would like to add the possibility to save the output file as a binary file, to reduce the file size.
Currently it's ASCII, because the plugin code is based on the Pointwise xml example plugins.

I don't really have a clue how to do that, because I think the fput and fwrite commands used in c++ will never be able to write real binary. Not "binary" that is still coded as ascii....
On the other hand I'm sure that it's possible bacause of some other PW plugins (maybe using fortran-code??).

Anyone an idea on how to do that?

Thanks in advance!

adkay May 7, 2013 16:38

I think I solved the problem... and to my shame I accidentially answered my question in the same sentence in which I asked because of a typo ;)

If maybe someone also wonders how to output binary:
The simple fwrite() function seems to work well for that.
In the pointwise example plugins fprintf and fput are used which (I think) can't write binary...

dgarlisch May 20, 2013 12:58

Quote:

Originally Posted by adkay (Post 425936)
I think I solved the problem... and to my shame I accidentially answered my question in the same sentence in which I asked because of a typo ;)

If maybe someone also wonders how to output binary:
The simple fwrite() function seems to work well for that.
In the pointwise example plugins fprintf and fput are used which (I think) can't write binary...

You are correct. Use fwrite() for binary.

I didn't see your post until just today. Let me know if you have any other issues.


All times are GMT -4. The time now is 00:38.