# thuml/transolver architecture

> Architecture diagram of the GitHub repository thuml/transolver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thuml/transolver
- Repository: https://github.com/thuml/transolver

## Overview

##### Project type and purpose
- This is an open-source research code base (“Transolver”) for solving partial-differential equations (PDEs) on general geometries using a Transformer-based neural operator.
- It provides a core library (the “Transolver” operator), plus three experiment suites:
· Standard benchmark PDE problems
· Car design on ShapeNet
· Airfoil design on AirfRANS

##### File structure
- Top-level items:
· Physics_Attention.py ‑ the core implementation of the Transolver operator
· README.md, LICENSE, requirements.txt, params.yaml
· Three experiment folders:
– PDE-Solving-StandardBenchmark
– Car-Design-ShapeNetCar
– Airfoil-Design-AirfRANS
- Each experiment contains:
· dataset/ (data loaders and preprocessing)
· models/ (experiment-specific model wrappers, including Transolver variants)
· train.py, main.py, main_evaluation.py (training and evaluation entry points)
· scripts/ (shell scripts to launch experiments)
· utils/ (metrics, normalization, naca_generator, etc.)
· fig/ (output plots)
- Shared configuration: params.yaml at root; requirements.txt in each folder

##### README for additional insights
- The README emphasizes:
· Core operator in Physics_Attention.py
· Modular experiments in their own subdirectories
· Use of Python, PyTorch, YAML configs, shell scripts for orchestration
· Outputs: figures, tables, metrics

##### Detail
- That Params.yaml feeds into all train.py and main_evaluation.py
- That scripts/*.sh wrap command-line calls to the training and evaluation scripts
- That fig/ directories contain the final visual results

## Diagram (Mermaid)

```mermaid
flowchart TD
    Core["Core Library\nPhysics_Attention.py"]:::core
    click Core "https://github.com/thuml/transolver/blob/main/Physics_Attention.py"

    SharedConfig["params.yaml"]:::config
    click SharedConfig "https://github.com/thuml/transolver/blob/main/params.yaml"
    RootReq["requirements.txt"]:::deps
    click RootReq "https://github.com/thuml/transolver/blob/main/requirements.txt"

    Core --> SharedConfig
    Core --> RootReq

    subgraph "Experiment A: PDE-Solving-StandardBenchmark"
        direction TB
        PDE_Dataset["dataset/"]:::data
        PDE_Embedding["Embedding.py"]:::experiment
        click PDE_Embedding "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/model/Embedding.py"
        PDE_PhysVar["Physics_Attention.py"]:::experiment
        click PDE_PhysVar "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/model/Physics_Attention.py"
        PDE_Irreg["Transolver_Irregular_Mesh.py"]:::experiment
        click PDE_Irreg "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/model/Transolver_Irregular_Mesh.py"
        PDE_Struct2D["Transolver_Structured_Mesh_2D.py"]:::experiment
        click PDE_Struct2D "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/model/Transolver_Structured_Mesh_2D.py"
        PDE_Struct3D["Transolver_Structured_Mesh_3D.py"]:::experiment
        click PDE_Struct3D "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/model/Transolver_Structured_Mesh_3D.py"
        PDE_Utils["utils/"]:::experiment
        PDE_Normal["normalizer.py"]:::experiment
        click PDE_Normal "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/utils/normalizer.py"
        PDE_Testloss["testloss.py"]:::experiment
        click PDE_Testloss "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/utils/testloss.py"
        PDE_Scripts["scripts/"]:::script
        click PDE_Scripts "https://github.com/thuml/transolver/tree/main/PDE-Solving-StandardBenchmark/scripts/"
        PDE_Fig["fig/"]:::script
        click PDE_Fig "https://github.com/thuml/transolver/tree/main/PDE-Solving-StandardBenchmark/fig/"
        PDE_ExpAir["exp_airfoil.py"]:::experiment
        click PDE_ExpAir "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/exp_airfoil.py"
        PDE_ExpDar["exp_darcy.py"]:::experiment
        click PDE_ExpDar "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/exp_darcy.py"
        PDE_ExpEla["exp_elas.py"]:::experiment
        click PDE_ExpEla "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/exp_elas.py"
        PDE_ExpNS["exp_ns.py"]:::experiment
        click PDE_ExpNS "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/exp_ns.py"
        PDE_ExpPipe["exp_pipe.py"]:::experiment
        click PDE_ExpPipe "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/exp_pipe.py"
        PDE_ExpPlas["exp_plas.py"]:::experiment
        click PDE_ExpPlas "https://github.com/thuml/transolver/blob/main/PDE-Solving-StandardBenchmark/exp_plas.py"
    end

    Core --> PDE_Embedding
    PDE_Dataset --> PDE_Embedding
    PDE_Embedding --> PDE_PhysVar
    PDE_PhysVar --> PDE_Irreg
    PDE_PhysVar --> PDE_Struct2D
    PDE_PhysVar --> PDE_Struct3D
    PDE_Irreg --> PDE_ExpAir
    PDE_Struct2D --> PDE_ExpDar
    PDE_Struct3D --> PDE_ExpEla
    PDE_ExpNS --> PDE_Utils
    PDE_Utils --> PDE_Normal
    PDE_Utils --> PDE_Testloss
    PDE_ExpPipe --> PDE_Scripts
    PDE_Scripts --> PDE_Fig

    subgraph "Experiment B: Car-Design-ShapeNetCar"
        direction TB
        Car_Dataset["dataset/"]:::data
        click Car_Dataset "https://github.com/thuml/transolver/tree/main/Car-Design-ShapeNetCar/dataset/"
        Car_DS1["dataset.py"]:::experiment
        click Car_DS1 "https://github.com/thuml/transolver/blob/main/Car-Design-ShapeNetCar/dataset/dataset.py"
        Car_DS2["load_dataset.py"]:::experiment
        click Car_DS2 "https://github.com/thuml/transolver/blob/main/Car-Design-ShapeNetCar/dataset/load_dataset.py"
        Car_Model["Transolver.py"]:::experiment
        click Car_Model "https://github.com/thuml/transolver/blob/main/Car-Design-ShapeNetCar/models/Transolver.py"
        Car_Train["train.py"]:::experiment
        click Car_Train "https://github.com/thuml/transolver/blob/main/Car-Design-ShapeNetCar/train.py"
        Car_Main["main.py"]:::experiment
        click Car_Main "https://github.com/thuml/transolver/blob/main/Car-Design-ShapeNetCar/main.py"
        Car_Eval["main_evaluation.py"]:::experiment
        click Car_Eval "https://github.com/thuml/transolver/blob/main/Car-Design-ShapeNetCar/main_evaluation.py"
        Car_Utils["utils/"]:::experiment
        Car_Util1["drag_coefficient.py"]:::experiment
        click Car_Util1 "https://github.com/thuml/transolver/blob/main/Car-Design-ShapeNetCar/utils/drag_coefficient.py"
        Car_Scripts["scripts/"]:::script
        click Car_Scripts "https://github.com/thuml/transolver/tree/main/Car-Design-ShapeNetCar/scripts/"
        Car_Fig["fig/"]:::script
        click Car_Fig "https://github.com/thuml/transolver/tree/main/Car-Design-ShapeNetCar/fig/"
        Car_Req["requirements.txt"]:::deps
        click Car_Req "https://github.com/thuml/transolver/blob/main/Car-Design-ShapeNetCar/requirements.txt"
    end

    Core --> Car_Model
    SharedConfig --> Car_Train
    Car_Dataset --> Car_DS1
    Car_DS1 --> Car_Model
    Car_Model --> Car_Train
    Car_Train --> Car_Main
    Car_Main --> Car_Eval
    Car_Eval --> Car_Utils
    Car_Utils --> Car_Util1
    Car_Main --> Car_Scripts
    Car_Scripts --> Car_Fig
    Car_Req --> Car_Model

    subgraph "Experiment C: Airfoil-Design-AirfRANS"
        direction TB
        Air_Dataset["dataset/"]:::data
        click Air_Dataset "https://github.com/thuml/transolver/tree/main/Airfoil-Design-AirfRANS/dataset/"
        Air_DS1["dataset.py"]:::experiment
        click Air_DS1 "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/dataset/dataset.py"
        Air_DS2["dataset_stats.ipynb"]:::experiment
        click Air_DS2 "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/dataset/dataset_stats.ipynb"
        Air_Models["models/"]:::experiment
        click Air_Models "https://github.com/thuml/transolver/tree/main/Airfoil-Design-AirfRANS/models/"
        Air_GUNet["GUNet.py"]:::experiment
        click Air_GUNet "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/models/GUNet.py"
        Air_GraphSAGE["GraphSAGE.py"]:::experiment
        click Air_GraphSAGE "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/models/GraphSAGE.py"
        Air_MLP["MLP.py"]:::experiment
        click Air_MLP "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/models/MLP.py"
        Air_NN["NN.py"]:::experiment
        click Air_NN "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/models/NN.py"
        Air_PointNet["PointNet.py"]:::experiment
        click Air_PointNet "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/models/PointNet.py"
        Air_Trans["Transolver.py"]:::experiment
        click Air_Trans "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/models/Transolver.py"
        Air_Train["train.py"]:::experiment
        click Air_Train "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/train.py"
        Air_Main["main.py"]:::experiment
        click Air_Main "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/main.py"
        Air_Eval["main_evaluation.py"]:::experiment
        click Air_Eval "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/main_evaluation.py"
        Air_Utils["utils/"]:::experiment
        Air_U1["metrics.py"]:::experiment
        click Air_U1 "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/utils/metrics.py"
        Air_U2["metrics_NACA.py"]:::experiment
        click Air_U2 "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/utils/metrics_NACA.py"
        Air_U3["naca_generator.py"]:::experiment
        click Air_U3 "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/utils/naca_generator.py"
        Air_U4["reorganize.py"]:::experiment
        click Air_U4 "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/utils/reorganize.py"
        Air_Scripts["scripts/"]:::script
        click Air_Scripts "https://github.com/thuml/transolver/tree/main/Airfoil-Design-AirfRANS/scripts/"
        Air_Fig["fig/"]:::script
        click Air_Fig "https://github.com/thuml/transolver/tree/main/Airfoil-Design-AirfRANS/fig/"
        Air_Req["requirements.txt"]:::deps
        click Air_Req "https://github.com/thuml/transolver/blob/main/Airfoil-Design-AirfRANS/requirements.txt"
    end

    Core --> Air_Trans
    SharedConfig --> Air_Train
    Air_Dataset --> Air_DS1
    Air_DS1 --> Air_Models
    Air_Models --> Air_GUNet
    Air_Models --> Air_GraphSAGE
    Air_Models --> Air_MLP
    Air_Models --> Air_NN
    Air_Models --> Air_PointNet
    Air_Models --> Air_Trans
    Air_Trans --> Air_Train
    Air_Train --> Air_Main
    Air_Main --> Air_Eval
    Air_Eval --> Air_Utils
    Air_Utils --> Air_U1
    Air_Utils --> Air_U2
    Air_Utils --> Air_U3
    Air_Utils --> Air_U4
    Air_Main --> Air_Scripts
    Air_Scripts --> Air_Fig
    Air_Req --> Air_Models

    classDef core fill:#ADD8E6,stroke:#000;
    classDef experiment fill:#90EE90,stroke:#000;
    classDef data fill:#FFA500,stroke:#000;
    classDef script fill:#D3D3D3,stroke:#000;
    classDef config fill:#D8BFD8,stroke:#000;
    classDef deps fill:#F08080,stroke:#000;
```
