# Solve a 2D L-shape topology optimization problem¶

from __future__ import annotations

from gemseo import configure_logger
from gemseo import create_scenario
from gemseo.problems.topo_opt.topopt_initialize import (
initialize_design_space_and_discipline_to,
)

configure_logger()

<RootLogger root (INFO)>


## Setup the topology optimization problem¶

Define the target volume fractio:

volume_fraction = 0.3


Define the problem type:

problem_name = "L-Shape"


Define the number of elements in the x- and y- directions:

n_x = 25
n_y = 25


Define the full material Young’s modulus and Poisson’s ratio:

e0 = 1
nu = 0.3


Define the penalty of the SIMP approach:

penalty = 3


Define the minimum member size in the solution:

min_member_size = 1.5


Instantiate the DesignSpace and the disciplines:

design_space, disciplines = initialize_design_space_and_discipline_to(
problem=problem_name,
n_x=n_x,
n_y=n_y,
e0=e0,
nu=nu,
penalty=penalty,
min_member_size=min_member_size,
vf0=volume_fraction,
)


## Solve the topology optimization problem¶

Generate an MDOScenario:

scenario = create_scenario(
disciplines,
formulation="DisciplinaryOpt",
objective_name="compliance",
design_space=design_space,
)


Add the volume fraction constraint to the scenario:

scenario.add_constraint("volume fraction", "ineq", value=volume_fraction)


Generate the XDSM

scenario.xdsmize()


Execute the scenario

scenario.execute({"max_iter": 200, "algo": "NLOPT_MMA"})

    INFO - 10:56:17:
INFO - 10:56:17: *** Start MDOScenario execution ***
INFO - 10:56:17: MDOScenario
INFO - 10:56:17:    Disciplines: DensityFilter FininiteElementAnalysis MaterialModelInterpolation VolumeFraction
INFO - 10:56:17:    MDO formulation: DisciplinaryOpt
INFO - 10:56:17: Optimization problem:
INFO - 10:56:17:    minimize compliance(x)
INFO - 10:56:17:    with respect to x
INFO - 10:56:17:    subject to constraints:
INFO - 10:56:17:       volume fraction(x) <= 0.3
INFO - 10:56:17:      1%|          | 2/200 [00:00<00:08, 24.13 it/sec, obj=2.23e+3]
INFO - 10:56:17:      2%|▏         | 3/200 [00:00<00:07, 27.74 it/sec, obj=1.96e+3]
INFO - 10:56:17:      2%|▏         | 4/200 [00:00<00:06, 30.06 it/sec, obj=1.75e+3]
INFO - 10:56:17:      2%|▎         | 5/200 [00:00<00:06, 31.56 it/sec, obj=1.57e+3]
INFO - 10:56:17:      3%|▎         | 6/200 [00:00<00:05, 32.62 it/sec, obj=1.2e+3]
INFO - 10:56:17:      4%|▎         | 7/200 [00:00<00:05, 33.15 it/sec, obj=963]
INFO - 10:56:18:      4%|▍         | 8/200 [00:00<00:05, 33.75 it/sec, obj=624]
INFO - 10:56:18:      4%|▍         | 9/200 [00:00<00:05, 34.29 it/sec, obj=497]
INFO - 10:56:18:      5%|▌         | 10/200 [00:00<00:05, 34.72 it/sec, obj=395]
INFO - 10:56:18:      6%|▌         | 11/200 [00:00<00:05, 35.13 it/sec, obj=306]
INFO - 10:56:18:      6%|▌         | 12/200 [00:00<00:05, 35.49 it/sec, obj=251]
INFO - 10:56:18:      6%|▋         | 13/200 [00:00<00:05, 35.79 it/sec, obj=225]
INFO - 10:56:18:      7%|▋         | 14/200 [00:00<00:05, 36.08 it/sec, obj=209]
INFO - 10:56:18:      8%|▊         | 15/200 [00:00<00:05, 36.35 it/sec, obj=201]
INFO - 10:56:18:      8%|▊         | 16/200 [00:00<00:05, 36.54 it/sec, obj=195]
INFO - 10:56:18:      8%|▊         | 17/200 [00:00<00:04, 36.74 it/sec, obj=190]
INFO - 10:56:18:      9%|▉         | 18/200 [00:00<00:04, 36.93 it/sec, obj=186]
INFO - 10:56:18:     10%|▉         | 19/200 [00:00<00:04, 37.11 it/sec, obj=182]
INFO - 10:56:18:     10%|█         | 20/200 [00:00<00:04, 37.28 it/sec, obj=178]
INFO - 10:56:18:     10%|█         | 21/200 [00:00<00:04, 37.42 it/sec, obj=174]
INFO - 10:56:18:     11%|█         | 22/200 [00:00<00:04, 37.56 it/sec, obj=169]
INFO - 10:56:18:     12%|█▏        | 23/200 [00:00<00:04, 37.70 it/sec, obj=164]
INFO - 10:56:18:     12%|█▏        | 24/200 [00:00<00:04, 37.87 it/sec, obj=161]
INFO - 10:56:18:     12%|█▎        | 25/200 [00:00<00:04, 37.98 it/sec, obj=159]
INFO - 10:56:18:     13%|█▎        | 26/200 [00:00<00:04, 38.12 it/sec, obj=157]
INFO - 10:56:18:     14%|█▎        | 27/200 [00:00<00:04, 38.24 it/sec, obj=156]
INFO - 10:56:18:     14%|█▍        | 28/200 [00:00<00:04, 38.37 it/sec, obj=155]
INFO - 10:56:18:     14%|█▍        | 29/200 [00:00<00:04, 38.48 it/sec, obj=154]
INFO - 10:56:18:     15%|█▌        | 30/200 [00:00<00:04, 38.56 it/sec, obj=154]
INFO - 10:56:18:     16%|█▌        | 31/200 [00:00<00:04, 38.64 it/sec, obj=153]
INFO - 10:56:18:     16%|█▌        | 32/200 [00:00<00:04, 38.66 it/sec, obj=153]
INFO - 10:56:18:     16%|█▋        | 33/200 [00:00<00:04, 38.74 it/sec, obj=152]
INFO - 10:56:18:     17%|█▋        | 34/200 [00:00<00:04, 38.84 it/sec, obj=152]
INFO - 10:56:18:     18%|█▊        | 35/200 [00:00<00:04, 38.94 it/sec, obj=152]
INFO - 10:56:18:     18%|█▊        | 36/200 [00:00<00:04, 39.03 it/sec, obj=152]
INFO - 10:56:18:     18%|█▊        | 37/200 [00:00<00:04, 39.13 it/sec, obj=152]
INFO - 10:56:18:     19%|█▉        | 38/200 [00:00<00:04, 39.22 it/sec, obj=152]
INFO - 10:56:18:     20%|█▉        | 39/200 [00:00<00:04, 39.30 it/sec, obj=152]
INFO - 10:56:18:     20%|██        | 40/200 [00:01<00:04, 39.35 it/sec, obj=152]
INFO - 10:56:18:     20%|██        | 41/200 [00:01<00:04, 39.38 it/sec, obj=152]
INFO - 10:56:18:     21%|██        | 42/200 [00:01<00:04, 39.45 it/sec, obj=152]
INFO - 10:56:18:     22%|██▏       | 43/200 [00:01<00:03, 39.50 it/sec, obj=152]
INFO - 10:56:18:     22%|██▏       | 44/200 [00:01<00:03, 39.56 it/sec, obj=152]
INFO - 10:56:18:     22%|██▎       | 45/200 [00:01<00:03, 39.63 it/sec, obj=152]
INFO - 10:56:18:     23%|██▎       | 46/200 [00:01<00:03, 39.67 it/sec, obj=152]
INFO - 10:56:18:     24%|██▎       | 47/200 [00:01<00:03, 39.72 it/sec, obj=152]
INFO - 10:56:18:     24%|██▍       | 48/200 [00:01<00:03, 39.80 it/sec, obj=152]
INFO - 10:56:19:     24%|██▍       | 49/200 [00:01<00:03, 39.87 it/sec, obj=152]
INFO - 10:56:19:     25%|██▌       | 50/200 [00:01<00:03, 39.92 it/sec, obj=152]
INFO - 10:56:19:     26%|██▌       | 51/200 [00:01<00:03, 39.97 it/sec, obj=152]
INFO - 10:56:19:     26%|██▌       | 52/200 [00:01<00:03, 40.03 it/sec, obj=152]
INFO - 10:56:19:     26%|██▋       | 53/200 [00:01<00:03, 40.09 it/sec, obj=152]
INFO - 10:56:19:     27%|██▋       | 54/200 [00:01<00:03, 40.14 it/sec, obj=152]
INFO - 10:56:19:     28%|██▊       | 55/200 [00:01<00:03, 40.18 it/sec, obj=152]
INFO - 10:56:19:     28%|██▊       | 56/200 [00:01<00:03, 40.23 it/sec, obj=152]
INFO - 10:56:19:     28%|██▊       | 57/200 [00:01<00:03, 40.23 it/sec, obj=152]
INFO - 10:56:19:     29%|██▉       | 58/200 [00:01<00:03, 40.25 it/sec, obj=152]
INFO - 10:56:19:     30%|██▉       | 59/200 [00:01<00:03, 40.26 it/sec, obj=152]
INFO - 10:56:19:     30%|███       | 60/200 [00:01<00:03, 40.28 it/sec, obj=152]
INFO - 10:56:19:     30%|███       | 61/200 [00:01<00:03, 40.26 it/sec, obj=152]
INFO - 10:56:19:     31%|███       | 62/200 [00:01<00:03, 40.27 it/sec, obj=152]
INFO - 10:56:19:     32%|███▏      | 63/200 [00:01<00:03, 40.30 it/sec, obj=152]
INFO - 10:56:19:     32%|███▏      | 64/200 [00:01<00:03, 40.34 it/sec, obj=152]
INFO - 10:56:19:     32%|███▎      | 65/200 [00:01<00:03, 40.37 it/sec, obj=152]
INFO - 10:56:19:     33%|███▎      | 66/200 [00:01<00:03, 40.39 it/sec, obj=152]
INFO - 10:56:19:     34%|███▎      | 67/200 [00:01<00:03, 40.43 it/sec, obj=152]
INFO - 10:56:19:     34%|███▍      | 68/200 [00:01<00:03, 40.45 it/sec, obj=152]
INFO - 10:56:19:     34%|███▍      | 69/200 [00:01<00:03, 40.47 it/sec, obj=152]
INFO - 10:56:19:     35%|███▌      | 70/200 [00:01<00:03, 40.49 it/sec, obj=152]
INFO - 10:56:19:     36%|███▌      | 71/200 [00:01<00:03, 40.51 it/sec, obj=152]
INFO - 10:56:19:     36%|███▌      | 72/200 [00:01<00:03, 40.51 it/sec, obj=152]
INFO - 10:56:19:     36%|███▋      | 73/200 [00:01<00:03, 40.54 it/sec, obj=152]
INFO - 10:56:19:     37%|███▋      | 74/200 [00:01<00:03, 40.56 it/sec, obj=152]
INFO - 10:56:19:     38%|███▊      | 75/200 [00:01<00:03, 40.61 it/sec, obj=152]
INFO - 10:56:19:     38%|███▊      | 76/200 [00:01<00:03, 40.64 it/sec, obj=152]
INFO - 10:56:19:     38%|███▊      | 77/200 [00:01<00:03, 40.68 it/sec, obj=152]
INFO - 10:56:19:     39%|███▉      | 78/200 [00:01<00:02, 40.70 it/sec, obj=152]
INFO - 10:56:19:     40%|███▉      | 79/200 [00:01<00:02, 40.74 it/sec, obj=152]
INFO - 10:56:19:     40%|████      | 80/200 [00:01<00:02, 40.76 it/sec, obj=152]
INFO - 10:56:19:     40%|████      | 81/200 [00:01<00:02, 40.80 it/sec, obj=152]
INFO - 10:56:19:     41%|████      | 82/200 [00:02<00:02, 40.84 it/sec, obj=152]
INFO - 10:56:19:     42%|████▏     | 83/200 [00:02<00:02, 40.86 it/sec, obj=152]
INFO - 10:56:19:     42%|████▏     | 84/200 [00:02<00:02, 40.88 it/sec, obj=152]
INFO - 10:56:19:     42%|████▎     | 85/200 [00:02<00:02, 40.92 it/sec, obj=152]
INFO - 10:56:19:     43%|████▎     | 86/200 [00:02<00:02, 40.94 it/sec, obj=152]
INFO - 10:56:19:     44%|████▎     | 87/200 [00:02<00:02, 40.97 it/sec, obj=152]
INFO - 10:56:19:     44%|████▍     | 88/200 [00:02<00:02, 41.00 it/sec, obj=152]
INFO - 10:56:19:     44%|████▍     | 89/200 [00:02<00:02, 41.03 it/sec, obj=152]
INFO - 10:56:19:     45%|████▌     | 90/200 [00:02<00:02, 41.04 it/sec, obj=152]
INFO - 10:56:20:     46%|████▌     | 91/200 [00:02<00:02, 41.05 it/sec, obj=152]
INFO - 10:56:20:     46%|████▌     | 92/200 [00:02<00:02, 41.06 it/sec, obj=152]
INFO - 10:56:20:     46%|████▋     | 93/200 [00:02<00:02, 41.09 it/sec, obj=152]
INFO - 10:56:20:     47%|████▋     | 94/200 [00:02<00:02, 41.12 it/sec, obj=152]
INFO - 10:56:20:     48%|████▊     | 95/200 [00:02<00:02, 41.16 it/sec, obj=152]
INFO - 10:56:20:     48%|████▊     | 96/200 [00:02<00:02, 41.19 it/sec, obj=152]
INFO - 10:56:20:     48%|████▊     | 97/200 [00:02<00:02, 41.22 it/sec, obj=152]
INFO - 10:56:20:     49%|████▉     | 98/200 [00:02<00:02, 41.24 it/sec, obj=152]
INFO - 10:56:20:     50%|████▉     | 99/200 [00:02<00:02, 41.26 it/sec, obj=152]
INFO - 10:56:20:     50%|█████     | 100/200 [00:02<00:02, 41.29 it/sec, obj=152]
INFO - 10:56:20:     50%|█████     | 101/200 [00:02<00:02, 41.30 it/sec, obj=152]
INFO - 10:56:20:     51%|█████     | 102/200 [00:02<00:02, 41.32 it/sec, obj=152]
INFO - 10:56:20:     52%|█████▏    | 103/200 [00:02<00:02, 41.34 it/sec, obj=152]
INFO - 10:56:20:     52%|█████▏    | 104/200 [00:02<00:02, 41.36 it/sec, obj=152]
INFO - 10:56:20:     52%|█████▎    | 105/200 [00:02<00:02, 41.36 it/sec, obj=152]
INFO - 10:56:20:     53%|█████▎    | 106/200 [00:02<00:02, 41.38 it/sec, obj=152]
INFO - 10:56:20:     54%|█████▎    | 107/200 [00:02<00:02, 41.40 it/sec, obj=152]
INFO - 10:56:20:     54%|█████▍    | 108/200 [00:02<00:02, 41.41 it/sec, obj=152]
INFO - 10:56:20:     55%|█████▍    | 109/200 [00:02<00:02, 41.43 it/sec, obj=152]
INFO - 10:56:20:     55%|█████▌    | 110/200 [00:02<00:02, 41.44 it/sec, obj=152]
INFO - 10:56:20:     56%|█████▌    | 111/200 [00:02<00:02, 41.46 it/sec, obj=152]
INFO - 10:56:20:     56%|█████▌    | 112/200 [00:02<00:02, 41.48 it/sec, obj=152]
INFO - 10:56:20:     56%|█████▋    | 113/200 [00:02<00:02, 41.48 it/sec, obj=152]
INFO - 10:56:20:     57%|█████▋    | 114/200 [00:02<00:02, 41.50 it/sec, obj=152]
INFO - 10:56:20:     57%|█████▊    | 115/200 [00:02<00:02, 41.52 it/sec, obj=152]
INFO - 10:56:20:     58%|█████▊    | 116/200 [00:02<00:02, 41.54 it/sec, obj=152]
INFO - 10:56:20:     58%|█████▊    | 117/200 [00:02<00:01, 41.54 it/sec, obj=152]
INFO - 10:56:20:     59%|█████▉    | 118/200 [00:02<00:01, 41.55 it/sec, obj=152]
INFO - 10:56:20:     60%|█████▉    | 119/200 [00:02<00:01, 41.57 it/sec, obj=152]
INFO - 10:56:20:     60%|██████    | 120/200 [00:02<00:01, 41.59 it/sec, obj=152]
INFO - 10:56:20:     60%|██████    | 121/200 [00:02<00:01, 41.62 it/sec, obj=152]
INFO - 10:56:20:     61%|██████    | 122/200 [00:02<00:01, 41.64 it/sec, obj=152]
INFO - 10:56:20:     62%|██████▏   | 123/200 [00:02<00:01, 41.66 it/sec, obj=152]
INFO - 10:56:20:     62%|██████▏   | 124/200 [00:02<00:01, 41.68 it/sec, obj=152]
INFO - 10:56:20:     62%|██████▎   | 125/200 [00:02<00:01, 41.69 it/sec, obj=152]
INFO - 10:56:20:     63%|██████▎   | 126/200 [00:03<00:01, 41.70 it/sec, obj=152]
INFO - 10:56:20:     64%|██████▎   | 127/200 [00:03<00:01, 41.72 it/sec, obj=152]
INFO - 10:56:20:     64%|██████▍   | 128/200 [00:03<00:01, 41.74 it/sec, obj=152]
INFO - 10:56:20:     64%|██████▍   | 129/200 [00:03<00:01, 41.76 it/sec, obj=152]
INFO - 10:56:20:     65%|██████▌   | 130/200 [00:03<00:01, 41.78 it/sec, obj=152]
INFO - 10:56:20:     66%|██████▌   | 131/200 [00:03<00:01, 41.80 it/sec, obj=152]
INFO - 10:56:20:     66%|██████▌   | 132/200 [00:03<00:01, 41.81 it/sec, obj=152]
INFO - 10:56:20:     66%|██████▋   | 133/200 [00:03<00:01, 41.81 it/sec, obj=152]
INFO - 10:56:20:     67%|██████▋   | 134/200 [00:03<00:01, 41.82 it/sec, obj=152]
INFO - 10:56:21:     68%|██████▊   | 135/200 [00:03<00:01, 41.83 it/sec, obj=152]
INFO - 10:56:21:     68%|██████▊   | 136/200 [00:03<00:01, 41.84 it/sec, obj=152]
INFO - 10:56:21:     68%|██████▊   | 137/200 [00:03<00:01, 41.85 it/sec, obj=152]
INFO - 10:56:21:     69%|██████▉   | 138/200 [00:03<00:01, 41.87 it/sec, obj=152]
INFO - 10:56:21:     70%|██████▉   | 139/200 [00:03<00:01, 41.88 it/sec, obj=152]
INFO - 10:56:21:     70%|███████   | 140/200 [00:03<00:01, 41.90 it/sec, obj=152]
INFO - 10:56:21:     70%|███████   | 141/200 [00:03<00:01, 41.91 it/sec, obj=152]
INFO - 10:56:21:     71%|███████   | 142/200 [00:03<00:01, 41.93 it/sec, obj=152]
INFO - 10:56:21:     72%|███████▏  | 143/200 [00:03<00:01, 41.93 it/sec, obj=152]
INFO - 10:56:21:     72%|███████▏  | 144/200 [00:03<00:01, 41.93 it/sec, obj=152]
INFO - 10:56:21:     72%|███████▎  | 145/200 [00:03<00:01, 41.93 it/sec, obj=152]
INFO - 10:56:21:     73%|███████▎  | 146/200 [00:03<00:01, 41.93 it/sec, obj=152]
INFO - 10:56:21:     74%|███████▎  | 147/200 [00:03<00:01, 41.93 it/sec, obj=152]
INFO - 10:56:21:     74%|███████▍  | 148/200 [00:03<00:01, 41.93 it/sec, obj=152]
INFO - 10:56:21:     74%|███████▍  | 149/200 [00:03<00:01, 41.95 it/sec, obj=152]
INFO - 10:56:21:     75%|███████▌  | 150/200 [00:03<00:01, 41.97 it/sec, obj=152]
INFO - 10:56:21:     76%|███████▌  | 151/200 [00:03<00:01, 41.98 it/sec, obj=152]
INFO - 10:56:21:     76%|███████▌  | 152/200 [00:03<00:01, 42.00 it/sec, obj=152]
INFO - 10:56:21:     76%|███████▋  | 153/200 [00:03<00:01, 42.02 it/sec, obj=152]
INFO - 10:56:21:     77%|███████▋  | 154/200 [00:03<00:01, 42.04 it/sec, obj=152]
INFO - 10:56:21:     78%|███████▊  | 155/200 [00:03<00:01, 42.06 it/sec, obj=152]
INFO - 10:56:21:     78%|███████▊  | 156/200 [00:03<00:01, 42.09 it/sec, obj=152]
INFO - 10:56:21:     78%|███████▊  | 157/200 [00:03<00:01, 42.10 it/sec, obj=152]
INFO - 10:56:21:     79%|███████▉  | 158/200 [00:03<00:00, 42.11 it/sec, obj=152]
INFO - 10:56:21:     80%|███████▉  | 159/200 [00:03<00:00, 42.12 it/sec, obj=152]
INFO - 10:56:21:     80%|████████  | 160/200 [00:03<00:00, 42.13 it/sec, obj=152]
INFO - 10:56:21:     80%|████████  | 161/200 [00:03<00:00, 42.15 it/sec, obj=152]
INFO - 10:56:21:     81%|████████  | 162/200 [00:03<00:00, 42.16 it/sec, obj=152]
INFO - 10:56:21:     82%|████████▏ | 163/200 [00:03<00:00, 42.17 it/sec, obj=152]
INFO - 10:56:21:     82%|████████▏ | 164/200 [00:03<00:00, 42.18 it/sec, obj=152]
INFO - 10:56:21:     82%|████████▎ | 165/200 [00:03<00:00, 42.20 it/sec, obj=152]
INFO - 10:56:21:     83%|████████▎ | 166/200 [00:03<00:00, 42.21 it/sec, obj=152]
INFO - 10:56:21:     84%|████████▎ | 167/200 [00:03<00:00, 42.22 it/sec, obj=152]
INFO - 10:56:21:     84%|████████▍ | 168/200 [00:03<00:00, 42.23 it/sec, obj=152]
INFO - 10:56:21:     84%|████████▍ | 169/200 [00:04<00:00, 42.24 it/sec, obj=152]
INFO - 10:56:21:     85%|████████▌ | 170/200 [00:04<00:00, 42.25 it/sec, obj=152]
INFO - 10:56:21:     86%|████████▌ | 171/200 [00:04<00:00, 42.26 it/sec, obj=152]
INFO - 10:56:21:     86%|████████▌ | 172/200 [00:04<00:00, 42.27 it/sec, obj=152]
INFO - 10:56:21:     86%|████████▋ | 173/200 [00:04<00:00, 42.28 it/sec, obj=152]
INFO - 10:56:21:     87%|████████▋ | 174/200 [00:04<00:00, 42.29 it/sec, obj=152]
INFO - 10:56:21:     88%|████████▊ | 175/200 [00:04<00:00, 42.30 it/sec, obj=152]
INFO - 10:56:21:     88%|████████▊ | 176/200 [00:04<00:00, 42.31 it/sec, obj=152]
INFO - 10:56:21:     88%|████████▊ | 177/200 [00:04<00:00, 42.32 it/sec, obj=152]
INFO - 10:56:21:     89%|████████▉ | 178/200 [00:04<00:00, 42.33 it/sec, obj=152]
INFO - 10:56:22:     90%|████████▉ | 179/200 [00:04<00:00, 42.33 it/sec, obj=152]
INFO - 10:56:22:     90%|█████████ | 180/200 [00:04<00:00, 42.34 it/sec, obj=152]
INFO - 10:56:22:     90%|█████████ | 181/200 [00:04<00:00, 42.35 it/sec, obj=152]
INFO - 10:56:22:     91%|█████████ | 182/200 [00:04<00:00, 42.36 it/sec, obj=152]
INFO - 10:56:22:     92%|█████████▏| 183/200 [00:04<00:00, 42.38 it/sec, obj=152]
INFO - 10:56:22:     92%|█████████▏| 184/200 [00:04<00:00, 42.39 it/sec, obj=152]
INFO - 10:56:22:     92%|█████████▎| 185/200 [00:04<00:00, 42.41 it/sec, obj=152]
INFO - 10:56:22:     93%|█████████▎| 186/200 [00:04<00:00, 42.42 it/sec, obj=152]
INFO - 10:56:22:     94%|█████████▎| 187/200 [00:04<00:00, 42.43 it/sec, obj=152]
INFO - 10:56:22:     94%|█████████▍| 188/200 [00:04<00:00, 42.45 it/sec, obj=152]
INFO - 10:56:22:     94%|█████████▍| 189/200 [00:04<00:00, 42.46 it/sec, obj=152]
INFO - 10:56:22:     95%|█████████▌| 190/200 [00:04<00:00, 42.47 it/sec, obj=152]
INFO - 10:56:22:     96%|█████████▌| 191/200 [00:04<00:00, 42.48 it/sec, obj=152]
INFO - 10:56:22:     96%|█████████▌| 192/200 [00:04<00:00, 42.50 it/sec, obj=152]
INFO - 10:56:22:     96%|█████████▋| 193/200 [00:04<00:00, 42.51 it/sec, obj=152]
INFO - 10:56:22:     97%|█████████▋| 194/200 [00:04<00:00, 42.52 it/sec, obj=152]
INFO - 10:56:22:     98%|█████████▊| 195/200 [00:04<00:00, 42.52 it/sec, obj=152]
INFO - 10:56:22:     98%|█████████▊| 196/200 [00:04<00:00, 42.53 it/sec, obj=152]
INFO - 10:56:22:     98%|█████████▊| 197/200 [00:04<00:00, 42.54 it/sec, obj=152]
INFO - 10:56:22:     99%|█████████▉| 198/200 [00:04<00:00, 42.55 it/sec, obj=152]
INFO - 10:56:22:    100%|█████████▉| 199/200 [00:04<00:00, 42.56 it/sec, obj=152]
INFO - 10:56:22:    100%|██████████| 200/200 [00:04<00:00, 42.70 it/sec, obj=152]
INFO - 10:56:22: Optimization result:
INFO - 10:56:22:    Optimizer info:
INFO - 10:56:22:       Status: None
INFO - 10:56:22:       Message: Maximum number of iterations reached. GEMSEO Stopped the driver
INFO - 10:56:22:       Number of calls to the objective function by the optimizer: 201
INFO - 10:56:22:    Solution:
INFO - 10:56:22:       The solution is feasible.
INFO - 10:56:22:       Objective: 151.6287318635838
INFO - 10:56:22:       Standardized constraints:
INFO - 10:56:22:          [volume fraction-0.3] = 1.0976701955156543e-06
INFO - 10:56:22: *** End MDOScenario execution (time: 0:00:04.700476) ***

{'max_iter': 200, 'algo': 'NLOPT_MMA'}


## Results¶

Post-process the optimization history:

scenario.post_process(
"BasicHistory", variable_names=["compliance"], show=True, save=False
)

<gemseo.post.basic_history.BasicHistory object at 0x7efd29b0adf0>


Plot the solution

scenario.post_process("TopologyView", n_x=n_x, n_y=n_y, show=True, save=False)

<gemseo.post.topology_view.TopologyView object at 0x7efd29c32670>


Total running time of the script: (0 minutes 4.988 seconds)

Gallery generated by Sphinx-Gallery