Algorithmic Differentiation of the pythonOCC Geometric Modeling Library
Mladen Ž. Banović, Thomas E. Hafemann, Adam M. Stück · 2024
Shape optimization workflows in the aeronautical and automotive industry often rely on high-fidelity numerical simulations (e.g.Computational Fluid Dynamics) and involve CAD-based parametrizations.Since such workflows may impose large computational costs, the optimization itself can be driven by efficient gradient-based methods.This approach, however, requires gradient (sensitivity) information from each component used in the optimization workflow, where the missing link are typically the so-called geometric sensitivities from CAD systems or libraries.To retrieve the exact sensitivity information, one can apply algorithmic differentiation (AD) to the CAD library if its source code is available.For instance, this was successfully demonstrated in the past by differentiating the widely-used C++ geometric kernel OpenCASCADE Technology (OCCT) using the AD tool ADOL-C.This study continues on the previously mentioned work and introduces the following novel contribution: a mixed-language AD of a hybrid Python/C++ geometric modeling library, namely pythonOCC.As its name suggests, pythonOCC provides Python wrappers for OCCT.With the mixed-language AD approach, one can propagate geometric sensitivities from Python to C++ and vice-versa, thus allowing the utilization of pythonOCC in CAD-based shape optimization workflows.