MCPcopy Index your code
hub / github.com/cselab/odil

github.com/cselab/odil @v0.1.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.8 ↗ · + Follow
316 symbols 979 edges 32 files 68 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ODIL

ODIL (Optimizing a Discrete Loss) is a Python framework for solving inverse and data assimilation problems for partial differential equations. ODIL formulates the problem through optimization of a loss function including the residuals of a finite-difference and finite-volume discretization along with data and regularization terms. ODIL solves the same problems as the popular PINN (Physics-Informed Neural Networks) framework.

Key features: * automatic differentiation using TensorFlow or JAX * optimization by gradient-based methods (Adam, L-BFGS) and Newton's method * orders of magnitude lower computational cost than PINN [1] * multigrid decomposition for faster optimization [2]

Interactive demos

These demos use a C++ implementation of ODIL with autodiff and Emscripten to run interactively in the web browser.

Poisson Wave Heat Advection Advection2

Installation

pip install odil

or

pip install git+https://github.com/cselab/odil.git

Using GPU

To enable GPU support, provide a non-empty list of devices in CUDA_VISIBLE_DEVICES. Values CUDA_VISIBLE_DEVICES= and CUDA_VISIBLE_DEVICES=-1 disable GPU support.

Developers

ODIL is developed by researchers at Harvard University

advised by

Publications

  1. Karnakov P, Litvinov S, Koumoutsakos P. Solving inverse problems in physics by optimizing a discrete loss: Fast and accurate learning without neural networks. PNAS Nexus, 2024. DOI:10.1093/pnasnexus/pgae005

  2. Karnakov P, Litvinov S, Koumoutsakos P. Flow reconstruction by multiresolution optimization of a discrete loss with automatic differentiation. Eur. Phys. J, 2023. DOI:10.1140/epje/s10189-023-00313-7 arXiv:2303.04679 slides

Core symbols most depended-on inside this repo

field
called by 49
src/odil/core.py
points
called by 37
src/odil/core.py
printlog
called by 29
src/odil/util.py
append
called by 25
src/odil/util.py
cast
called by 21
src/odil/core.py
get
called by 19
src/odil/history.py
size
called by 18
src/odil/core.py
write
called by 16
src/odil/io.py

Shape

Function 150
Method 139
Class 27

Languages

Python100%

Modules by API surface

src/odil/core.py99 symbols
src/odil/optimizer.py38 symbols
examples/heat/heat.py23 symbols
src/odil/util.py21 symbols
src/odil/backend.py20 symbols
examples/poisson/poisson.py15 symbols
examples/velocity_from_tracer/veltracer.py12 symbols
src/odil/history.py11 symbols
examples/infer_constant/infer_constant.py10 symbols
src/odil/io.py9 symbols
src/odil/core_min.py7 symbols
tests/test_newton.py6 symbols

For agents

$ claude mcp add odil \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact