Research code for the paper "Populating cellular metamaterials on the extrema of attainable elasticity through neuroevolution".
This repository explores metamaterial unit-cell design with CPPNs (Compositional Pattern-Producing Networks) and a modified NEAT-based multi-objective evolutionary pipeline. The framework generates diverse cellular geometries, evaluates their homogenized elastic properties, and pushes the search toward the empirical bounds of attainable elasticity.
Designing architected materials often requires navigating strong trade-offs between mechanical properties such as stiffness, shear response, and Poisson's ratio. Instead of optimizing a single hand-crafted topology, this project treats metamaterial discovery as a search problem over geometry generators:
- CPPNs encode geometry compactly and generate structured, highly regular patterns.
- Modified NEAT evolves both weights and topology of the CPPNs.
- Finite-element homogenization evaluates the effective properties of each generated unit cell.
- Multi-objective selection and diversity mechanisms help populate the Pareto frontier instead of converging to a single design.
- CPPN-based generation of 2D unit-cell topologies on structured point clouds
- Multiple point-cloud symmetries:
nosym,sym2,sym4,rotate,parallel - Customized
neat-pythonfork with archive-based multi-objective behavior and novelty-related utilities - FEniCS / Dolfin-based periodic homogenization for effective elastic-property evaluation
- Utilities for geometry extraction, contour interpolation, meshing, constraint checking, and visualization
flowchart LR
A[Initialize population] --> B[Decode genome to CPPN]
B --> C[Sample structured point cloud]
C --> D[Threshold and extract geometry]
D --> E[Build mesh]
E --> F[Evaluate effective properties]
F --> G[Assign fitness / constraints]
G --> H[Evolve next generation]
At the repository level, the main metamaterial workflow is:
- Generate a structured point cloud for the chosen symmetry class.
- Evaluate a CPPN on the point cloud.
- Convert scalar outputs into material/void regions.
- Construct a triangular mesh and enforce geometric constraints.
- Solve periodic homogenization problems to compute effective properties.
- Feed the results back into the evolutionary loop.
.
├── main.py # Main entry for metamaterial evolution
├── config.ini # Core NEAT and experiment configuration
├── multi_task.py # Batch task definitions across symmetries/trade-offs
├── gen_pcd.py # Point-cloud generation utilities
├── tools/ # Geometry, meshing, homogenization, constraints, utils
├── neat/ # Modified local neat-python implementation
├── test/ # Utility and exploratory test scripts
└── output/ # Generated results, checkpoints, figures
main.py: experiment entry point and genome evaluation loopgen_pcd.py: structured point-cloud generation for different symmetry assumptionstools/shape.py: contour extraction, triangulation, and geometry handlingtools/read_mesh.py: conversion from generated geometry to FEniCS meshestools/period.py: periodic homogenization and effective-property computationtools/handle_constraints.py: connectivity and validity checks
neat/: local fork ofneat-pythonneat/population.py: modified population flow for this research setup
The main metamaterial pipeline was developed around the following stack:
- Python 3.8
- NumPy
- SciPy
- Matplotlib
- FEniCS / Dolfin
cvxopt(for some homogenization utilities)
Because this is a research codebase with several experimental branches, dependency management is partly workflow-specific. For the metamaterial experiments, the most important requirement is a working FEniCS/Dolfin environment.
git clone https://github.com/mh-yan/evo_cppn_material.git
cd evo_cppn_materialThen install the dependencies required by your target workflow:
- Metamaterial pipeline: Python scientific stack + FEniCS/Dolfin
python main.pyThis uses the settings in config.ini and the default trade-off defined in main.py.
Edit config.ini to control parameters such as:
- population size
- number of generations
- point-cloud density
- symmetry type (
pcdtype) - novelty/archive parameters
For multiple experiment definitions, inspect and edit multi_task.py, then enable task collection in main.py.
Typical outputs include:
- evolved genomes (
.pkl) - generated meshes and contours
- fitness distribution plots
- intermediate geometry visualizations
The paper-related metamaterial database is publicly available here:
DOCUMENTATION.md: detailed Chinese walkthrough of the project structure and workflow
If you are onboarding to the codebase for development or reproducibility work, DOCUMENTATION.md is the best starting point after this README.
This repository combines:
- the main research code used for neuroevolutionary metamaterial discovery
- modified optimization infrastructure built on top of
neat-python - several engineering and downstream exploratory workflows
As a result, some directories are more polished than others; the metamaterial pipeline centered around main.py, config.ini, tools/, and neat/ is the primary reference implementation.
If you use this repository in academic work, please cite the associated paper:
Maohua Yan, Ruicheng Wang, Ke Liu
Populating cellular metamaterials on the extrema of attainable elasticity through neuroevolution
This project is released under the MIT License. See LICENSE for details.