How To: Level Set Topology Optimization (LevelOpt)

LevelOpt is a level set structural topology optimization simulation (compliance minimization) which requires the topopt.exe to run and supports different CLI arguments. The scenario JSON file has a similar format to standard LinearElastic scenario JSON files with additional "shape_exploration_data": {} information. A LevelOpt optimization performs a linear elasticity simulation and uses "type": "LinearElasticity".

Command Line Options

To see available options:

topopt --help

Output:

A command line interface for Intact.Simulation topology optimizer.
Usage:
  topopt [OPTION...]

  -h, --help                Print program usage
      --version             Print the software version
      --sample-sensitivity  Sample the sensitivity on the provided sampling
                            points
  -s, --scenario arg        Scenario json file

Workflow

To run a LevelOpt optimization:

topopt -s levelopt_scenario.json

The topopt executable will perform a linear elasticity simulation and iteratively optimize the design topology.

Scenario Setup

A LevelOpt scenario uses "type": "LinearElasticity" and includes an additional "shape_exploration_data" object with optimization parameters.

Supported Materials: Isotropic, Orthotropic

Supported Boundary Conditions: All linear elasticity boundary conditions (Fixed, Fixed Vector, Sliding, Vector Force, Torque Force, Pressure Force, Bearing Force, Hydrostatic Load, Flexible Remote Load)

Supported Internal Conditions: Body Load (Linear Acceleration/Gravity), Rotational Load

Multiple Load Cases

LevelOpt supports multiple load cases by adding a load_case_id to each boundary condition. This allows the optimizer to consider each load individually rather than the net load.

{
  "boundary_conditions": [
    {
      "boundary": "fixed.ply",
      "type": "fixed",
      "load_case_id": 0
    },
    {
      "boundary": "load1.ply",
      "type": "vector_force",
      "direction": [1.0, 0.0, 0.0],
      "magnitude": 1000.0,
      "load_case_id": 0
    },
    {
      "boundary": "load2.ply",
      "type": "vector_force",
      "direction": [0.0, 1.0, 0.0],
      "magnitude": 1000.0,
      "load_case_id": 1
    }
  ],
  "shape_exploration_data": {
    "num_load_cases": 2
  }
}

Optimization Metadata

The shape_exploration_data object contains optimization-specific parameters:

  • vol_frac_cons: (Required) Target volume of the final design as a fraction of the initial volume. For example, 0.25 means the optimized design will use 25% of the original volume.

  • level_set_cell_size: (Required) Size of the level set grid cells as a fraction of the FEA grid cell size. Default is 1.0. Smaller values provide finer control but increase computation time.

  • opt_max_iter: (Required) Maximum number of optimization iterations. Each iteration refines the design by updating the topology based on the objective function and constraints.

  • component_id: (Required for assemblies) Specifies which component ID in the components array is the design domain to be optimized. Other components remain as non-design domains.

  • move_limit: Controls the extent of changes per optimization step, as a factor of the level_set_cell_size. Default is 1.0. Lower values (e.g., 0.1-0.5) result in more gradual changes.

  • fix_thickness: Specifies the region around boundary conditions that remains unchanged, as a factor of level set grid cell size. Default is 4.0.

  • smooth_iter: Defines how frequently the geometry is smoothed during optimization, as a number of iterations. Default is 1 (smooth every iteration).

  • enable_fixed_interfaces: Allows specifying if the interface between the design domain and non-design domain should be fully preserved. true preserves the interface; false allows material to be removed at the interface.

  • num_load_cases: (Required for multiple load cases) Number of unique load cases defined by load_case_id in boundary conditions.

  • starting_design_file: (Optional) Path to a geometry file (.ply, .stl) to use as the starting design. Useful for continuing from a previous optimization. Leave empty ("") to start from the full initial geometry.

Example Scenario

Example: levelopt_scenario.json

{
  "type": "LinearElasticity",
  "scenario_name": "bracket_optimization",
  "geometry": { },
  "materials": { },
  "boundary_conditions": [ ],
  "internal_conditions": [ ],
  "metadata": {
    "cell_size": 2.5,
    "units": "MillimeterMegagramSecond",
    "basis_order": 1,
    "solver_override": "MKL_PardisoLDLT"
  },
  "shape_exploration_data": {
    "vol_frac_cons": 0.25,
    "level_set_cell_size": 0.75,
    "opt_max_iter": 20,
    "component_id": 0,
    "move_limit": 1.0,
    "fix_thickness": 4.0,
    "smooth_iter": 1,
    "starting_design_file": ""
  }
}

Key Points

  • Solver Command: Use topopt -s scenario.json instead of intact -s scenario.json.

  • Design Domain: For assemblies, specify which component is the design domain using component_id. Other components remain unchanged as non-design domains.

  • Linear Elasticity First: LevelOpt always performs a linear elasticity simulation first. The solver_override and integrator_override metadata control the solver for this initial simulation.

  • Output: The optimization produces a series of design iterations. Each iteration is a mesh file showing the evolved topology.

  • Volume Constraint: The optimizer will attempt to reach the target volume fraction (vol_frac_cons) while minimizing compliance.