Search arXivSearch

arXiv · 2407.11713

AutoFreeFem: Automatic code generation with FreeFEM++ and LaTex output for shape and topology optimization of non-linear multi-physics problems

Abstract

For an educational purpose we develop the Python package AutoFreeFem which generates all ingredients for shape optimization with non-linear multi-physics in FreeFEM++ and also outputs the expressions for use in LaTex. As an input, the objective function and the weak form of the problem have to be specified only once. This ensures consistency between the simulation code and its documentation. In particular, AutoFreeFem provides the linearization of the state equation, the adjoint problem, the shape derivative, as well as a basic implementation of the level-set based mesh evolution method for shape optimization. For the computation of shape derivatives we utilize the mathematical Lagrangian approach for differentiating PDE-constrained shape functions. Differentiation is done symbolically using Sympy. In numerical experiments we verify the accuracy of the computed derivatives. Finally, we showcase the capabilities of AutoFreeFem by considering shape optimization of a non-linear diffusion problem, linear and non-linear elasticity problems, a thermo-elasticity problem and a fluid-structure interaction problem.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Grégoire Allaire, Michael H. Gfrerer. 2024-07-16. AutoFreeFem: Automatic code generation with FreeFEM++ and LaTex output for shape and topology optimization of non-linear multi-physics problems. https://arxiv.org/abs/2407.11713

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

The Operational Impact of Registry size, Cycle length, and Blood Type Distribution in Multi-Registry Kidney Exchange Programs

Kidney exchange programs address donor recipient incompatibility by exchanging donors between incompatible pairs, but single center KEPs often suffer from limited donor pools, which reduce matching efficiency. Multi registry kidney exchange programs offer a promising solution but face challenges, including heterogeneous constraints across registries, cycle-length bounds, and data-sharing limitations. This study uses simulation to compare mKEP allocation against individual registry operation, contrasting unconstrained pooling with two safeguarded mechanisms: a cumulative individual-rationality guarantee and a Shapley value based fair-share mechanism. We examine how registry size, blood-type distribution, cycle-length bounds, and dropout probability affect the size and distribution of achievable gain. Our central finding is that the benefit of joining an mKEP is systematically uneven: under blood group composition asymmetry, the easier-to-match registry gains less than its partner even under both safeguarded mechanisms, and a larger registry gains less than a smaller one when pooled. A registry combining a larger arrival rate with an easier-to-match pool may see its gain under either safeguarded mechanism fall too small to be practically significant, while registries with a higher dropout rate see a larger benefit from pooling. This unevenness concentrates in O-type recipients: an easier-to-match registry sees fewer O-type transplants within itself under pooling, though O-type transplant rates rise system-wide. Tighter cycle-length bounds increase, rather than diminish, the relative transplant-volume benefit of pooling, while match quality is only modestly affected by any factor examined. These results highlight the importance of pairing multi-registry collaboration with a carefully designed, equitable benefit-sharing mechanism to keep participation attractive for all registries involved.

math.OC

A polynomial approximation scheme for nonlinear model reduction by moment matching

We propose a procedure for the numerical approximation of invariance equations arising in the moment matching technique associated with reduced-order modeling of high-dimensional dynamical systems. The Galerkin residual method is employed to find an approximate solution to the invariance equation using a Newton iteration on the coefficients of a monomial basis expansion of the solution. These solutions to the invariance equations can then be used to construct reduced-order models. We assess the ability of the method to solve the invariance PDE system as well as to achieve moment matching and recover the steady-state behaviour of nonlinear systems with state dimension of order 1000 driven by linear and nonlinear signal generators.

math.OC

Computationally Efficient Density-Driven Optimal Control via Analytical KKT Reduction and Contractive MPC

Efficient coordination for collective spatial distribution is a fundamental challenge in multi-agent systems. Prior research on Density-Driven Optimal Control (D2OC) established a framework to match agent trajectories to a desired spatial distribution. However, implementing this as a predictive controller requires solving a large-scale Karush-Kuhn-Tucker (KKT) system, whose computational complexity grows cubically with the prediction horizon. To resolve this, we propose an analytical structural reduction that transforms the T-horizon KKT system into a condensed quadratic program (QP). This formulation achieves O(T) linear scalability, significantly reducing the online computational burden compared to conventional O(T^3) approaches. Furthermore, to ensure rigorous convergence in dynamic environments, we incorporate a contractive Lyapunov constraint and prove the Input-to-State Stability (ISS) of the closed-loop system against reference propagation drift. Numerical simulations verify that the proposed method facilitates rapid density coverage with substantial computational speed-up, enabling long-horizon predictive control for large-scale multi-agent swarms.

math.OC