// project 08

Geode

Overview

C++20 computational engineering engine: voxel-grid multi-physics simulation (thermal, structural, fluid, acoustic, EM) coupled to gradient-based topology optimization with manufacturing-aware constraints.

C++C#CMakeSIMD(AVX2/5)PicoGK

Geode is a deterministic computational engineering modeling (CEM) engine built in C++20, designed to co-simulate multiple physics domains on regular voxel grids and iteratively optimize designs under real manufacturing constraints.

At its core, Geode voxelizes implicit geometry defined via Signed Distance Functions and assigns per-voxel material properties. Five independent physics solvers then operate on that grid: a Finite Difference solver for steady-state heat transfer (∇·(k∇T) + Q = 0), a Finite Element solver for linear structural mechanics, a Stokes/Navier-Stokes solver for viscous fluid flow, an electrostatics solver for electromagnetic field analysis, and a Helmholtz solver for acoustic wave propagation. Solvers that have no inter-dependencies are dispatched in parallel through a TaskFlow-based DAG orchestrated by the Pipeline class.

Once field solutions are available, sensitivities are computed and fed into one of three optimizers: gradient descent (with optional Polyak momentum), L-BFGS (quasi-Newton with circular history buffer), or SIMP (Solid Isotropic Material with Penalization for density-based topology optimization). Each optimizer iterates per-voxel pseudo-densities ρ ∈ [0,1] to minimize an objective while satisfying constraints.

The constraint system is split into hard constraints - minimum solid volume, feature size, wall thickness - and manufacturing-specific rules for LPBF (laser powder bed fusion, max 45° overhang, support-free spans) and CNC (tool accessibility, draft angles). Constraint violations either block infeasible designs or enter the objective as soft penalties, giving the optimizer gradient signal to escape them.

Performance is a first-order concern throughout. All field buffers use Structure-of-Arrays layout with 64-byte alignment. Inner loops in the Jacobi iterations and Laplacian stencils are dispatched through a SIMD abstraction layer (AVX-512 → AVX2 → scalar fallback). A deterministic heatsink test validates the full pipeline end-to-end, confirming that identical inputs always produce identical outputs.

The engine exposes a C# application layer via PicoGK for interactive geometry authoring and 3D visualization, bridging high-level design intent with the intensive C++ computation underneath. The build system (CMake 3.20+, Justfile shortcuts) and a suite of 27 GoogleTest unit tests cover every major subsystem.