How cmudrc/megaflow2d works
Project type and purpose
• MegaFlow2D is a Python dataset package and example‐driven library for parameterized CFD (computational fluid dynamics) simulation data, specifically designed to feed graph‐based ML/super‐resolution workflows.
• Its core purpose is to (a) ingest raw simulation outputs (via FEniCS/dolfin), (b) store them in HDF5, (c) expose them as PyTorch‐Geometric graph datasets, and (d) demonstrate usage via example training scripts.
File structure
• Top level:
• setup.py / pyproject.toml: packaging and dependency configuration
• megaflow/: the main library
• examples/: training/demo scripts and models
• test.py: ad hoc test harness
• megaflow/common/: utility modules for metrics, I/O helpers
• megaflow/dataset/: the MegaFlow2D class, HDF5 storage layout, processing logic
• examples/model/: placeholder for user‐supplied ML model definitions
• examples/train.py: CLI wrapper that ties together dataset, model, training loop
• External dependencies declared: h5py, FEniCS/dolfin, torch‐geometric
README for additional insights
• Describes HDF5 storage hierarchy: geometry → resolution → timestep → dataset
• Explains automatic processing if raw HDF5 is missing
• Notes multi‐threaded HDF5 writes via process()
• Illustrates dataset usage and example training command line