Skip to content

feelpp/feelpp-scimba

Repository files navigation

feelpp-scimba

Integration of ScimBa and Feel++ to streamline data exchange and combine machine-learning workflows with high-performance finite-element PDE solving.


Table of Contents

  1. Prerequisites
  2. Installation with uv
  3. Using the Docker Image
  4. Quickstart Example
  5. Project Status
  6. Contact

Prerequisites

  • Feel++ installed on your host (e.g. apt install libfeelpp-all-dev on Ubuntu).
  • Python 3.9+ (uv can download and manage Python for you).
  • uv (a drop-in replacement for pip, virtualenv, and more):
    # via pip
    pip install --user uv
    # or via the official install script
    curl -LsSf https://astral.sh/uv/install.sh | sh
  • Git

Installation with uv

  1. Clone the repository

    git clone https://github.com/feelpp/feelpp-scimba.git
    cd feelpp-scimba
  2. Create a virtual environment (with access to system-wide Feel++ packages)

    uv venv --system-site-packages .venv
  3. Activate the environment

    source .venv/bin/activate
  4. Install the Python package and its dependencies

    uv pip install -e .
  5. Install all dependencies including for testing

    uv pip install -e .[test]
  6. Run tests

    pytest

Using the Docker Image

If you prefer containerization, you can build and run our Dockerfile:

# Build
docker build -t feelpp_scimba:latest .

# Run interactively
docker run --rm -it feelpp_scimba:latest

Inside the container you’ll have Feel++, ScimBa, and all Python dependencies ready to go.


Quickstart Example

import sys
import feelpp.core as fppc
import feelpp.toolboxes.core as tb
from feelpp.scimba.Poisson import Poisson

# Initialize Feel++
sys.argv = ["feelpp_app"]
env = feelpp.Environment(
    sys.argv,
    opts=tb.toolboxes_options("coefficient-form-pdes", "cfpdes"),
    config=fppc.localRepository("feelpp_cfpde")
)

# Solve a 2D Poisson problem
P = Poisson(dim=2)
P(
    h=0.05, 
    order=1,
    name="u",
    rhs="8*pi*pi*sin(2*pi*x)*sin(2*pi*y)",
    diff="{1,0,0,1}",
    g="0",
    shape="Rectangle",
    plot=1,
    solver="feelpp",
    u_exact="sin(2*pi*x)*sin(2*pi*y)",
    grad_u_exact="{2*pi*cos(2*pi*x)*sin(2*pi*y),2*pi*sin(2*pi*x)*cos(2*pi*y)}"
)

Project Status

This project is under active development. Contributions and feedback are very welcome!


Contact

About

Feel++ Scimba integration

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages