ViennaPS icon indicating copy to clipboard operation
ViennaPS copied to clipboard

Custom Model Development in ViennaPS Python Bindings

Open tobre1 opened this issue 1 year ago • 0 comments

Description The ViennaPS Python bindings are currently missing support for certain functionalities critical to custom model development. In particular, the viennaps::ProcessModel class, which encapsulates custom model configurations, is not fully accessible from the Python interface. Implementing this would significantly expand the flexibility of ViennaPS for Python users.

Objective Provide Python binding support for custom implementations of the following classes in the ProcessModel:

  1. Surface Model

    • This class defines the surface processes, a critical aspect of simulation. Customizing this model requires overwriting virtual member functions, some of which use custom member types.
  2. Particles

    • This CRTP class calculates fluxes on surfaces using ray tracing. Overwriting the viennaray::Particle virtual member functions would allow customization of particle properties (e.g., energy, reflections) and flux accumulation logic.
  3. Advection Callback

    • Provides callback functionality during processes, which would allow for customized responses or adjustments at each advection step.
  4. Geometric Model

    • While some wrappers exist, extending this functionality to allow custom models would improve integration with user-defined geometry configurations.
  5. Velocity Field

    • This class extends surface velocities to level set grid points. The default field suffices for many cases, but the ability to create empirical fields independent of surface processes would be valuable.

Current Limitations These classes cannot be fully customized within the Python bindings, limiting ViennaPS's flexibility. However, ViennaLS provides an example of wrapping custom classes (e.g., viennals::VelocityField) for Python, suggesting that similar techniques could be applied to ProcessModel classes here, with the exception of the CRTP Particle class, which may require a unique solution.

TODOS:

  1. Extend the Python bindings to support custom implementations of the above classes in ProcessModel.
  2. Investigate possible workarounds for binding the CRTP Particle class to Python.

tobre1 avatar Oct 30 '24 10:10 tobre1