# Solve a 2D short cantilever 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 = "Short_Cantilever"


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

n_x = 50
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_memeber_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_memeber_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 - 13:54:51:
INFO - 13:54:51: *** Start MDOScenario execution ***
INFO - 13:54:51: MDOScenario
INFO - 13:54:51:    Disciplines: DensityFilter FininiteElementAnalysis MaterialModelInterpolation VolumeFraction
INFO - 13:54:51:    MDO formulation: DisciplinaryOpt
INFO - 13:54:51: Optimization problem:
INFO - 13:54:51:    minimize compliance(x)
INFO - 13:54:51:    with respect to x
INFO - 13:54:51:    subject to constraints:
INFO - 13:54:51:       volume fraction(x) <= 0.3
INFO - 13:54:51: ...   0%|          | 0/200 [00:00<?, ?it]
INFO - 13:54:51: ...   0%|          | 1/200 [00:00<00:09, 21.35 it/sec, obj=1.46e+3]
INFO - 13:54:51: ...   1%|          | 2/200 [00:00<00:27,  7.13 it/sec, obj=1.46e+3]
INFO - 13:54:51: ...   2%|▏         | 3/200 [00:00<00:25,  7.73 it/sec, obj=1.45e+3]
INFO - 13:54:51: ...   2%|▏         | 4/200 [00:00<00:23,  8.20 it/sec, obj=1.45e+3]
INFO - 13:54:51: ...   2%|▎         | 5/200 [00:00<00:22,  8.49 it/sec, obj=1.45e+3]
INFO - 13:54:51: ...   3%|▎         | 6/200 [00:00<00:22,  8.70 it/sec, obj=1.43e+3]
INFO - 13:54:51: ...   4%|▎         | 7/200 [00:00<00:21,  8.88 it/sec, obj=1.4e+3]
INFO - 13:54:51: ...   4%|▍         | 8/200 [00:00<00:21,  8.99 it/sec, obj=1.36e+3]
INFO - 13:54:52: ...   4%|▍         | 9/200 [00:00<00:21,  9.02 it/sec, obj=1.2e+3]
INFO - 13:54:52: ...   5%|▌         | 10/200 [00:01<00:20,  9.10 it/sec, obj=1.01e+3]
INFO - 13:54:52: ...   6%|▌         | 11/200 [00:01<00:20,  9.18 it/sec, obj=756]
INFO - 13:54:52: ...   6%|▌         | 12/200 [00:01<00:20,  9.24 it/sec, obj=573]
INFO - 13:54:52: ...   6%|▋         | 13/200 [00:01<00:20,  9.30 it/sec, obj=509]
INFO - 13:54:52: ...   7%|▋         | 14/200 [00:01<00:19,  9.36 it/sec, obj=448]
INFO - 13:54:52: ...   8%|▊         | 15/200 [00:01<00:19,  9.41 it/sec, obj=399]
INFO - 13:54:52: ...   8%|▊         | 16/200 [00:01<00:19,  9.45 it/sec, obj=360]
INFO - 13:54:52: ...   8%|▊         | 17/200 [00:01<00:19,  9.48 it/sec, obj=329]
INFO - 13:54:52: ...   9%|▉         | 18/200 [00:01<00:19,  9.51 it/sec, obj=304]
INFO - 13:54:53: ...  10%|▉         | 19/200 [00:01<00:18,  9.55 it/sec, obj=278]
INFO - 13:54:53: ...  10%|█         | 20/200 [00:02<00:18,  9.58 it/sec, obj=251]
INFO - 13:54:53: ...  10%|█         | 21/200 [00:02<00:18,  9.61 it/sec, obj=231]
INFO - 13:54:53: ...  11%|█         | 22/200 [00:02<00:18,  9.64 it/sec, obj=213]
INFO - 13:54:53: ...  12%|█▏        | 23/200 [00:02<00:18,  9.66 it/sec, obj=193]
INFO - 13:54:53: ...  12%|█▏        | 24/200 [00:02<00:18,  9.68 it/sec, obj=175]
INFO - 13:54:53: ...  12%|█▎        | 25/200 [00:02<00:18,  9.70 it/sec, obj=161]
INFO - 13:54:53: ...  13%|█▎        | 26/200 [00:02<00:17,  9.70 it/sec, obj=153]
INFO - 13:54:53: ...  14%|█▎        | 27/200 [00:02<00:17,  9.70 it/sec, obj=148]
INFO - 13:54:53: ...  14%|█▍        | 28/200 [00:02<00:17,  9.73 it/sec, obj=145]
INFO - 13:54:54: ...  14%|█▍        | 29/200 [00:02<00:17,  9.70 it/sec, obj=143]
INFO - 13:54:54: ...  15%|█▌        | 30/200 [00:03<00:17,  9.72 it/sec, obj=142]
INFO - 13:54:54: ...  16%|█▌        | 31/200 [00:03<00:17,  9.73 it/sec, obj=141]
INFO - 13:54:54: ...  16%|█▌        | 32/200 [00:03<00:17,  9.75 it/sec, obj=140]
INFO - 13:54:54: ...  16%|█▋        | 33/200 [00:03<00:17,  9.77 it/sec, obj=140]
INFO - 13:54:54: ...  17%|█▋        | 34/200 [00:03<00:16,  9.78 it/sec, obj=140]
INFO - 13:54:54: ...  18%|█▊        | 35/200 [00:03<00:16,  9.79 it/sec, obj=139]
INFO - 13:54:54: ...  18%|█▊        | 36/200 [00:03<00:16,  9.80 it/sec, obj=139]
INFO - 13:54:54: ...  18%|█▊        | 37/200 [00:03<00:16,  9.82 it/sec, obj=139]
INFO - 13:54:54: ...  19%|█▉        | 38/200 [00:03<00:16,  9.83 it/sec, obj=139]
INFO - 13:54:55: ...  20%|█▉        | 39/200 [00:03<00:16,  9.85 it/sec, obj=139]
INFO - 13:54:55: ...  20%|██        | 40/200 [00:04<00:16,  9.86 it/sec, obj=139]
INFO - 13:54:55: ...  20%|██        | 41/200 [00:04<00:16,  9.88 it/sec, obj=139]
INFO - 13:54:55: ...  21%|██        | 42/200 [00:04<00:15,  9.89 it/sec, obj=138]
INFO - 13:54:55: ...  22%|██▏       | 43/200 [00:04<00:15,  9.90 it/sec, obj=138]
INFO - 13:54:55: ...  22%|██▏       | 44/200 [00:04<00:15,  9.91 it/sec, obj=138]
INFO - 13:54:55: ...  22%|██▎       | 45/200 [00:04<00:15,  9.91 it/sec, obj=138]
INFO - 13:54:55: ...  23%|██▎       | 46/200 [00:04<00:15,  9.92 it/sec, obj=138]
INFO - 13:54:55: ...  24%|██▎       | 47/200 [00:04<00:15,  9.94 it/sec, obj=138]
INFO - 13:54:55: ...  24%|██▍       | 48/200 [00:04<00:15,  9.94 it/sec, obj=138]
INFO - 13:54:55: ...  24%|██▍       | 49/200 [00:04<00:15,  9.94 it/sec, obj=138]
INFO - 13:54:56: ...  25%|██▌       | 50/200 [00:05<00:15,  9.94 it/sec, obj=138]
INFO - 13:54:56: ...  26%|██▌       | 51/200 [00:05<00:14,  9.95 it/sec, obj=138]
INFO - 13:54:56: ...  26%|██▌       | 52/200 [00:05<00:14,  9.95 it/sec, obj=138]
INFO - 13:54:56: ...  26%|██▋       | 53/200 [00:05<00:14,  9.96 it/sec, obj=138]
INFO - 13:54:56: ...  27%|██▋       | 54/200 [00:05<00:14,  9.97 it/sec, obj=137]
INFO - 13:54:56: ...  28%|██▊       | 55/200 [00:05<00:14,  9.97 it/sec, obj=137]
INFO - 13:54:56: ...  28%|██▊       | 56/200 [00:05<00:14,  9.97 it/sec, obj=137]
INFO - 13:54:56: ...  28%|██▊       | 57/200 [00:05<00:14,  9.98 it/sec, obj=137]
INFO - 13:54:56: ...  29%|██▉       | 58/200 [00:05<00:14,  9.98 it/sec, obj=137]
INFO - 13:54:56: ...  30%|██▉       | 59/200 [00:05<00:14,  9.99 it/sec, obj=137]
INFO - 13:54:57: ...  30%|███       | 60/200 [00:06<00:14, 10.00 it/sec, obj=137]
INFO - 13:54:57: ...  30%|███       | 61/200 [00:06<00:13, 10.01 it/sec, obj=137]
INFO - 13:54:57: ...  31%|███       | 62/200 [00:06<00:13, 10.01 it/sec, obj=137]
INFO - 13:54:57: ...  32%|███▏      | 63/200 [00:06<00:13, 10.02 it/sec, obj=137]
INFO - 13:54:57: ...  32%|███▏      | 64/200 [00:06<00:13, 10.02 it/sec, obj=137]
INFO - 13:54:57: ...  32%|███▎      | 65/200 [00:06<00:13, 10.03 it/sec, obj=137]
INFO - 13:54:57: ...  33%|███▎      | 66/200 [00:06<00:13, 10.04 it/sec, obj=137]
INFO - 13:54:57: ...  34%|███▎      | 67/200 [00:06<00:13, 10.05 it/sec, obj=137]
INFO - 13:54:57: ...  34%|███▍      | 68/200 [00:06<00:13, 10.06 it/sec, obj=137]
INFO - 13:54:57: ...  34%|███▍      | 69/200 [00:06<00:13, 10.07 it/sec, obj=137]
INFO - 13:54:57: ...  35%|███▌      | 70/200 [00:06<00:12, 10.08 it/sec, obj=137]
INFO - 13:54:58: ...  36%|███▌      | 71/200 [00:07<00:12, 10.08 it/sec, obj=137]
INFO - 13:54:58: ...  36%|███▌      | 72/200 [00:07<00:12, 10.09 it/sec, obj=137]
INFO - 13:54:58: ...  36%|███▋      | 73/200 [00:07<00:12, 10.10 it/sec, obj=137]
INFO - 13:54:58: ...  37%|███▋      | 74/200 [00:07<00:12, 10.11 it/sec, obj=137]
INFO - 13:54:58: ...  38%|███▊      | 75/200 [00:07<00:12, 10.11 it/sec, obj=137]
INFO - 13:54:58: ...  38%|███▊      | 76/200 [00:07<00:12, 10.12 it/sec, obj=137]
INFO - 13:54:58: ...  38%|███▊      | 77/200 [00:07<00:12, 10.13 it/sec, obj=137]
INFO - 13:54:58: ...  39%|███▉      | 78/200 [00:07<00:12, 10.13 it/sec, obj=137]
INFO - 13:54:58: ...  40%|███▉      | 79/200 [00:07<00:11, 10.13 it/sec, obj=137]
INFO - 13:54:58: ...  40%|████      | 80/200 [00:07<00:11, 10.14 it/sec, obj=137]
INFO - 13:54:59: ...  40%|████      | 81/200 [00:07<00:11, 10.15 it/sec, obj=137]
INFO - 13:54:59: ...  41%|████      | 82/200 [00:08<00:11, 10.15 it/sec, obj=137]
INFO - 13:54:59: ...  42%|████▏     | 83/200 [00:08<00:11, 10.16 it/sec, obj=137]
INFO - 13:54:59: ...  42%|████▏     | 84/200 [00:08<00:11, 10.16 it/sec, obj=137]
INFO - 13:54:59: ...  42%|████▎     | 85/200 [00:08<00:11, 10.17 it/sec, obj=137]
INFO - 13:54:59: ...  43%|████▎     | 86/200 [00:08<00:11, 10.17 it/sec, obj=137]
INFO - 13:54:59: ...  44%|████▎     | 87/200 [00:08<00:11, 10.18 it/sec, obj=137]
INFO - 13:54:59: ...  44%|████▍     | 88/200 [00:08<00:10, 10.19 it/sec, obj=137]
INFO - 13:54:59: ...  44%|████▍     | 89/200 [00:08<00:10, 10.19 it/sec, obj=137]
INFO - 13:54:59: ...  45%|████▌     | 90/200 [00:08<00:10, 10.19 it/sec, obj=137]
INFO - 13:54:59: ...  46%|████▌     | 91/200 [00:08<00:10, 10.20 it/sec, obj=137]
INFO - 13:55:00: ...  46%|████▌     | 92/200 [00:09<00:10, 10.20 it/sec, obj=137]
INFO - 13:55:00: ...  46%|████▋     | 93/200 [00:09<00:10, 10.19 it/sec, obj=137]
INFO - 13:55:00: ...  47%|████▋     | 94/200 [00:09<00:10, 10.19 it/sec, obj=137]
INFO - 13:55:00: ...  48%|████▊     | 95/200 [00:09<00:10, 10.20 it/sec, obj=137]
INFO - 13:55:00: ...  48%|████▊     | 96/200 [00:09<00:10, 10.20 it/sec, obj=137]
INFO - 13:55:00: ...  48%|████▊     | 97/200 [00:09<00:10, 10.20 it/sec, obj=137]
INFO - 13:55:00: ...  49%|████▉     | 98/200 [00:09<00:10, 10.20 it/sec, obj=137]
INFO - 13:55:00: ...  50%|████▉     | 99/200 [00:09<00:09, 10.20 it/sec, obj=137]
INFO - 13:55:00: ...  50%|█████     | 100/200 [00:09<00:09, 10.20 it/sec, obj=137]
INFO - 13:55:00: ...  50%|█████     | 101/200 [00:09<00:09, 10.20 it/sec, obj=137]
INFO - 13:55:01: ...  51%|█████     | 102/200 [00:09<00:09, 10.21 it/sec, obj=137]
INFO - 13:55:01: ...  52%|█████▏    | 103/200 [00:10<00:09, 10.21 it/sec, obj=137]
INFO - 13:55:01: ...  52%|█████▏    | 104/200 [00:10<00:09, 10.21 it/sec, obj=137]
INFO - 13:55:01: ...  52%|█████▎    | 105/200 [00:10<00:09, 10.21 it/sec, obj=137]
INFO - 13:55:01: ...  53%|█████▎    | 106/200 [00:10<00:09, 10.21 it/sec, obj=137]
INFO - 13:55:01: ...  54%|█████▎    | 107/200 [00:10<00:09, 10.21 it/sec, obj=137]
INFO - 13:55:01: ...  54%|█████▍    | 108/200 [00:10<00:09, 10.21 it/sec, obj=137]
INFO - 13:55:01: ...  55%|█████▍    | 109/200 [00:10<00:08, 10.21 it/sec, obj=137]
INFO - 13:55:01: ...  55%|█████▌    | 110/200 [00:10<00:08, 10.22 it/sec, obj=137]
INFO - 13:55:01: ...  56%|█████▌    | 111/200 [00:10<00:08, 10.22 it/sec, obj=137]
INFO - 13:55:02: ...  56%|█████▌    | 112/200 [00:10<00:08, 10.22 it/sec, obj=137]
INFO - 13:55:02: ...  56%|█████▋    | 113/200 [00:11<00:08, 10.22 it/sec, obj=137]
INFO - 13:55:02: ...  57%|█████▋    | 114/200 [00:11<00:08, 10.22 it/sec, obj=137]
INFO - 13:55:02: ...  57%|█████▊    | 115/200 [00:11<00:08, 10.22 it/sec, obj=137]
INFO - 13:55:02: ...  58%|█████▊    | 116/200 [00:11<00:08, 10.23 it/sec, obj=137]
INFO - 13:55:02: ...  58%|█████▊    | 117/200 [00:11<00:08, 10.23 it/sec, obj=137]
INFO - 13:55:02: ...  59%|█████▉    | 118/200 [00:11<00:08, 10.23 it/sec, obj=137]
INFO - 13:55:02: ...  60%|█████▉    | 119/200 [00:11<00:07, 10.23 it/sec, obj=137]
INFO - 13:55:02: ...  60%|██████    | 120/200 [00:11<00:07, 10.23 it/sec, obj=137]
INFO - 13:55:02: ...  60%|██████    | 121/200 [00:11<00:07, 10.23 it/sec, obj=137]
INFO - 13:55:02: ...  61%|██████    | 122/200 [00:11<00:07, 10.23 it/sec, obj=137]
INFO - 13:55:03: ...  62%|██████▏   | 123/200 [00:12<00:07, 10.23 it/sec, obj=137]
INFO - 13:55:03: ...  62%|██████▏   | 124/200 [00:12<00:07, 10.23 it/sec, obj=137]
INFO - 13:55:03: ...  62%|██████▎   | 125/200 [00:12<00:07, 10.23 it/sec, obj=137]
INFO - 13:55:03: ...  63%|██████▎   | 126/200 [00:12<00:07, 10.24 it/sec, obj=137]
INFO - 13:55:03: ...  64%|██████▎   | 127/200 [00:12<00:07, 10.24 it/sec, obj=137]
INFO - 13:55:03: ...  64%|██████▍   | 128/200 [00:12<00:07, 10.24 it/sec, obj=137]
INFO - 13:55:03: ...  64%|██████▍   | 129/200 [00:12<00:06, 10.24 it/sec, obj=137]
INFO - 13:55:03: ...  65%|██████▌   | 130/200 [00:12<00:06, 10.24 it/sec, obj=137]
INFO - 13:55:03: ...  66%|██████▌   | 131/200 [00:12<00:06, 10.24 it/sec, obj=137]
INFO - 13:55:03: ...  66%|██████▌   | 132/200 [00:12<00:06, 10.24 it/sec, obj=137]
INFO - 13:55:04: ...  66%|██████▋   | 133/200 [00:12<00:06, 10.24 it/sec, obj=137]
INFO - 13:55:04: ...  67%|██████▋   | 134/200 [00:13<00:06, 10.24 it/sec, obj=137]
INFO - 13:55:04: ...  68%|██████▊   | 135/200 [00:13<00:06, 10.24 it/sec, obj=137]
INFO - 13:55:04: ...  68%|██████▊   | 136/200 [00:13<00:06, 10.24 it/sec, obj=137]
INFO - 13:55:04: ...  68%|██████▊   | 137/200 [00:13<00:06, 10.25 it/sec, obj=137]
INFO - 13:55:04: ...  69%|██████▉   | 138/200 [00:13<00:06, 10.25 it/sec, obj=137]
INFO - 13:55:04: ...  70%|██████▉   | 139/200 [00:13<00:05, 10.24 it/sec, obj=137]
INFO - 13:55:04: ...  70%|███████   | 140/200 [00:13<00:05, 10.24 it/sec, obj=137]
INFO - 13:55:04: ...  70%|███████   | 141/200 [00:13<00:05, 10.25 it/sec, obj=137]
INFO - 13:55:04: ...  71%|███████   | 142/200 [00:13<00:05, 10.25 it/sec, obj=137]
INFO - 13:55:05: ...  72%|███████▏  | 143/200 [00:13<00:05, 10.25 it/sec, obj=137]
INFO - 13:55:05: ...  72%|███████▏  | 144/200 [00:14<00:05, 10.25 it/sec, obj=137]
INFO - 13:55:05: ...  72%|███████▎  | 145/200 [00:14<00:05, 10.25 it/sec, obj=137]
INFO - 13:55:05: ...  73%|███████▎  | 146/200 [00:14<00:05, 10.26 it/sec, obj=137]
INFO - 13:55:05: ...  74%|███████▎  | 147/200 [00:14<00:05, 10.26 it/sec, obj=137]
INFO - 13:55:05: ...  74%|███████▍  | 148/200 [00:14<00:05, 10.26 it/sec, obj=137]
INFO - 13:55:05: ...  74%|███████▍  | 149/200 [00:14<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:05: ...  75%|███████▌  | 150/200 [00:14<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:05: ...  76%|███████▌  | 151/200 [00:14<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:05: ...  76%|███████▌  | 152/200 [00:14<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:05: ...  76%|███████▋  | 153/200 [00:14<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:06: ...  77%|███████▋  | 154/200 [00:15<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:06: ...  78%|███████▊  | 155/200 [00:15<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:06: ...  78%|███████▊  | 156/200 [00:15<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:06: ...  78%|███████▊  | 157/200 [00:15<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:06: ...  79%|███████▉  | 158/200 [00:15<00:04, 10.26 it/sec, obj=137]
INFO - 13:55:06: ...  80%|███████▉  | 159/200 [00:15<00:03, 10.26 it/sec, obj=137]
INFO - 13:55:06: ...  80%|████████  | 160/200 [00:15<00:03, 10.26 it/sec, obj=137]
INFO - 13:55:06: ...  80%|████████  | 161/200 [00:15<00:03, 10.26 it/sec, obj=137]
INFO - 13:55:06: ...  81%|████████  | 162/200 [00:15<00:03, 10.27 it/sec, obj=137]
INFO - 13:55:06: ...  82%|████████▏ | 163/200 [00:15<00:03, 10.27 it/sec, obj=137]
INFO - 13:55:07: ...  82%|████████▏ | 164/200 [00:15<00:03, 10.27 it/sec, obj=137]
INFO - 13:55:07: ...  82%|████████▎ | 165/200 [00:16<00:03, 10.27 it/sec, obj=137]
INFO - 13:55:07: ...  83%|████████▎ | 166/200 [00:16<00:03, 10.27 it/sec, obj=137]
INFO - 13:55:07: ...  84%|████████▎ | 167/200 [00:16<00:03, 10.27 it/sec, obj=137]
INFO - 13:55:07: ...  84%|████████▍ | 168/200 [00:16<00:03, 10.27 it/sec, obj=137]
INFO - 13:55:07: ...  84%|████████▍ | 169/200 [00:16<00:03, 10.27 it/sec, obj=137]
INFO - 13:55:07: ...  85%|████████▌ | 170/200 [00:16<00:02, 10.27 it/sec, obj=137]
INFO - 13:55:07: ...  86%|████████▌ | 171/200 [00:16<00:02, 10.27 it/sec, obj=137]
INFO - 13:55:07: ...  86%|████████▌ | 172/200 [00:16<00:02, 10.28 it/sec, obj=137]
INFO - 13:55:07: ...  86%|████████▋ | 173/200 [00:16<00:02, 10.28 it/sec, obj=137]
INFO - 13:55:07: ...  87%|████████▋ | 174/200 [00:16<00:02, 10.28 it/sec, obj=137]
INFO - 13:55:08: ...  88%|████████▊ | 175/200 [00:17<00:02, 10.28 it/sec, obj=137]
INFO - 13:55:08: ...  88%|████████▊ | 176/200 [00:17<00:02, 10.27 it/sec, obj=137]
INFO - 13:55:08: ...  88%|████████▊ | 177/200 [00:17<00:02, 10.27 it/sec, obj=137]
INFO - 13:55:08: ...  89%|████████▉ | 178/200 [00:17<00:02, 10.28 it/sec, obj=137]
INFO - 13:55:08: ...  90%|████████▉ | 179/200 [00:17<00:02, 10.28 it/sec, obj=137]
INFO - 13:55:08: ...  90%|█████████ | 180/200 [00:17<00:01, 10.28 it/sec, obj=137]
INFO - 13:55:08: ...  90%|█████████ | 181/200 [00:17<00:01, 10.28 it/sec, obj=137]
INFO - 13:55:08: ...  91%|█████████ | 182/200 [00:17<00:01, 10.28 it/sec, obj=137]
INFO - 13:55:08: ...  92%|█████████▏| 183/200 [00:17<00:01, 10.28 it/sec, obj=137]
INFO - 13:55:08: ...  92%|█████████▏| 184/200 [00:17<00:01, 10.28 it/sec, obj=137]
INFO - 13:55:09: ...  92%|█████████▎| 185/200 [00:17<00:01, 10.28 it/sec, obj=137]
INFO - 13:55:09: ...  93%|█████████▎| 186/200 [00:18<00:01, 10.28 it/sec, obj=137]
INFO - 13:55:09: ...  94%|█████████▎| 187/200 [00:18<00:01, 10.29 it/sec, obj=137]
INFO - 13:55:09: ...  94%|█████████▍| 188/200 [00:18<00:01, 10.29 it/sec, obj=137]
INFO - 13:55:09: ...  94%|█████████▍| 189/200 [00:18<00:01, 10.29 it/sec, obj=137]
INFO - 13:55:09: ...  95%|█████████▌| 190/200 [00:18<00:00, 10.29 it/sec, obj=137]
INFO - 13:55:09: ...  96%|█████████▌| 191/200 [00:18<00:00, 10.29 it/sec, obj=137]
INFO - 13:55:09: ...  96%|█████████▌| 192/200 [00:18<00:00, 10.29 it/sec, obj=137]
INFO - 13:55:09: ...  96%|█████████▋| 193/200 [00:18<00:00, 10.30 it/sec, obj=137]
INFO - 13:55:09: ...  97%|█████████▋| 194/200 [00:18<00:00, 10.30 it/sec, obj=137]
INFO - 13:55:09: ...  98%|█████████▊| 195/200 [00:18<00:00, 10.29 it/sec, obj=137]
INFO - 13:55:10: ...  98%|█████████▊| 196/200 [00:19<00:00, 10.29 it/sec, obj=137]
INFO - 13:55:10: ...  98%|█████████▊| 197/200 [00:19<00:00, 10.29 it/sec, obj=137]
INFO - 13:55:10: ...  99%|█████████▉| 198/200 [00:19<00:00, 10.29 it/sec, obj=137]
INFO - 13:55:10: ... 100%|█████████▉| 199/200 [00:19<00:00, 10.29 it/sec, obj=137]
INFO - 13:55:10: ... 100%|██████████| 200/200 [00:19<00:00, 10.33 it/sec, obj=137]
INFO - 13:55:10: Optimization result:
INFO - 13:55:10:    Optimizer info:
INFO - 13:55:10:       Status: None
INFO - 13:55:10:       Message: Maximum number of iterations reached. GEMSEO Stopped the driver
INFO - 13:55:10:       Number of calls to the objective function by the optimizer: 201
INFO - 13:55:10:    Solution:
INFO - 13:55:10:       The solution is feasible.
INFO - 13:55:10:       Objective: 136.56123312100124
INFO - 13:55:10:       Standardized constraints:
INFO - 13:55:10:          [volume fraction-0.3] = -1.9140380946858215e-09
INFO - 13:55:10: *** End MDOScenario execution (time: 0:00:19.376743) ***

{'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 0x7f006e8beac0>


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 0x7f006e4a06d0>


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

Gallery generated by Sphinx-Gallery