Companion code repository for the paper
"Populating cellular metamaterials on the extrema of attainable elasticity through neuroevolution"
Paper · DOI · Database · MIT License
Maohua Yan, Ruicheng Wang, Ke Liu
Computer Methods in Applied Mechanics and Engineering, 438 (2025), 117950
This repository contains the research code used to generate 2D cellular metamaterial unit cells with CPPNs (Compositional Pattern-Producing Networks) and a modified NEAT-based multi-objective evolutionary algorithm. The workflow couples geometry generation, mesh construction, constraint handling, and periodic homogenization to search for designs near the empirical extrema of attainable elasticity.
The primary research path in this repository is centered on main.py, config.ini, tools/, and the local modified neat/ implementation.
flowchart LR
A[Initialize population] --> B[Decode genome to CPPN]
B --> C[Sample structured point cloud]
C --> D[Threshold and extract geometry]
D --> E[Generate mesh]
E --> F[Evaluate effective elastic properties]
F --> G[Assign objectives and constraints]
G --> H[Evolve next generation]
At the repository level, the main workflow is:
- Generate a structured point cloud for the selected symmetry class.
- Evaluate a CPPN on that point cloud to produce a scalar field.
- Threshold and interpolate the field into material and void regions.
- Build a mesh and check geometric validity or connectivity constraints.
- Solve the periodic homogenization problem to obtain effective properties.
- Feed the evaluated objectives back into the evolutionary loop.
.
├── main.py # Main entry point for metamaterial evolution
├── config.ini # NEAT and experiment configuration
├── multi_task.py # Batch task definitions across symmetries and trade-offs
├── gen_pcd.py # Point-cloud generation utilities
├── tools/ # Geometry, meshing, homogenization, constraints, utilities
├── neat/ # Local modified neat-python implementation
├── test/ # Exploratory and utility test scripts
├── test.py # Standalone test/demo entry
└── design_framework.zip # Archived framework snapshot
main.py: experiment orchestration and genome evaluation loopgen_pcd.py: structured point-cloud generation for different symmetry assumptionstools/shape.py: contour extraction, triangulation, and topology constructiontools/read_mesh.py: conversion from generated geometry to FEniCS-compatible meshestools/period.py: periodic homogenization and effective-property evaluationtools/handle_constraints.py: connectivity and validity checks
neat/: local fork ofneat-pythonneat/population.py: modified population flow for this research setupneat/spea2.py: archive and Pareto-related utilitiesneat/ns.py: novelty-related support code
The main metamaterial pipeline was developed around the following stack:
- Python 3.8
- NumPy
- SciPy
- Matplotlib
- FEniCS / Dolfin
cvxopt
Because this is a research codebase, environment setup is somewhat workflow-specific. For the main experiments, the critical requirement is a working FEniCS/Dolfin environment.
Clone the repository:
git clone https://github.com/mh-yan/evo_cppn_material.git
cd evo_cppn_materialInstall the dependencies required by your target workflow, then run the main experiment with:
python main.pyThis uses the settings in config.ini and the default trade-off defined in main.py.
For customization:
- edit
config.inito change population size, number of generations, density, and symmetry type - inspect
multi_task.pyfor batch experiment definitions - focus on
main.py,tools/, andneat/if you are reproducing the paper pipeline
The paper-related metamaterial database is publicly available at:
This repository is best understood as a companion research codebase rather than a polished software package. The main reference implementation is the metamaterial pipeline centered on main.py, config.ini, tools/, and neat/.
If you use this repository in academic work, please cite:
Maohua Yan, Ruicheng Wang, Ke Liu. Populating cellular metamaterials on the extrema of attainable elasticity through neuroevolution. Computer Methods in Applied Mechanics and Engineering, 438 (2025), 117950. https://doi.org/10.1016/j.cma.2025.117950
@article{yan2025populating,
title = {Populating cellular metamaterials on the extrema of attainable elasticity through neuroevolution},
author = {Yan, Maohua and Wang, Ruicheng and Liu, Ke},
journal = {Computer Methods in Applied Mechanics and Engineering},
volume = {438},
pages = {117950},
year = {2025},
doi = {10.1016/j.cma.2025.117950},
url = {https://doi.org/10.1016/j.cma.2025.117950}
}This project is released under the MIT License. See LICENSE for details.
