Skip to content

Conversation

@amgebauer
Copy link
Member

This PR adds to possibility to add python bindings to 4C (similar to unit- or benchmark tests).

Draft for not since we need to figure out how we want to structure the directories. Where should we put the bindings (and the respective tests?)

Maybe something like this (once we have #81):

4C/
├── core/
│   ├── discretization/
│   │   ├── benchmark_tests/
│   │   ├── python/
│   │   |   ├── bindings/
│   │   │   └── tests/
│   │   ├── src
│   │   ├── tests
│   │   └── ...

For our legacy modules, we need a top-level directory for all python bindings (I currently call it pybind11)

@amgebauer amgebauer requested review from Copilot and sebproell August 13, 2025 15:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces Python bindings infrastructure for the 4C multiphysics library using pybind11, starting with the mixture module. The implementation creates a foundation for exposing C++ classes and functionality to Python through automatically generated bindings.

Key changes include:

  • Implementation of a submodule registry system for organizing Python bindings
  • Python bindings for mixture module fiber materials and remodel implementations
  • CMake infrastructure for automatically generating pybind11 modules

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pybind11/setup.py.in Template for Python package setup configuration
pybind11/mixture/CMakeLists.txt CMake configuration for mixture module bindings
pybind11/mixture/4C_mixture.cpp Python bindings implementation for mixture fiber classes
pybind11/config/CMakeLists.txt CMake configuration for pybind11 config library
pybind11/config/4C_config_submodule_registry.hpp Header defining submodule registry system
pybind11/__init__.py.in Template for Python package initialization
pybind11/CMakeLists.txt Main CMake configuration for Python bindings
pybind11/4C_main.cpp Main module definition and submodule initialization
cmake/functions/four_c_auto_define_pybind11_module.cmake CMake function for automatic module definition
CMakeLists.txt Root CMake file with pybind11 subdirectory inclusion

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@amgebauer amgebauer changed the title Allow to implement Python bindings with pybind 11 (start with mixture module) Allow to implement Python bindings with pybind11 (start with mixture module) Aug 13, 2025
Copy link
Member

@sebproell sebproell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks interesting!

@amgebauer amgebauer force-pushed the add-pybind11-bindings-to-mixture branch from 9a681f8 to d75ffa1 Compare August 14, 2025 13:47
@amgebauer amgebauer force-pushed the add-pybind11-bindings-to-mixture branch from d75ffa1 to 1037a79 Compare August 14, 2025 15:40
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

Successfully merging this pull request may close these issues.

2 participants