Skip to content

Fix Python compatible StateHD<D>s and respective dual numbers #92

@g-bauer

Description

@g-bauer

For the python equation of state, users can define their own helmholtz_energy function that takes a StateHD object as input. In the function, properties of the state can be accessed, e.g. one can write state.moles.
To make this work, there has to be a non-generic state object for each (hyper) dual number.

Currently, missing dual numbers are simply defined in feos-core. Using these definitions, for each a non-generic StateHD version is built.
There are currently two issues:

  1. simply defining the dual numbers is not enough - we need arithmetic operations, etc. from num-dual (which currently does not export all variants we need to Python)
  2. we do not call impl_state_hd! (which implement the getters) for all states that are built. Hence, there will be errors in Python when one tries to call the getters.

To fix this, we

  1. have to properly export all dual numbers that are needed from num-dual. (Check class names in macros!)
  2. properly build all state definitions
  3. build state definition and implementation for HelmholtzEnergyDual in single macro?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcorerelated to features in feos-core

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions