Skip to content

C/C++ interface #141

Open
Open

Description

@ianhbell

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?

Activity

  1. g-bauer commented on Mar 15, 2023

    @g-bauer
    Contributor

    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.

  2. ianhbell commented on Mar 15, 2023

    @ianhbell
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions