jax_fem.mma module

Contents

jax_fem.mma module#

jax_fem.mma.optimize(fe, rho_ini, optimizationParams, objectiveHandle, consHandle, numConstraints)[source]#

Performs topology optimization using the Method of Moving Asymptotes (MMA).

Parameters:
  • fe (FiniteElement) – Finite element object.

  • rho_ini (NumpyArray) – Initial density distribution. Shape is (num_rho_vars, 1).

  • optimizationParams (dict) –

    Dictionary containing optimization parameters:

    • ’movelimit’: Move limit for design variables (float)

    • ’maxIters’: Maximum number of iterations (int)

  • objectiveHandle (callable) –

    Function that computes the objective value and its gradient. Signature: J, dJ = objectiveHandle(rho_physical)

    • rho_physical: Physical density field (filtered if enabled). Same shape as rho_ini.

    • J: Objective value (scalar).

    • dJ: Objective gradient (NumpyArray, same shape as rho_ini).

  • consHandle (callable) –

    Function that computes constraint values and their gradients. Signature: vc, dvc = consHandle(rho_physical, iter)

    • rho_physical: Physical density field (filtered if enabled). Same shape as rho_ini.

    • iter: Current optimization iteration (int).

    • vc: Constraint values. Shape is (num_constraints,).

    • dvc: Constraint gradients. Shape is (num_constraints, …), where … shares the same shape with rho_ini.

  • numConstraints (int) – Number of constraints in the optimization problem.

Returns:

rho – Optimized density distribution after completing all iterations. Same shape as rho_ini.

Return type:

NumpyArray

Notes

TODO: Scale objective function value to be always within 1-100 (ref).