Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

130 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptnet

Adaptnet is a Python pipeline to predict mesh adaptation to a physical problem, given an initial CAD and boundary conditions.

This pipeline relies on:

  • Meshnet network for predicting mesh parameters given a CAD model.
  • Graphnet network for predicting the solution of a PDE given a mesh.

Both models are based on the PyTorch Geometric library. And both networks are based on the MeshGraphNets architecture.

Setup

Conda environment

conda env create -f src/envs/adaptnet_no_builds.yml
conda activate adaptnet

Install Meshnet and Graphnet

Download the Meshnet and Graphnet repositories in the same folder as Adaptnet:

git clone https://github.com/UgoPelissier/meshnet.git
git clone https://github.com/UgoPelissier/graphnet.git

Your folder should look like this:

├── .vscode
├── graphnet
├── meshnet
├── scripts
├── src
├── .gitignore
└── README.md

Train Meshnet and Graphnet

Follow the instructions in the README.md files of Meshnet and Graphnet to download the data and train the models. This will generate checkpoint files in the meshnet/logs/version_$VERSION_NUMBER/checkpoints and graphnet/logs/version_$VERSION_NUMBER/checkpoints folders.

Alternatively, if you already have the datasets, you can use the scripts in scripts to train and test the models:

bash ./scripts/meshnet/train.sh
bash ./scripts/meshnet/test.sh
bash ./scripts/graphnet/train.sh
bash ./scripts/graphnet/test.sh

For testing, you can change the --checkpoint variable to the path of the checkpoint you want to test inside the test.sh file.

Run Adaptnet

Create a data folder in src:

mkdir src/data

and put your CAD file inside it. For instance, src folder could look like this:

└── src
    ├── configs
    └── data
        └── cad_500
            ├── cad_500.geo_unrolled
            └── cad_500.geo
    ├── envs
    ├── utils
    ├── __init__.py
    ├── main.py
    └── dataset.py

Open the src/configs/config.yaml file, check, and change the parameters marked with # TODO if needed.

Then, run Adaptnet:

bash ./scripts/predict.sh env=$ENV_NAME (mines or safran)

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages