# Solve a 2D MBB 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 fraction:

volume_fraction = 0.3


Define the problem type:

problem_name = "MBB"


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

n_x = 50
n_y = 25


Define the full material Young’s modulus and the 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(input_data={"max_iter": 200, "algo": "NLOPT_MMA"})

    INFO - 08:26:23:
INFO - 08:26:23: *** Start MDOScenario execution ***
INFO - 08:26:23: MDOScenario
INFO - 08:26:23:    Disciplines: DensityFilter FininiteElementAnalysis MaterialModelInterpolation VolumeFraction
INFO - 08:26:23:    MDO formulation: DisciplinaryOpt
INFO - 08:26:23: Optimization problem:
INFO - 08:26:23:    minimize compliance(x)
INFO - 08:26:23:    with respect to x
INFO - 08:26:23:    subject to constraints:
INFO - 08:26:23:       volume fraction(x) <= 0.3
INFO - 08:26:23: ...   0%|          | 0/200 [00:00<?, ?it]
INFO - 08:26:23: ...   0%|          | 1/200 [00:00<00:08, 23.44 it/sec, obj=1.79e+3]
INFO - 08:26:23: ...   1%|          | 2/200 [00:00<00:26,  7.60 it/sec, obj=1.79e+3]
INFO - 08:26:23: ...   2%|▏         | 3/200 [00:00<00:23,  8.31 it/sec, obj=1.78e+3]
INFO - 08:26:23: ...   2%|▏         | 4/200 [00:00<00:21,  8.94 it/sec, obj=1.77e+3]
INFO - 08:26:23: ...   2%|▎         | 5/200 [00:00<00:20,  9.35 it/sec, obj=1.75e+3]
INFO - 08:26:23: ...   3%|▎         | 6/200 [00:00<00:20,  9.61 it/sec, obj=1.71e+3]
INFO - 08:26:23: ...   4%|▎         | 7/200 [00:00<00:19,  9.86 it/sec, obj=1.65e+3]
INFO - 08:26:24: ...   4%|▍         | 8/200 [00:00<00:19, 10.03 it/sec, obj=1.41e+3]
INFO - 08:26:24: ...   4%|▍         | 9/200 [00:00<00:18, 10.20 it/sec, obj=1.19e+3]
INFO - 08:26:24: ...   5%|▌         | 10/200 [00:00<00:18, 10.33 it/sec, obj=903]
INFO - 08:26:24: ...   6%|▌         | 11/200 [00:01<00:18, 10.44 it/sec, obj=724]
INFO - 08:26:24: ...   6%|▌         | 12/200 [00:01<00:17, 10.54 it/sec, obj=612]
INFO - 08:26:24: ...   6%|▋         | 13/200 [00:01<00:17, 10.62 it/sec, obj=534]
INFO - 08:26:24: ...   7%|▋         | 14/200 [00:01<00:17, 10.68 it/sec, obj=474]
INFO - 08:26:24: ...   8%|▊         | 15/200 [00:01<00:17, 10.76 it/sec, obj=444]
INFO - 08:26:24: ...   8%|▊         | 16/200 [00:01<00:17, 10.82 it/sec, obj=419]
INFO - 08:26:24: ...   8%|▊         | 17/200 [00:01<00:16, 10.89 it/sec, obj=405]
INFO - 08:26:24: ...   9%|▉         | 18/200 [00:01<00:16, 10.93 it/sec, obj=387]
INFO - 08:26:24: ...  10%|▉         | 19/200 [00:01<00:16, 10.98 it/sec, obj=364]
INFO - 08:26:25: ...  10%|█         | 20/200 [00:01<00:16, 11.01 it/sec, obj=338]
INFO - 08:26:25: ...  10%|█         | 21/200 [00:01<00:16, 11.05 it/sec, obj=306]
INFO - 08:26:25: ...  11%|█         | 22/200 [00:01<00:16, 11.08 it/sec, obj=272]
INFO - 08:26:25: ...  12%|█▏        | 23/200 [00:02<00:15, 11.12 it/sec, obj=253]
INFO - 08:26:25: ...  12%|█▏        | 24/200 [00:02<00:15, 11.14 it/sec, obj=244]
INFO - 08:26:25: ...  12%|█▎        | 25/200 [00:02<00:15, 11.18 it/sec, obj=234]
INFO - 08:26:25: ...  13%|█▎        | 26/200 [00:02<00:15, 11.20 it/sec, obj=224]
INFO - 08:26:25: ...  14%|█▎        | 27/200 [00:02<00:15, 11.23 it/sec, obj=213]
INFO - 08:26:25: ...  14%|█▍        | 28/200 [00:02<00:15, 11.27 it/sec, obj=207]
INFO - 08:26:25: ...  14%|█▍        | 29/200 [00:02<00:15, 11.30 it/sec, obj=202]
INFO - 08:26:25: ...  15%|█▌        | 30/200 [00:02<00:15, 11.32 it/sec, obj=197]
INFO - 08:26:25: ...  16%|█▌        | 31/200 [00:02<00:14, 11.35 it/sec, obj=193]
INFO - 08:26:26: ...  16%|█▌        | 32/200 [00:02<00:14, 11.37 it/sec, obj=190]
INFO - 08:26:26: ...  16%|█▋        | 33/200 [00:02<00:14, 11.40 it/sec, obj=188]
INFO - 08:26:26: ...  17%|█▋        | 34/200 [00:02<00:14, 11.42 it/sec, obj=186]
INFO - 08:26:26: ...  18%|█▊        | 35/200 [00:03<00:14, 11.44 it/sec, obj=185]
INFO - 08:26:26: ...  18%|█▊        | 36/200 [00:03<00:14, 11.46 it/sec, obj=184]
INFO - 08:26:26: ...  18%|█▊        | 37/200 [00:03<00:14, 11.48 it/sec, obj=183]
INFO - 08:26:26: ...  19%|█▉        | 38/200 [00:03<00:14, 11.50 it/sec, obj=182]
INFO - 08:26:26: ...  20%|█▉        | 39/200 [00:03<00:13, 11.52 it/sec, obj=181]
INFO - 08:26:26: ...  20%|██        | 40/200 [00:03<00:13, 11.53 it/sec, obj=179]
INFO - 08:26:26: ...  20%|██        | 41/200 [00:03<00:13, 11.55 it/sec, obj=177]
INFO - 08:26:26: ...  21%|██        | 42/200 [00:03<00:13, 11.56 it/sec, obj=175]
INFO - 08:26:26: ...  22%|██▏       | 43/200 [00:03<00:13, 11.58 it/sec, obj=174]
INFO - 08:26:26: ...  22%|██▏       | 44/200 [00:03<00:13, 11.59 it/sec, obj=173]
INFO - 08:26:27: ...  22%|██▎       | 45/200 [00:03<00:13, 11.60 it/sec, obj=172]
INFO - 08:26:27: ...  23%|██▎       | 46/200 [00:03<00:13, 11.62 it/sec, obj=172]
INFO - 08:26:27: ...  24%|██▎       | 47/200 [00:04<00:13, 11.63 it/sec, obj=172]
INFO - 08:26:27: ...  24%|██▍       | 48/200 [00:04<00:13, 11.64 it/sec, obj=172]
INFO - 08:26:27: ...  24%|██▍       | 49/200 [00:04<00:12, 11.66 it/sec, obj=172]
INFO - 08:26:27: ...  25%|██▌       | 50/200 [00:04<00:12, 11.67 it/sec, obj=172]
INFO - 08:26:27: ...  26%|██▌       | 51/200 [00:04<00:12, 11.68 it/sec, obj=172]
INFO - 08:26:27: ...  26%|██▌       | 52/200 [00:04<00:12, 11.69 it/sec, obj=172]
INFO - 08:26:27: ...  26%|██▋       | 53/200 [00:04<00:12, 11.70 it/sec, obj=172]
INFO - 08:26:27: ...  27%|██▋       | 54/200 [00:04<00:12, 11.71 it/sec, obj=172]
INFO - 08:26:27: ...  28%|██▊       | 55/200 [00:04<00:12, 11.72 it/sec, obj=172]
INFO - 08:26:27: ...  28%|██▊       | 56/200 [00:04<00:12, 11.73 it/sec, obj=172]
INFO - 08:26:28: ...  28%|██▊       | 57/200 [00:04<00:12, 11.75 it/sec, obj=172]
INFO - 08:26:28: ...  29%|██▉       | 58/200 [00:04<00:12, 11.76 it/sec, obj=171]
INFO - 08:26:28: ...  30%|██▉       | 59/200 [00:05<00:11, 11.77 it/sec, obj=171]
INFO - 08:26:28: ...  30%|███       | 60/200 [00:05<00:11, 11.78 it/sec, obj=171]
INFO - 08:26:28: ...  30%|███       | 61/200 [00:05<00:11, 11.79 it/sec, obj=171]
INFO - 08:26:28: ...  31%|███       | 62/200 [00:05<00:11, 11.80 it/sec, obj=171]
INFO - 08:26:28: ...  32%|███▏      | 63/200 [00:05<00:11, 11.81 it/sec, obj=171]
INFO - 08:26:28: ...  32%|███▏      | 64/200 [00:05<00:11, 11.82 it/sec, obj=171]
INFO - 08:26:28: ...  32%|███▎      | 65/200 [00:05<00:11, 11.83 it/sec, obj=171]
INFO - 08:26:28: ...  33%|███▎      | 66/200 [00:05<00:11, 11.84 it/sec, obj=171]
INFO - 08:26:28: ...  34%|███▎      | 67/200 [00:05<00:11, 11.85 it/sec, obj=171]
INFO - 08:26:28: ...  34%|███▍      | 68/200 [00:05<00:11, 11.85 it/sec, obj=171]
INFO - 08:26:29: ...  34%|███▍      | 69/200 [00:05<00:11, 11.86 it/sec, obj=171]
INFO - 08:26:29: ...  35%|███▌      | 70/200 [00:05<00:10, 11.87 it/sec, obj=171]
INFO - 08:26:29: ...  36%|███▌      | 71/200 [00:05<00:10, 11.88 it/sec, obj=171]
INFO - 08:26:29: ...  36%|███▌      | 72/200 [00:06<00:10, 11.88 it/sec, obj=171]
INFO - 08:26:29: ...  36%|███▋      | 73/200 [00:06<00:10, 11.89 it/sec, obj=171]
INFO - 08:26:29: ...  37%|███▋      | 74/200 [00:06<00:10, 11.90 it/sec, obj=171]
INFO - 08:26:29: ...  38%|███▊      | 75/200 [00:06<00:10, 11.91 it/sec, obj=171]
INFO - 08:26:29: ...  38%|███▊      | 76/200 [00:06<00:10, 11.91 it/sec, obj=171]
INFO - 08:26:29: ...  38%|███▊      | 77/200 [00:06<00:10, 11.92 it/sec, obj=171]
INFO - 08:26:29: ...  39%|███▉      | 78/200 [00:06<00:10, 11.92 it/sec, obj=171]
INFO - 08:26:29: ...  40%|███▉      | 79/200 [00:06<00:10, 11.94 it/sec, obj=171]
INFO - 08:26:29: ...  40%|████      | 80/200 [00:06<00:10, 11.94 it/sec, obj=171]
INFO - 08:26:29: ...  40%|████      | 81/200 [00:06<00:09, 11.95 it/sec, obj=171]
INFO - 08:26:30: ...  41%|████      | 82/200 [00:06<00:09, 11.95 it/sec, obj=171]
INFO - 08:26:30: ...  42%|████▏     | 83/200 [00:06<00:09, 11.96 it/sec, obj=171]
INFO - 08:26:30: ...  42%|████▏     | 84/200 [00:07<00:09, 11.96 it/sec, obj=171]
INFO - 08:26:30: ...  42%|████▎     | 85/200 [00:07<00:09, 11.97 it/sec, obj=171]
INFO - 08:26:30: ...  43%|████▎     | 86/200 [00:07<00:09, 11.97 it/sec, obj=171]
INFO - 08:26:30: ...  44%|████▎     | 87/200 [00:07<00:09, 11.98 it/sec, obj=171]
INFO - 08:26:30: ...  44%|████▍     | 88/200 [00:07<00:09, 11.98 it/sec, obj=171]
INFO - 08:26:30: ...  44%|████▍     | 89/200 [00:07<00:09, 11.99 it/sec, obj=171]
INFO - 08:26:30: ...  45%|████▌     | 90/200 [00:07<00:09, 11.99 it/sec, obj=171]
INFO - 08:26:30: ...  46%|████▌     | 91/200 [00:07<00:09, 12.00 it/sec, obj=171]
INFO - 08:26:30: ...  46%|████▌     | 92/200 [00:07<00:08, 12.00 it/sec, obj=171]
INFO - 08:26:30: ...  46%|████▋     | 93/200 [00:07<00:08, 12.01 it/sec, obj=171]
INFO - 08:26:31: ...  47%|████▋     | 94/200 [00:07<00:08, 12.01 it/sec, obj=171]
INFO - 08:26:31: ...  48%|████▊     | 95/200 [00:07<00:08, 12.02 it/sec, obj=171]
INFO - 08:26:31: ...  48%|████▊     | 96/200 [00:07<00:08, 12.02 it/sec, obj=171]
INFO - 08:26:31: ...  48%|████▊     | 97/200 [00:08<00:08, 12.03 it/sec, obj=171]
INFO - 08:26:31: ...  49%|████▉     | 98/200 [00:08<00:08, 12.03 it/sec, obj=171]
INFO - 08:26:31: ...  50%|████▉     | 99/200 [00:08<00:08, 12.04 it/sec, obj=171]
INFO - 08:26:31: ...  50%|█████     | 100/200 [00:08<00:08, 12.04 it/sec, obj=171]
INFO - 08:26:31: ...  50%|█████     | 101/200 [00:08<00:08, 12.04 it/sec, obj=171]
INFO - 08:26:31: ...  51%|█████     | 102/200 [00:08<00:08, 12.05 it/sec, obj=171]
INFO - 08:26:31: ...  52%|█████▏    | 103/200 [00:08<00:08, 12.05 it/sec, obj=171]
INFO - 08:26:31: ...  52%|█████▏    | 104/200 [00:08<00:07, 12.05 it/sec, obj=171]
INFO - 08:26:31: ...  52%|█████▎    | 105/200 [00:08<00:07, 12.06 it/sec, obj=171]
INFO - 08:26:31: ...  53%|█████▎    | 106/200 [00:08<00:07, 12.06 it/sec, obj=171]
INFO - 08:26:32: ...  54%|█████▎    | 107/200 [00:08<00:07, 12.06 it/sec, obj=171]
INFO - 08:26:32: ...  54%|█████▍    | 108/200 [00:08<00:07, 12.07 it/sec, obj=171]
INFO - 08:26:32: ...  55%|█████▍    | 109/200 [00:09<00:07, 12.07 it/sec, obj=171]
INFO - 08:26:32: ...  55%|█████▌    | 110/200 [00:09<00:07, 12.07 it/sec, obj=171]
INFO - 08:26:32: ...  56%|█████▌    | 111/200 [00:09<00:07, 12.08 it/sec, obj=171]
INFO - 08:26:32: ...  56%|█████▌    | 112/200 [00:09<00:07, 12.08 it/sec, obj=171]
INFO - 08:26:32: ...  56%|█████▋    | 113/200 [00:09<00:07, 12.08 it/sec, obj=171]
INFO - 08:26:32: ...  57%|█████▋    | 114/200 [00:09<00:07, 12.08 it/sec, obj=171]
INFO - 08:26:32: ...  57%|█████▊    | 115/200 [00:09<00:07, 12.09 it/sec, obj=172]
INFO - 08:26:32: ...  58%|█████▊    | 116/200 [00:09<00:06, 12.10 it/sec, obj=172]
INFO - 08:26:32: ...  58%|█████▊    | 117/200 [00:09<00:06, 12.10 it/sec, obj=172]
INFO - 08:26:32: ...  59%|█████▉    | 118/200 [00:09<00:06, 12.10 it/sec, obj=172]
INFO - 08:26:33: ...  60%|█████▉    | 119/200 [00:09<00:06, 12.11 it/sec, obj=171]
INFO - 08:26:33: ...  60%|██████    | 120/200 [00:09<00:06, 12.11 it/sec, obj=171]
INFO - 08:26:33: ...  60%|██████    | 121/200 [00:09<00:06, 12.11 it/sec, obj=171]
INFO - 08:26:33: ...  61%|██████    | 122/200 [00:10<00:06, 12.11 it/sec, obj=170]
INFO - 08:26:33: ...  62%|██████▏   | 123/200 [00:10<00:06, 12.11 it/sec, obj=170]
INFO - 08:26:33: ...  62%|██████▏   | 124/200 [00:10<00:06, 12.11 it/sec, obj=170]
INFO - 08:26:33: ...  62%|██████▎   | 125/200 [00:10<00:06, 12.12 it/sec, obj=170]
INFO - 08:26:33: ...  63%|██████▎   | 126/200 [00:10<00:06, 12.12 it/sec, obj=170]
INFO - 08:26:33: ...  64%|██████▎   | 127/200 [00:10<00:06, 12.12 it/sec, obj=170]
INFO - 08:26:33: ...  64%|██████▍   | 128/200 [00:10<00:05, 12.13 it/sec, obj=170]
INFO - 08:26:33: ...  64%|██████▍   | 129/200 [00:10<00:05, 12.13 it/sec, obj=170]
INFO - 08:26:33: ...  65%|██████▌   | 130/200 [00:10<00:05, 12.13 it/sec, obj=170]
INFO - 08:26:33: ...  66%|██████▌   | 131/200 [00:10<00:05, 12.13 it/sec, obj=170]
INFO - 08:26:34: ...  66%|██████▌   | 132/200 [00:10<00:05, 12.14 it/sec, obj=170]
INFO - 08:26:34: ...  66%|██████▋   | 133/200 [00:10<00:05, 12.14 it/sec, obj=170]
INFO - 08:26:34: ...  67%|██████▋   | 134/200 [00:11<00:05, 12.14 it/sec, obj=170]
INFO - 08:26:34: ...  68%|██████▊   | 135/200 [00:11<00:05, 12.15 it/sec, obj=170]
INFO - 08:26:34: ...  68%|██████▊   | 136/200 [00:11<00:05, 12.15 it/sec, obj=170]
INFO - 08:26:34: ...  68%|██████▊   | 137/200 [00:11<00:05, 12.15 it/sec, obj=170]
INFO - 08:26:34: ...  69%|██████▉   | 138/200 [00:11<00:05, 12.15 it/sec, obj=170]
INFO - 08:26:34: ...  70%|██████▉   | 139/200 [00:11<00:05, 12.15 it/sec, obj=170]
INFO - 08:26:34: ...  70%|███████   | 140/200 [00:11<00:04, 12.15 it/sec, obj=170]
INFO - 08:26:34: ...  70%|███████   | 141/200 [00:11<00:04, 12.16 it/sec, obj=170]
INFO - 08:26:34: ...  71%|███████   | 142/200 [00:11<00:04, 12.16 it/sec, obj=170]
INFO - 08:26:34: ...  72%|███████▏  | 143/200 [00:11<00:04, 12.16 it/sec, obj=170]
INFO - 08:26:35: ...  72%|███████▏  | 144/200 [00:11<00:04, 12.16 it/sec, obj=170]
INFO - 08:26:35: ...  72%|███████▎  | 145/200 [00:11<00:04, 12.17 it/sec, obj=170]
INFO - 08:26:35: ...  73%|███████▎  | 146/200 [00:11<00:04, 12.17 it/sec, obj=170]
INFO - 08:26:35: ...  74%|███████▎  | 147/200 [00:12<00:04, 12.17 it/sec, obj=170]
INFO - 08:26:35: ...  74%|███████▍  | 148/200 [00:12<00:04, 12.17 it/sec, obj=170]
INFO - 08:26:35: ...  74%|███████▍  | 149/200 [00:12<00:04, 12.17 it/sec, obj=170]
INFO - 08:26:35: ...  75%|███████▌  | 150/200 [00:12<00:04, 12.18 it/sec, obj=170]
INFO - 08:26:35: ...  76%|███████▌  | 151/200 [00:12<00:04, 12.18 it/sec, obj=170]
INFO - 08:26:35: ...  76%|███████▌  | 152/200 [00:12<00:03, 12.18 it/sec, obj=170]
INFO - 08:26:35: ...  76%|███████▋  | 153/200 [00:12<00:03, 12.18 it/sec, obj=170]
INFO - 08:26:35: ...  77%|███████▋  | 154/200 [00:12<00:03, 12.18 it/sec, obj=170]
INFO - 08:26:35: ...  78%|███████▊  | 155/200 [00:12<00:03, 12.19 it/sec, obj=170]
INFO - 08:26:36: ...  78%|███████▊  | 156/200 [00:12<00:03, 12.19 it/sec, obj=170]
INFO - 08:26:36: ...  78%|███████▊  | 157/200 [00:12<00:03, 12.19 it/sec, obj=170]
INFO - 08:26:36: ...  79%|███████▉  | 158/200 [00:12<00:03, 12.19 it/sec, obj=170]
INFO - 08:26:36: ...  80%|███████▉  | 159/200 [00:13<00:03, 12.19 it/sec, obj=170]
INFO - 08:26:36: ...  80%|████████  | 160/200 [00:13<00:03, 12.20 it/sec, obj=170]
INFO - 08:26:36: ...  80%|████████  | 161/200 [00:13<00:03, 12.20 it/sec, obj=170]
INFO - 08:26:36: ...  81%|████████  | 162/200 [00:13<00:03, 12.20 it/sec, obj=170]
INFO - 08:26:36: ...  82%|████████▏ | 163/200 [00:13<00:03, 12.20 it/sec, obj=170]
INFO - 08:26:36: ...  82%|████████▏ | 164/200 [00:13<00:02, 12.21 it/sec, obj=170]
INFO - 08:26:36: ...  82%|████████▎ | 165/200 [00:13<00:02, 12.21 it/sec, obj=170]
INFO - 08:26:36: ...  83%|████████▎ | 166/200 [00:13<00:02, 12.21 it/sec, obj=170]
INFO - 08:26:36: ...  84%|████████▎ | 167/200 [00:13<00:02, 12.22 it/sec, obj=170]
INFO - 08:26:36: ...  84%|████████▍ | 168/200 [00:13<00:02, 12.22 it/sec, obj=170]
INFO - 08:26:37: ...  84%|████████▍ | 169/200 [00:13<00:02, 12.22 it/sec, obj=170]
INFO - 08:26:37: ...  85%|████████▌ | 170/200 [00:13<00:02, 12.22 it/sec, obj=170]
INFO - 08:26:37: ...  86%|████████▌ | 171/200 [00:13<00:02, 12.23 it/sec, obj=170]
INFO - 08:26:37: ...  86%|████████▌ | 172/200 [00:14<00:02, 12.23 it/sec, obj=170]
INFO - 08:26:37: ...  86%|████████▋ | 173/200 [00:14<00:02, 12.23 it/sec, obj=170]
INFO - 08:26:37: ...  87%|████████▋ | 174/200 [00:14<00:02, 12.23 it/sec, obj=170]
INFO - 08:26:37: ...  88%|████████▊ | 175/200 [00:14<00:02, 12.24 it/sec, obj=170]
INFO - 08:26:37: ...  88%|████████▊ | 176/200 [00:14<00:01, 12.24 it/sec, obj=170]
INFO - 08:26:37: ...  88%|████████▊ | 177/200 [00:14<00:01, 12.24 it/sec, obj=170]
INFO - 08:26:37: ...  89%|████████▉ | 178/200 [00:14<00:01, 12.24 it/sec, obj=170]
INFO - 08:26:37: ...  90%|████████▉ | 179/200 [00:14<00:01, 12.24 it/sec, obj=170]
INFO - 08:26:37: ...  90%|█████████ | 180/200 [00:14<00:01, 12.24 it/sec, obj=170]
INFO - 08:26:37: ...  90%|█████████ | 181/200 [00:14<00:01, 12.24 it/sec, obj=170]
INFO - 08:26:38: ...  91%|█████████ | 182/200 [00:14<00:01, 12.25 it/sec, obj=170]
INFO - 08:26:38: ...  92%|█████████▏| 183/200 [00:14<00:01, 12.25 it/sec, obj=170]
INFO - 08:26:38: ...  92%|█████████▏| 184/200 [00:15<00:01, 12.25 it/sec, obj=170]
INFO - 08:26:38: ...  92%|█████████▎| 185/200 [00:15<00:01, 12.25 it/sec, obj=170]
INFO - 08:26:38: ...  93%|█████████▎| 186/200 [00:15<00:01, 12.25 it/sec, obj=170]
INFO - 08:26:38: ...  94%|█████████▎| 187/200 [00:15<00:01, 12.25 it/sec, obj=170]
INFO - 08:26:38: ...  94%|█████████▍| 188/200 [00:15<00:00, 12.25 it/sec, obj=170]
INFO - 08:26:38: ...  94%|█████████▍| 189/200 [00:15<00:00, 12.26 it/sec, obj=170]
INFO - 08:26:38: ...  95%|█████████▌| 190/200 [00:15<00:00, 12.26 it/sec, obj=170]
INFO - 08:26:38: ...  96%|█████████▌| 191/200 [00:15<00:00, 12.26 it/sec, obj=170]
INFO - 08:26:38: ...  96%|█████████▌| 192/200 [00:15<00:00, 12.26 it/sec, obj=170]
INFO - 08:26:38: ...  96%|█████████▋| 193/200 [00:15<00:00, 12.26 it/sec, obj=170]
INFO - 08:26:39: ...  97%|█████████▋| 194/200 [00:15<00:00, 12.26 it/sec, obj=170]
INFO - 08:26:39: ...  98%|█████████▊| 195/200 [00:15<00:00, 12.27 it/sec, obj=170]
INFO - 08:26:39: ...  98%|█████████▊| 196/200 [00:15<00:00, 12.27 it/sec, obj=170]
INFO - 08:26:39: ...  98%|█████████▊| 197/200 [00:16<00:00, 12.27 it/sec, obj=170]
INFO - 08:26:39: ...  99%|█████████▉| 198/200 [00:16<00:00, 12.27 it/sec, obj=170]
INFO - 08:26:39: ... 100%|█████████▉| 199/200 [00:16<00:00, 12.27 it/sec, obj=170]
INFO - 08:26:39: ... 100%|██████████| 200/200 [00:16<00:00, 12.32 it/sec, obj=170]
INFO - 08:26:39: Optimization result:
INFO - 08:26:39:    Optimizer info:
INFO - 08:26:39:       Status: None
INFO - 08:26:39:       Message: Maximum number of iterations reached. GEMSEO Stopped the driver
INFO - 08:26:39:       Number of calls to the objective function by the optimizer: 201
INFO - 08:26:39:    Solution:
INFO - 08:26:39:       The solution is feasible.
INFO - 08:26:39:       Objective: 169.89161468983534
INFO - 08:26:39:       Standardized constraints:
INFO - 08:26:39:          [volume fraction-0.3] = -4.312432086428508e-07
INFO - 08:26:39: *** End MDOScenario execution (time: 0:00:16.258506) ***

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


## Results¶

Post-process the optimization history:

scenario.post_process(
"BasicHistory",
variable_names=["compliance"],
file_name=f"{problem_name}_history.png",
)

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


Plot the solution

scenario.post_process(
"TopologyView",
n_x=n_x,
n_y=n_y,
file_name=f"{problem_name}_solution.png",
)

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


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

Gallery generated by Sphinx-Gallery