Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gated_linear_networks/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
absl-py==0.10.0
aiohttp==3.6.2
aiohttp==3.12.14
astunparse==1.6.3
async-timeout==3.0.1
attrs==20.2.0
Expand Down
178 changes: 178 additions & 0 deletions meshgraphnets/DATASETS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# MeshGraphNets Dataset Guide

This document provides comprehensive information about MeshGraphNets datasets, specifically addressing Issue #569 regarding the AirFoil Steady State dataset access.

## Available Datasets

Based on the MeshGraphNets paper and repository, the following datasets are available:

### 🌊 **Fluid Dynamics (CFD) Datasets**

#### 1. **airfoil** - Airfoil Steady State Dataset
- **Description**: Computational Fluid Dynamics simulations around airfoils
- **Type**: Steady-state flow simulations
- **Use Case**: Research on aerodynamics, airfoil performance analysis
- **Paper Reference**: Mentioned as comparison dataset in MeshGraphNets paper
- **Domain**: Fluid dynamics with complex boundary conditions

#### 2. **cylinder_flow** - Cylinder Flow Dataset
- **Description**: CFD simulations of fluid flow around cylindrical obstacles
- **Type**: Time-dependent flow simulations
- **Use Case**: Fluid dynamics research, wake formation studies
- **Recommended Model**: `--model=cfd`

### 🧵 **Cloth/Structural Dynamics Datasets**

#### 3. **flag_simple** - Simple Flag Simulation
- **Description**: Cloth dynamics simulation of flag motion
- **Type**: Structural dynamics with simple boundary conditions
- **Use Case**: Cloth simulation, deformable object modeling
- **Recommended Model**: `--model=cloth`

#### 4. **flag_minimal** - Minimal Flag Dataset
- **Description**: Truncated version of flag_simple
- **Type**: Testing/integration dataset (smaller size)
- **Use Case**: Quick testing, integration tests

#### 5. **flag_dynamic** - Dynamic Flag Simulation
- **Description**: More complex flag dynamics with varying conditions
- **Type**: Advanced cloth dynamics
- **Use Case**: Research on complex cloth behavior

#### 6. **flag_dynamic_sizing** - Dynamic Flag with Sizing Field
- **Description**: Flag simulation with adaptive mesh sizing
- **Type**: Adaptive mesh refinement research
- **Use Case**: Learning optimal mesh sizing strategies

### 🏗️ **Structural Mechanics Datasets**

#### 7. **deforming_plate** - Deforming Plate Simulation
- **Description**: Structural deformation simulation of plates
- **Type**: Solid mechanics simulation
- **Use Case**: Structural analysis, material deformation research

#### 8. **sphere_simple** - Simple Sphere Simulation
- **Description**: Basic sphere deformation/dynamics
- **Type**: Simple structural dynamics
- **Use Case**: Basic deformable object research

#### 9. **sphere_dynamic** - Dynamic Sphere Simulation
- **Description**: Complex sphere dynamics with varying conditions
- **Type**: Advanced structural dynamics
- **Use Case**: Complex deformable object modeling

#### 10. **sphere_dynamic_sizing** - Dynamic Sphere with Sizing Field
- **Description**: Sphere simulation with adaptive mesh sizing
- **Type**: Adaptive mesh refinement for spherical objects
- **Use Case**: Learning mesh sizing for complex geometries

## Download Instructions

### Method 1: Using Python Download Script (Recommended)

```bash
# List all available datasets
python meshgraphnets/download_meshgraphnet_datasets.py --list-datasets

# Download airfoil dataset
python meshgraphnets/download_meshgraphnet_datasets.py --dataset airfoil --output_dir ./data

# Download cylinder_flow dataset
python meshgraphnets/download_meshgraphnet_datasets.py --dataset cylinder_flow --output_dir ./data

# Verify downloaded dataset
python meshgraphnets/download_meshgraphnet_datasets.py --verify ./data
```

### Method 2: Using Shell Script

```bash
# Download airfoil dataset
bash meshgraphnets/download_dataset.sh airfoil ./data

# Download cylinder_flow dataset
bash meshgraphnets/download_dataset.sh cylinder_flow ./data
```

## Dataset Structure

Each dataset contains:
- `meta.json`: Metadata describing fields and shapes
- `train.tfrecord`: Training data
- `valid.tfrecord`: Validation data
- `test.tfrecord`: Test data

## Research Usage

### For AirFoil Steady State Research (Issue #569)

The **airfoil** dataset is specifically designed for:
- Computational Fluid Dynamics research
- Airfoil performance analysis
- Steady-state flow simulation studies
- Comparison with other CFD methods

### Training Models

```bash
# Train CFD model on airfoil dataset
python -m meshgraphnets.run_model --mode=train --model=cfd \
--checkpoint_dir=./checkpoints --dataset_dir=./data/airfoil

# Train CFD model on cylinder_flow dataset
python -m meshgraphnets.run_model --mode=train --model=cfd \
--checkpoint_dir=./checkpoints --dataset_dir=./data/cylinder_flow

# Train cloth model on flag datasets
python -m meshgraphnets.run_model --mode=train --model=cloth \
--checkpoint_dir=./checkpoints --dataset_dir=./data/flag_simple
```

### Evaluation and Visualization

```bash
# Generate rollouts for airfoil simulations
python -m meshgraphnets.run_model --mode=eval --model=cfd \
--checkpoint_dir=./checkpoints --dataset_dir=./data/airfoil \
--rollout_path=./results/airfoil_rollout.pkl

# Plot CFD results
python -m meshgraphnets.plot_cfd --rollout_path=./results/airfoil_rollout.pkl
```

## Troubleshooting

### Common Issues

1. **Dataset not found (404 errors)**
- Solution: Use the updated download scripts that fix broken URL issues
- See Issue #596 fix for details

2. **Large download sizes**
- Airfoil dataset: ~2-3GB
- Cylinder flow: ~4-5GB
- Flag datasets: ~1-2GB each
- Ensure sufficient disk space

3. **Network timeouts**
- Use Python download script with retry logic
- Download during off-peak hours
- Check internet connection stability

### Paper References

- **MeshGraphNets Paper**: [Learning Mesh-Based Simulation with Graph Networks](https://arxiv.org/abs/2010.03409)
- **Airfoil Dataset**: Used for comparison studies in computational fluid dynamics
- **Repository**: [deepmind/deepmind-research/meshgraphnets](https://github.com/deepmind/deepmind-research/tree/master/meshgraphnets)

## Contributing

If you encounter issues with dataset access:
1. Check this guide for troubleshooting steps
2. Verify your download commands match the examples
3. Report specific error messages with dataset names
4. Include system information (OS, Python version, network conditions)

---

**Note**: This guide addresses Issue #569 regarding AirFoil Steady State dataset access. The airfoil dataset is available through the standard MeshGraphNets download mechanisms once the download script fixes are applied.
76 changes: 58 additions & 18 deletions meshgraphnets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ Download a dataset:
mkdir -p ${DATA}
bash meshgraphnets/download_dataset.sh flag_simple ${DATA}

**Alternative download methods:**

If you encounter 404 errors with the bash script (Issue #596), use the Python downloader:

# Download using Python script (recommended)
python meshgraphnets/download_meshgraphnet_datasets.py --dataset flag_simple --output_dir ${DATA}

# List available datasets
python meshgraphnets/download_meshgraphnet_datasets.py --list-datasets

# Verify downloaded dataset
python meshgraphnets/download_meshgraphnet_datasets.py --verify flag_simple

## Running the model

Train a model:
Expand All @@ -66,21 +79,48 @@ Datasets can be downloaded using the script `download_dataset.sh`. They contain
a metadata file describing the available fields and their shape, and tfrecord
datasets for train, valid and test splits.
Dataset names match the naming in the paper.
The following datasets are available:

airfoil
cylinder_flow
deforming_plate
flag_minimal
flag_simple
flag_dynamic
flag_dynamic_sizing
sphere_simple
sphere_dynamic
sphere_dynamic_sizing

`flag_minimal` is a truncated version of flag_simple, and is only used for
integration tests. `flag_dynamic_sizing` and `sphere_dynamic_sizing` can be
used to learn the sizing field. These datasets have the same structure as
the other datasets, but contain the meshes in their state before remeshing,
and define a matching `sizing_field` target for each mesh.

### 📋 **Complete Dataset List**

The following datasets are available for download:

#### **Fluid Dynamics (CFD)**
- **`airfoil`**: Airfoil steady-state simulations (CFD around airfoils) - *Addresses Issue #569*
- **`cylinder_flow`**: Cylinder flow CFD dataset (time-dependent fluid dynamics)

#### **Cloth/Structural Dynamics**
- **`flag_simple`**: Simple flag simulation dataset (cloth dynamics)
- **`flag_minimal`**: Truncated version of flag_simple (for integration tests)
- **`flag_dynamic`**: Advanced flag dynamics with varying conditions
- **`flag_dynamic_sizing`**: Flag simulation with adaptive mesh sizing

#### **Structural Mechanics**
- **`deforming_plate`**: Deforming plate simulation dataset
- **`sphere_simple`**: Simple sphere simulation dataset
- **`sphere_dynamic`**: Complex sphere dynamics
- **`sphere_dynamic_sizing`**: Sphere simulation with adaptive mesh sizing

### 💾 **Download Methods**

**Using Python script (recommended for Issue #569):**
```bash
# Download airfoil dataset (addresses Issue #569)
python meshgraphnets/download_meshgraphnet_datasets.py --dataset airfoil --output_dir ${DATA}

# List all available datasets
python meshgraphnets/download_meshgraphnet_datasets.py --list-datasets

# Download any specific dataset
python meshgraphnets/download_meshgraphnet_datasets.py --dataset DATASET_NAME --output_dir ${DATA}
```

**Using shell script:**
```bash
bash meshgraphnets/download_dataset.sh DATASET_NAME ${DATA}
```

### 📖 **Detailed Dataset Information**

For comprehensive information about each dataset, including research applications and usage examples, see [DATASETS.md](DATASETS.md).

**Special Note for Issue #569**: The `airfoil` dataset mentioned in the MeshGraphNets paper is available for download using the methods above. This dataset contains steady-state CFD simulations around airfoils, suitable for aerodynamics research and comparison studies.
31 changes: 29 additions & 2 deletions meshgraphnets/download_dataset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,37 @@ set -e
DATASET_NAME="${1}"
OUTPUT_DIR="${2}/${DATASET_NAME}"

BASE_URL="https://storage.googleapis.com/dm-meshgraphnets/${DATASET_NAME}/"
# Validate inputs
if [ -z "${DATASET_NAME}" ] || [ -z "${2}" ]; then
echo "Usage: sh download_dataset.sh DATASET_NAME OUTPUT_DIR"
echo "Example: sh download_dataset.sh flag_simple /tmp/"
echo "Available datasets: flag_simple, cylinder_flow, deforming_plate, sphere_simple"
exit 1
fi

# Ensure no double slash in URL construction
BASE_URL="https://storage.googleapis.com/dm-meshgraphnets"

echo "Downloading dataset: ${DATASET_NAME}"
echo "Output directory: ${OUTPUT_DIR}"
echo "Base URL: ${BASE_URL}/${DATASET_NAME}/"

mkdir -p ${OUTPUT_DIR}
for file in meta.json train.tfrecord valid.tfrecord test.tfrecord
do
wget -O "${OUTPUT_DIR}/${file}" "${BASE_URL}${file}"
DOWNLOAD_URL="${BASE_URL}/${DATASET_NAME}/${file}"
echo "Downloading: ${DOWNLOAD_URL}"

# Download with error handling
if wget -O "${OUTPUT_DIR}/${file}" "${DOWNLOAD_URL}"; then
echo "✓ Successfully downloaded: ${file}"
else
echo "✗ Failed to download: ${file}"
echo " URL: ${DOWNLOAD_URL}"
echo " Please check if the dataset name is correct."
exit 1
fi
done

echo "✅ Dataset download completed successfully!"
echo "📁 Files saved to: ${OUTPUT_DIR}"
Loading