Solvers

Solve compliant mechanism synthesis problems using topology optimization.

Base Solver

class topopt.mechanisms.solvers.MechanismSynthesisSolver(problem, volfrac, filter, gui, maxeval=2000, ftol=0.0001)[source]

Specialized solver for mechanism synthesis problems.

This solver is specially designed to create compliant mechanisms.

__init__(problem, volfrac, filter, gui, maxeval=2000, ftol=0.0001)[source]

Create a mechanism synthesis solver to solve the problem.

Parameters:
  • problem (topopt.problems.Problem) – The topology optimization problem to solve.
  • volfrac (float) – The maximum fraction of the volume to use.
  • filter (topopt.filters.Filter) – A filter for the solutions to reduce artefacts.
  • gui (topopt.guis.GUI) – The graphical user interface to visualize intermediate results.
  • maxeval (int) – The maximum number of evaluations to perform.
  • ftol (float) – A floating point tolerance for relative change.
objective_function(x, dobj)[source]

Compute the objective value and gradient.

Parameters:
  • x (numpy.ndarray) – The design variables for which to compute the objective.
  • dobj (numpy.ndarray) – The gradient of the objective to compute.
Returns:

The objective value.

Return type:

float

volume_function(x, dv)[source]

Compute the volume constraint value and gradient.

Parameters:
  • x (numpy.ndarray) – The design variables for which to compute the volume constraint.
  • dobj (numpy.ndarray) – The gradient of the volume constraint to compute.
Returns:

The volume constraint value.

Return type:

float

Specialized Solvers