# 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,
"DisciplinaryOpt",
"compliance",
design_space,
)


Add the volume fraction constraint to the scenario:

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


Generate the XDSM

scenario.xdsmize()


Execute the scenario

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

    INFO - 09:04:54:
INFO - 09:04:54: *** Start MDOScenario execution ***
INFO - 09:04:54: MDOScenario
INFO - 09:04:54:    Disciplines: DensityFilter FininiteElementAnalysis MaterialModelInterpolation VolumeFraction
INFO - 09:04:54:    MDO formulation: DisciplinaryOpt
INFO - 09:04:54: Optimization problem:
INFO - 09:04:54:    minimize compliance(x)
INFO - 09:04:54:    with respect to x
INFO - 09:04:54:    subject to constraints:
INFO - 09:04:54:       volume fraction(x) <= 0.3
INFO - 09:04:54: Solving optimization problem with algorithm NLOPT_MMA:
INFO - 09:04:54:      1%|          | 2/200 [00:00<00:07, 28.02 it/sec, obj=2.23e+3]
INFO - 09:04:54:      2%|▏         | 3/200 [00:00<00:06, 32.00 it/sec, obj=1.96e+3]
INFO - 09:04:54:      2%|▏         | 4/200 [00:00<00:05, 34.45 it/sec, obj=1.75e+3]
INFO - 09:04:54:      2%|▎         | 5/200 [00:00<00:05, 36.03 it/sec, obj=1.57e+3]
INFO - 09:04:54:      3%|▎         | 6/200 [00:00<00:05, 37.28 it/sec, obj=1.2e+3]
INFO - 09:04:54:      4%|▎         | 7/200 [00:00<00:05, 38.19 it/sec, obj=963]
INFO - 09:04:54:      4%|▍         | 8/200 [00:00<00:04, 38.81 it/sec, obj=624]
INFO - 09:04:54:      4%|▍         | 9/200 [00:00<00:04, 39.28 it/sec, obj=497]
INFO - 09:04:54:      5%|▌         | 10/200 [00:00<00:04, 39.71 it/sec, obj=395]
INFO - 09:04:54:      6%|▌         | 11/200 [00:00<00:04, 40.17 it/sec, obj=306]
INFO - 09:04:54:      6%|▌         | 12/200 [00:00<00:04, 40.63 it/sec, obj=251]
INFO - 09:04:54:      6%|▋         | 13/200 [00:00<00:04, 41.01 it/sec, obj=225]
INFO - 09:04:54:      7%|▋         | 14/200 [00:00<00:04, 41.30 it/sec, obj=209]
INFO - 09:04:54:      8%|▊         | 15/200 [00:00<00:04, 41.35 it/sec, obj=201]
INFO - 09:04:54:      8%|▊         | 16/200 [00:00<00:04, 41.56 it/sec, obj=195]
INFO - 09:04:54:      8%|▊         | 17/200 [00:00<00:04, 41.76 it/sec, obj=190]
INFO - 09:04:54:      9%|▉         | 18/200 [00:00<00:04, 41.96 it/sec, obj=186]
INFO - 09:04:54:     10%|▉         | 19/200 [00:00<00:04, 42.10 it/sec, obj=182]
INFO - 09:04:54:     10%|█         | 20/200 [00:00<00:04, 42.30 it/sec, obj=178]
INFO - 09:04:54:     10%|█         | 21/200 [00:00<00:04, 42.41 it/sec, obj=174]
INFO - 09:04:54:     11%|█         | 22/200 [00:00<00:04, 42.42 it/sec, obj=169]
INFO - 09:04:54:     12%|█▏        | 23/200 [00:00<00:04, 42.53 it/sec, obj=164]
INFO - 09:04:54:     12%|█▏        | 24/200 [00:00<00:04, 42.72 it/sec, obj=161]
INFO - 09:04:54:     12%|█▎        | 25/200 [00:00<00:04, 42.90 it/sec, obj=159]
INFO - 09:04:54:     13%|█▎        | 26/200 [00:00<00:04, 43.08 it/sec, obj=157]
INFO - 09:04:54:     14%|█▎        | 27/200 [00:00<00:04, 43.24 it/sec, obj=156]
INFO - 09:04:54:     14%|█▍        | 28/200 [00:00<00:03, 43.39 it/sec, obj=155]
INFO - 09:04:54:     14%|█▍        | 29/200 [00:00<00:03, 43.52 it/sec, obj=154]
INFO - 09:04:55:     15%|█▌        | 30/200 [00:00<00:03, 43.66 it/sec, obj=154]
INFO - 09:04:55:     16%|█▌        | 31/200 [00:00<00:03, 43.78 it/sec, obj=153]
INFO - 09:04:55:     16%|█▌        | 32/200 [00:00<00:03, 43.89 it/sec, obj=153]
INFO - 09:04:55:     16%|█▋        | 33/200 [00:00<00:03, 44.02 it/sec, obj=152]
INFO - 09:04:55:     17%|█▋        | 34/200 [00:00<00:03, 44.09 it/sec, obj=152]
INFO - 09:04:55:     18%|█▊        | 35/200 [00:00<00:03, 44.20 it/sec, obj=152]
INFO - 09:04:55:     18%|█▊        | 36/200 [00:00<00:03, 44.30 it/sec, obj=152]
INFO - 09:04:55:     18%|█▊        | 37/200 [00:00<00:03, 44.40 it/sec, obj=152]
INFO - 09:04:55:     19%|█▉        | 38/200 [00:00<00:03, 44.49 it/sec, obj=152]
INFO - 09:04:55:     20%|█▉        | 39/200 [00:00<00:03, 44.59 it/sec, obj=152]
INFO - 09:04:55:     20%|██        | 40/200 [00:00<00:03, 44.69 it/sec, obj=152]
INFO - 09:04:55:     20%|██        | 41/200 [00:00<00:03, 44.79 it/sec, obj=152]
INFO - 09:04:55:     21%|██        | 42/200 [00:00<00:03, 44.89 it/sec, obj=152]
INFO - 09:04:55:     22%|██▏       | 43/200 [00:00<00:03, 44.97 it/sec, obj=152]
INFO - 09:04:55:     22%|██▏       | 44/200 [00:00<00:03, 45.06 it/sec, obj=152]
INFO - 09:04:55:     22%|██▎       | 45/200 [00:00<00:03, 45.15 it/sec, obj=152]
INFO - 09:04:55:     23%|██▎       | 46/200 [00:01<00:03, 45.22 it/sec, obj=152]
INFO - 09:04:55:     24%|██▎       | 47/200 [00:01<00:03, 45.32 it/sec, obj=152]
INFO - 09:04:55:     24%|██▍       | 48/200 [00:01<00:03, 45.42 it/sec, obj=152]
INFO - 09:04:55:     24%|██▍       | 49/200 [00:01<00:03, 45.53 it/sec, obj=152]
INFO - 09:04:55:     25%|██▌       | 50/200 [00:01<00:03, 45.61 it/sec, obj=152]
INFO - 09:04:55:     26%|██▌       | 51/200 [00:01<00:03, 45.68 it/sec, obj=152]
INFO - 09:04:55:     26%|██▌       | 52/200 [00:01<00:03, 45.75 it/sec, obj=152]
INFO - 09:04:55:     26%|██▋       | 53/200 [00:01<00:03, 45.78 it/sec, obj=152]
INFO - 09:04:55:     27%|██▋       | 54/200 [00:01<00:03, 45.83 it/sec, obj=152]
INFO - 09:04:55:     28%|██▊       | 55/200 [00:01<00:03, 45.88 it/sec, obj=152]
INFO - 09:04:55:     28%|██▊       | 56/200 [00:01<00:03, 45.94 it/sec, obj=152]
INFO - 09:04:55:     28%|██▊       | 57/200 [00:01<00:03, 45.99 it/sec, obj=152]
INFO - 09:04:55:     29%|██▉       | 58/200 [00:01<00:03, 46.04 it/sec, obj=152]
INFO - 09:04:55:     30%|██▉       | 59/200 [00:01<00:03, 46.09 it/sec, obj=152]
INFO - 09:04:55:     30%|███       | 60/200 [00:01<00:03, 46.15 it/sec, obj=152]
INFO - 09:04:55:     30%|███       | 61/200 [00:01<00:03, 46.20 it/sec, obj=152]
INFO - 09:04:55:     31%|███       | 62/200 [00:01<00:02, 46.25 it/sec, obj=152]
INFO - 09:04:55:     32%|███▏      | 63/200 [00:01<00:02, 46.30 it/sec, obj=152]
INFO - 09:04:55:     32%|███▏      | 64/200 [00:01<00:02, 46.35 it/sec, obj=152]
INFO - 09:04:55:     32%|███▎      | 65/200 [00:01<00:02, 46.39 it/sec, obj=152]
INFO - 09:04:55:     33%|███▎      | 66/200 [00:01<00:02, 46.41 it/sec, obj=152]
INFO - 09:04:55:     34%|███▎      | 67/200 [00:01<00:02, 46.45 it/sec, obj=152]
INFO - 09:04:55:     34%|███▍      | 68/200 [00:01<00:02, 46.49 it/sec, obj=152]
INFO - 09:04:55:     34%|███▍      | 69/200 [00:01<00:02, 46.53 it/sec, obj=152]
INFO - 09:04:55:     35%|███▌      | 70/200 [00:01<00:02, 46.56 it/sec, obj=152]
INFO - 09:04:55:     36%|███▌      | 71/200 [00:01<00:02, 46.61 it/sec, obj=152]
INFO - 09:04:55:     36%|███▌      | 72/200 [00:01<00:02, 46.64 it/sec, obj=152]
INFO - 09:04:55:     36%|███▋      | 73/200 [00:01<00:02, 46.68 it/sec, obj=152]
INFO - 09:04:55:     37%|███▋      | 74/200 [00:01<00:02, 46.68 it/sec, obj=152]
INFO - 09:04:55:     38%|███▊      | 75/200 [00:01<00:02, 46.74 it/sec, obj=152]
INFO - 09:04:55:     38%|███▊      | 76/200 [00:01<00:02, 46.76 it/sec, obj=152]
INFO - 09:04:55:     38%|███▊      | 77/200 [00:01<00:02, 46.82 it/sec, obj=152]
INFO - 09:04:55:     39%|███▉      | 78/200 [00:01<00:02, 46.84 it/sec, obj=152]
INFO - 09:04:56:     40%|███▉      | 79/200 [00:01<00:02, 46.89 it/sec, obj=152]
INFO - 09:04:56:     40%|████      | 80/200 [00:01<00:02, 46.92 it/sec, obj=152]
INFO - 09:04:56:     40%|████      | 81/200 [00:01<00:02, 46.97 it/sec, obj=152]
INFO - 09:04:56:     41%|████      | 82/200 [00:01<00:02, 47.02 it/sec, obj=152]
INFO - 09:04:56:     42%|████▏     | 83/200 [00:01<00:02, 47.05 it/sec, obj=152]
INFO - 09:04:56:     42%|████▏     | 84/200 [00:01<00:02, 47.08 it/sec, obj=152]
INFO - 09:04:56:     42%|████▎     | 85/200 [00:01<00:02, 47.12 it/sec, obj=152]
INFO - 09:04:56:     43%|████▎     | 86/200 [00:01<00:02, 47.14 it/sec, obj=152]
INFO - 09:04:56:     44%|████▎     | 87/200 [00:01<00:02, 47.18 it/sec, obj=152]
INFO - 09:04:56:     44%|████▍     | 88/200 [00:01<00:02, 47.22 it/sec, obj=152]
INFO - 09:04:56:     44%|████▍     | 89/200 [00:01<00:02, 47.26 it/sec, obj=152]
INFO - 09:04:56:     45%|████▌     | 90/200 [00:01<00:02, 47.30 it/sec, obj=152]
INFO - 09:04:56:     46%|████▌     | 91/200 [00:01<00:02, 47.33 it/sec, obj=152]
INFO - 09:04:56:     46%|████▌     | 92/200 [00:01<00:02, 47.37 it/sec, obj=152]
INFO - 09:04:56:     46%|████▋     | 93/200 [00:01<00:02, 47.39 it/sec, obj=152]
INFO - 09:04:56:     47%|████▋     | 94/200 [00:01<00:02, 47.43 it/sec, obj=152]
INFO - 09:04:56:     48%|████▊     | 95/200 [00:02<00:02, 47.46 it/sec, obj=152]
INFO - 09:04:56:     48%|████▊     | 96/200 [00:02<00:02, 47.48 it/sec, obj=152]
INFO - 09:04:56:     48%|████▊     | 97/200 [00:02<00:02, 47.51 it/sec, obj=152]
INFO - 09:04:56:     49%|████▉     | 98/200 [00:02<00:02, 47.54 it/sec, obj=152]
INFO - 09:04:56:     50%|████▉     | 99/200 [00:02<00:02, 47.57 it/sec, obj=152]
INFO - 09:04:56:     50%|█████     | 100/200 [00:02<00:02, 47.61 it/sec, obj=152]
INFO - 09:04:56:     50%|█████     | 101/200 [00:02<00:02, 47.61 it/sec, obj=152]
INFO - 09:04:56:     51%|█████     | 102/200 [00:02<00:02, 47.63 it/sec, obj=152]
INFO - 09:04:56:     52%|█████▏    | 103/200 [00:02<00:02, 47.67 it/sec, obj=152]
INFO - 09:04:56:     52%|█████▏    | 104/200 [00:02<00:02, 47.70 it/sec, obj=152]
INFO - 09:04:56:     52%|█████▎    | 105/200 [00:02<00:01, 47.71 it/sec, obj=152]
INFO - 09:04:56:     53%|█████▎    | 106/200 [00:02<00:01, 47.73 it/sec, obj=152]
INFO - 09:04:56:     54%|█████▎    | 107/200 [00:02<00:01, 47.75 it/sec, obj=152]
INFO - 09:04:56:     54%|█████▍    | 108/200 [00:02<00:01, 47.76 it/sec, obj=152]
INFO - 09:04:56:     55%|█████▍    | 109/200 [00:02<00:01, 47.79 it/sec, obj=152]
INFO - 09:04:56:     55%|█████▌    | 110/200 [00:02<00:01, 47.82 it/sec, obj=152]
INFO - 09:04:56:     56%|█████▌    | 111/200 [00:02<00:01, 47.85 it/sec, obj=152]
INFO - 09:04:56:     56%|█████▌    | 112/200 [00:02<00:01, 47.86 it/sec, obj=152]
INFO - 09:04:56:     56%|█████▋    | 113/200 [00:02<00:01, 47.86 it/sec, obj=152]
INFO - 09:04:56:     57%|█████▋    | 114/200 [00:02<00:01, 47.88 it/sec, obj=152]
INFO - 09:04:56:     57%|█████▊    | 115/200 [00:02<00:01, 47.89 it/sec, obj=152]
INFO - 09:04:56:     58%|█████▊    | 116/200 [00:02<00:01, 47.90 it/sec, obj=152]
INFO - 09:04:56:     58%|█████▊    | 117/200 [00:02<00:01, 47.92 it/sec, obj=152]
INFO - 09:04:56:     59%|█████▉    | 118/200 [00:02<00:01, 47.93 it/sec, obj=152]
INFO - 09:04:56:     60%|█████▉    | 119/200 [00:02<00:01, 47.96 it/sec, obj=152]
INFO - 09:04:56:     60%|██████    | 120/200 [00:02<00:01, 47.96 it/sec, obj=152]
INFO - 09:04:56:     60%|██████    | 121/200 [00:02<00:01, 47.98 it/sec, obj=152]
INFO - 09:04:56:     61%|██████    | 122/200 [00:02<00:01, 47.99 it/sec, obj=152]
INFO - 09:04:56:     62%|██████▏   | 123/200 [00:02<00:01, 48.00 it/sec, obj=152]
INFO - 09:04:56:     62%|██████▏   | 124/200 [00:02<00:01, 48.02 it/sec, obj=152]
INFO - 09:04:56:     62%|██████▎   | 125/200 [00:02<00:01, 48.02 it/sec, obj=152]
INFO - 09:04:56:     63%|██████▎   | 126/200 [00:02<00:01, 48.03 it/sec, obj=152]
INFO - 09:04:56:     64%|██████▎   | 127/200 [00:02<00:01, 48.05 it/sec, obj=152]
INFO - 09:04:56:     64%|██████▍   | 128/200 [00:02<00:01, 48.07 it/sec, obj=152]
INFO - 09:04:57:     64%|██████▍   | 129/200 [00:02<00:01, 48.09 it/sec, obj=152]
INFO - 09:04:57:     65%|██████▌   | 130/200 [00:02<00:01, 48.11 it/sec, obj=152]
INFO - 09:04:57:     66%|██████▌   | 131/200 [00:02<00:01, 48.14 it/sec, obj=152]
INFO - 09:04:57:     66%|██████▌   | 132/200 [00:02<00:01, 48.15 it/sec, obj=152]
INFO - 09:04:57:     66%|██████▋   | 133/200 [00:02<00:01, 48.16 it/sec, obj=152]
INFO - 09:04:57:     67%|██████▋   | 134/200 [00:02<00:01, 48.17 it/sec, obj=152]
INFO - 09:04:57:     68%|██████▊   | 135/200 [00:02<00:01, 48.17 it/sec, obj=152]
INFO - 09:04:57:     68%|██████▊   | 136/200 [00:02<00:01, 48.17 it/sec, obj=152]
INFO - 09:04:57:     68%|██████▊   | 137/200 [00:02<00:01, 48.18 it/sec, obj=152]
INFO - 09:04:57:     69%|██████▉   | 138/200 [00:02<00:01, 48.19 it/sec, obj=152]
INFO - 09:04:57:     70%|██████▉   | 139/200 [00:02<00:01, 48.20 it/sec, obj=152]
INFO - 09:04:57:     70%|███████   | 140/200 [00:02<00:01, 48.21 it/sec, obj=152]
INFO - 09:04:57:     70%|███████   | 141/200 [00:02<00:01, 48.23 it/sec, obj=152]
INFO - 09:04:57:     71%|███████   | 142/200 [00:02<00:01, 48.25 it/sec, obj=152]
INFO - 09:04:57:     72%|███████▏  | 143/200 [00:02<00:01, 48.27 it/sec, obj=152]
INFO - 09:04:57:     72%|███████▏  | 144/200 [00:02<00:01, 48.29 it/sec, obj=152]
INFO - 09:04:57:     72%|███████▎  | 145/200 [00:03<00:01, 48.31 it/sec, obj=152]
INFO - 09:04:57:     73%|███████▎  | 146/200 [00:03<00:01, 48.32 it/sec, obj=152]
INFO - 09:04:57:     74%|███████▎  | 147/200 [00:03<00:01, 48.34 it/sec, obj=152]
INFO - 09:04:57:     74%|███████▍  | 148/200 [00:03<00:01, 48.36 it/sec, obj=152]
INFO - 09:04:57:     74%|███████▍  | 149/200 [00:03<00:01, 48.37 it/sec, obj=152]
INFO - 09:04:57:     75%|███████▌  | 150/200 [00:03<00:01, 48.39 it/sec, obj=152]
INFO - 09:04:57:     76%|███████▌  | 151/200 [00:03<00:01, 48.41 it/sec, obj=152]
INFO - 09:04:57:     76%|███████▌  | 152/200 [00:03<00:00, 48.43 it/sec, obj=152]
INFO - 09:04:57:     76%|███████▋  | 153/200 [00:03<00:00, 48.44 it/sec, obj=152]
INFO - 09:04:57:     77%|███████▋  | 154/200 [00:03<00:00, 48.45 it/sec, obj=152]
INFO - 09:04:57:     78%|███████▊  | 155/200 [00:03<00:00, 48.44 it/sec, obj=152]
INFO - 09:04:57:     78%|███████▊  | 156/200 [00:03<00:00, 48.46 it/sec, obj=152]
INFO - 09:04:57:     78%|███████▊  | 157/200 [00:03<00:00, 48.48 it/sec, obj=152]
INFO - 09:04:57:     79%|███████▉  | 158/200 [00:03<00:00, 48.49 it/sec, obj=152]
INFO - 09:04:57:     80%|███████▉  | 159/200 [00:03<00:00, 48.51 it/sec, obj=152]
INFO - 09:04:57:     80%|████████  | 160/200 [00:03<00:00, 48.52 it/sec, obj=152]
INFO - 09:04:57:     80%|████████  | 161/200 [00:03<00:00, 48.54 it/sec, obj=152]
INFO - 09:04:57:     81%|████████  | 162/200 [00:03<00:00, 48.55 it/sec, obj=152]
INFO - 09:04:57:     82%|████████▏ | 163/200 [00:03<00:00, 48.57 it/sec, obj=152]
INFO - 09:04:57:     82%|████████▏ | 164/200 [00:03<00:00, 48.58 it/sec, obj=152]
INFO - 09:04:57:     82%|████████▎ | 165/200 [00:03<00:00, 48.60 it/sec, obj=152]
INFO - 09:04:57:     83%|████████▎ | 166/200 [00:03<00:00, 48.60 it/sec, obj=152]
INFO - 09:04:57:     84%|████████▎ | 167/200 [00:03<00:00, 48.62 it/sec, obj=152]
INFO - 09:04:57:     84%|████████▍ | 168/200 [00:03<00:00, 48.63 it/sec, obj=152]
INFO - 09:04:57:     84%|████████▍ | 169/200 [00:03<00:00, 48.65 it/sec, obj=152]
INFO - 09:04:57:     85%|████████▌ | 170/200 [00:03<00:00, 48.66 it/sec, obj=152]
INFO - 09:04:57:     86%|████████▌ | 171/200 [00:03<00:00, 48.67 it/sec, obj=152]
INFO - 09:04:57:     86%|████████▌ | 172/200 [00:03<00:00, 48.68 it/sec, obj=152]
INFO - 09:04:57:     86%|████████▋ | 173/200 [00:03<00:00, 48.69 it/sec, obj=152]
INFO - 09:04:57:     87%|████████▋ | 174/200 [00:03<00:00, 48.70 it/sec, obj=152]
INFO - 09:04:57:     88%|████████▊ | 175/200 [00:03<00:00, 48.70 it/sec, obj=152]
INFO - 09:04:57:     88%|████████▊ | 176/200 [00:03<00:00, 48.72 it/sec, obj=152]
INFO - 09:04:57:     88%|████████▊ | 177/200 [00:03<00:00, 48.73 it/sec, obj=152]
INFO - 09:04:57:     89%|████████▉ | 178/200 [00:03<00:00, 48.75 it/sec, obj=152]
INFO - 09:04:57:     90%|████████▉ | 179/200 [00:03<00:00, 48.76 it/sec, obj=152]
INFO - 09:04:58:     90%|█████████ | 180/200 [00:03<00:00, 48.77 it/sec, obj=152]
INFO - 09:04:58:     90%|█████████ | 181/200 [00:03<00:00, 48.78 it/sec, obj=152]
INFO - 09:04:58:     91%|█████████ | 182/200 [00:03<00:00, 48.80 it/sec, obj=152]
INFO - 09:04:58:     92%|█████████▏| 183/200 [00:03<00:00, 48.81 it/sec, obj=152]
INFO - 09:04:58:     92%|█████████▏| 184/200 [00:03<00:00, 48.82 it/sec, obj=152]
INFO - 09:04:58:     92%|█████████▎| 185/200 [00:03<00:00, 48.84 it/sec, obj=152]
INFO - 09:04:58:     93%|█████████▎| 186/200 [00:03<00:00, 48.85 it/sec, obj=152]
INFO - 09:04:58:     94%|█████████▎| 187/200 [00:03<00:00, 48.86 it/sec, obj=152]
INFO - 09:04:58:     94%|█████████▍| 188/200 [00:03<00:00, 48.87 it/sec, obj=152]
INFO - 09:04:58:     94%|█████████▍| 189/200 [00:03<00:00, 48.88 it/sec, obj=152]
INFO - 09:04:58:     95%|█████████▌| 190/200 [00:03<00:00, 48.89 it/sec, obj=152]
INFO - 09:04:58:     96%|█████████▌| 191/200 [00:03<00:00, 48.90 it/sec, obj=152]
INFO - 09:04:58:     96%|█████████▌| 192/200 [00:03<00:00, 48.91 it/sec, obj=152]
INFO - 09:04:58:     96%|█████████▋| 193/200 [00:03<00:00, 48.92 it/sec, obj=152]
INFO - 09:04:58:     97%|█████████▋| 194/200 [00:03<00:00, 48.92 it/sec, obj=152]
INFO - 09:04:58:     98%|█████████▊| 195/200 [00:03<00:00, 48.93 it/sec, obj=152]
INFO - 09:04:58:     98%|█████████▊| 196/200 [00:04<00:00, 48.94 it/sec, obj=152]
INFO - 09:04:58:     98%|█████████▊| 197/200 [00:04<00:00, 48.95 it/sec, obj=152]
INFO - 09:04:58:     99%|█████████▉| 198/200 [00:04<00:00, 48.96 it/sec, obj=152]
INFO - 09:04:58:    100%|█████████▉| 199/200 [00:04<00:00, 48.97 it/sec, obj=152]
INFO - 09:04:58:    100%|██████████| 200/200 [00:04<00:00, 49.13 it/sec, obj=152]
INFO - 09:04:58: Optimization result:
INFO - 09:04:58:    Optimizer info:
INFO - 09:04:58:       Status: None
INFO - 09:04:58:       Message: Maximum number of iterations reached. GEMSEO Stopped the driver
INFO - 09:04:58:       Number of calls to the objective function by the optimizer: 201
INFO - 09:04:58:    Solution:
INFO - 09:04:58:       The solution is feasible.
INFO - 09:04:58:       Objective: 151.6287318635838
INFO - 09:04:58:       Standardized constraints:
INFO - 09:04:58:          [volume fraction-0.3] = 1.0976701955156543e-06
INFO - 09:04:58: *** End MDOScenario execution (time: 0:00:04.085942) ***

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


## Results¶

Post-process the optimization history:

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

/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/stable/lib/python3.9/site-packages/gemseo/datasets/dataset.py:490: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling frame.insert many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use newframe = frame.copy()
self[columns] = value

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


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


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

Gallery generated by Sphinx-Gallery