EomAA / letop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CircleCI codecov

Level set topology optimization in Firedrake 🚧 🚧 (in progress)

LeToP implements the level set method in topology optimization. It combines the automated calculation of shape derivatives in Firedrake and pyadjoint with the Null space optimizer to find the optimal design. The level set in advected with a Hamilton-Jacobi equation and properly reinitialized to maintain the signed distance property.

The user interface is very close to pyadjoint to allow for easy compatibility.

Installation

Install with

pip3 install .

at the project's root directory and with the Firedrake's virtual environment activated. LeTop depends on the 10.5281/zenodo.5526481 zenodo release , which can be simply installed by passing the flag --doi 10.5281/zenodo.5526481 to firedrake-install.

Examples

Cantilever

cantilever

Heat exchanger

heat_exchanger_3D

Bridge

bridge

LLNL Release Number: LLNL-CODE-817098

Considerations when using LeToP

Make use of the pyadjoint context manager stop_annotating() and the decorator no_annotations for:

  • When using interpolate() or project from Firedrake as they might annotate unnecessary operations and result in wrong the shape derivatives.
  • Similarly, when extending LeToP routines, make sure you are not annotating additional operations as Firedrake annotates everything by default when importing firedrake_adjoint.
  • The shape velocities should be zeroed on the Dirichlet and Neumann boundaries. Use the RegularizationSolver boundary conditions to this effect.
  • Add fd.parameters["form_compiler"]["quadrature_degree"] = 4 to ensure quadrature does not go too high due to the heaviside function (used to mark the subdomains)
  • The isocontours of the level set must have enough mesh resolution, otherwise the reinitialization solver might fail.

About

License:MIT License


Languages

Language:Python 95.1%Language:GLSL 4.2%Language:Dockerfile 0.4%Language:Shell 0.3%