Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C/C++ interface #141

Open
ianhbell opened this issue Mar 15, 2023 · 2 comments
Open

C/C++ interface #141

ianhbell opened this issue Mar 15, 2023 · 2 comments

Comments

@ianhbell
Copy link

I would like to experiment with the very exciting uv-theory stuff in my code, and I can call that from Python, but to integrate with the tools I am developing, I need a C/C++ interface. Is it possible to develop such an interface easily with rust?

@g-bauer
Copy link
Contributor

g-bauer commented Mar 15, 2023

Technically, it is possible. Practically it would involve a lot of work. There are tools to generate C/C++ header files from the Rust library (cbindgen) but - similar to the Python interface - we would need to define wrapper functions with C compatible data types.

The amount of work needed depends on what functionalities of the library you need. I can create an example repository that showcases how such an interface could be built for the specific use case in question.

@ianhbell
Copy link
Author

Yes, this is what I figured/feared. I hoped that the bright, shiny rust might have magical capabilities that have eluded C++ thus far.

What I need is the core derivatives of the residual Helmholtz energy with respect to temperature and density, up to high degrees, most especially to calculate speed of sound. I'm trying to find a model that can give good representations of speed of sound as well as densities and pressure, with accuracies on par with the multiparameter EOS implemented in REFPROP/CoolProp. So far the "old SAFT" models don't meet the brief, but I am hopeful about the newer approaches; SAFT-VR-Mie is the best candidate of the SAFT models so far that are implemented in Clapeyron.jl.

@feos-org feos-org deleted a comment from PeterBesemerIa Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants