# 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.topology_optimization.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 - 08:58:32:
INFO - 08:58:32: *** Start MDOScenario execution ***
INFO - 08:58:32: MDOScenario
INFO - 08:58:32:    Disciplines: DensityFilter FininiteElementAnalysis MaterialModelInterpolation VolumeFraction
INFO - 08:58:32:    MDO formulation: DisciplinaryOpt
INFO - 08:58:32: Optimization problem:
INFO - 08:58:32:    minimize compliance(x)
INFO - 08:58:32:    with respect to x
INFO - 08:58:32:    subject to constraints:
INFO - 08:58:32:       volume fraction(x) <= 0.3
INFO - 08:58:32: Solving optimization problem with algorithm NLOPT_MMA:
INFO - 08:58:32:      1%|          | 2/200 [00:00<00:06, 32.50 it/sec, obj=2.23e+3]
INFO - 08:58:32:      2%|▏         | 3/200 [00:00<00:05, 37.44 it/sec, obj=1.96e+3]
INFO - 08:58:32:      2%|▏         | 4/200 [00:00<00:04, 40.61 it/sec, obj=1.75e+3]
INFO - 08:58:32:      2%|▎         | 5/200 [00:00<00:04, 42.72 it/sec, obj=1.57e+3]
INFO - 08:58:32:      3%|▎         | 6/200 [00:00<00:04, 44.28 it/sec, obj=1.2e+3]
INFO - 08:58:32:      4%|▎         | 7/200 [00:00<00:04, 45.31 it/sec, obj=963]
INFO - 08:58:32:      4%|▍         | 8/200 [00:00<00:04, 46.24 it/sec, obj=624]
INFO - 08:58:32:      4%|▍         | 9/200 [00:00<00:04, 47.02 it/sec, obj=497]
INFO - 08:58:32:      5%|▌         | 10/200 [00:00<00:03, 47.57 it/sec, obj=395]
INFO - 08:58:32:      6%|▌         | 11/200 [00:00<00:03, 48.09 it/sec, obj=306]
INFO - 08:58:32:      6%|▌         | 12/200 [00:00<00:03, 48.59 it/sec, obj=251]
INFO - 08:58:32:      6%|▋         | 13/200 [00:00<00:03, 48.90 it/sec, obj=225]
INFO - 08:58:32:      7%|▋         | 14/200 [00:00<00:03, 49.29 it/sec, obj=209]
INFO - 08:58:32:      8%|▊         | 15/200 [00:00<00:03, 49.68 it/sec, obj=201]
INFO - 08:58:32:      8%|▊         | 16/200 [00:00<00:03, 50.01 it/sec, obj=195]
INFO - 08:58:32:      8%|▊         | 17/200 [00:00<00:03, 50.30 it/sec, obj=190]
INFO - 08:58:32:      9%|▉         | 18/200 [00:00<00:03, 50.62 it/sec, obj=186]
INFO - 08:58:32:     10%|▉         | 19/200 [00:00<00:03, 50.89 it/sec, obj=182]
INFO - 08:58:32:     10%|█         | 20/200 [00:00<00:03, 51.18 it/sec, obj=178]
INFO - 08:58:32:     10%|█         | 21/200 [00:00<00:03, 51.41 it/sec, obj=174]
INFO - 08:58:32:     11%|█         | 22/200 [00:00<00:03, 51.59 it/sec, obj=169]
INFO - 08:58:32:     12%|█▏        | 23/200 [00:00<00:03, 51.79 it/sec, obj=164]
INFO - 08:58:32:     12%|█▏        | 24/200 [00:00<00:03, 52.03 it/sec, obj=161]
INFO - 08:58:33:     12%|█▎        | 25/200 [00:00<00:03, 52.17 it/sec, obj=159]
INFO - 08:58:33:     13%|█▎        | 26/200 [00:00<00:03, 52.38 it/sec, obj=157]
INFO - 08:58:33:     14%|█▎        | 27/200 [00:00<00:03, 52.58 it/sec, obj=156]
INFO - 08:58:33:     14%|█▍        | 28/200 [00:00<00:03, 52.77 it/sec, obj=155]
INFO - 08:58:33:     14%|█▍        | 29/200 [00:00<00:03, 52.94 it/sec, obj=154]
INFO - 08:58:33:     15%|█▌        | 30/200 [00:00<00:03, 53.04 it/sec, obj=154]
INFO - 08:58:33:     16%|█▌        | 31/200 [00:00<00:03, 53.18 it/sec, obj=153]
INFO - 08:58:33:     16%|█▌        | 32/200 [00:00<00:03, 53.33 it/sec, obj=153]
INFO - 08:58:33:     16%|█▋        | 33/200 [00:00<00:03, 53.49 it/sec, obj=152]
INFO - 08:58:33:     17%|█▋        | 34/200 [00:00<00:03, 53.63 it/sec, obj=152]
INFO - 08:58:33:     18%|█▊        | 35/200 [00:00<00:03, 53.78 it/sec, obj=152]
INFO - 08:58:33:     18%|█▊        | 36/200 [00:00<00:03, 53.90 it/sec, obj=152]
INFO - 08:58:33:     18%|█▊        | 37/200 [00:00<00:03, 54.02 it/sec, obj=152]
INFO - 08:58:33:     19%|█▉        | 38/200 [00:00<00:02, 54.11 it/sec, obj=152]
INFO - 08:58:33:     20%|█▉        | 39/200 [00:00<00:02, 54.23 it/sec, obj=152]
INFO - 08:58:33:     20%|██        | 40/200 [00:00<00:02, 54.31 it/sec, obj=152]
INFO - 08:58:33:     20%|██        | 41/200 [00:00<00:02, 54.41 it/sec, obj=152]
INFO - 08:58:33:     21%|██        | 42/200 [00:00<00:02, 54.52 it/sec, obj=152]
INFO - 08:58:33:     22%|██▏       | 43/200 [00:00<00:02, 54.60 it/sec, obj=152]
INFO - 08:58:33:     22%|██▏       | 44/200 [00:00<00:02, 54.66 it/sec, obj=152]
INFO - 08:58:33:     22%|██▎       | 45/200 [00:00<00:02, 54.74 it/sec, obj=152]
INFO - 08:58:33:     23%|██▎       | 46/200 [00:00<00:02, 54.79 it/sec, obj=152]
INFO - 08:58:33:     24%|██▎       | 47/200 [00:00<00:02, 54.92 it/sec, obj=152]
INFO - 08:58:33:     24%|██▍       | 48/200 [00:00<00:02, 55.04 it/sec, obj=152]
INFO - 08:58:33:     24%|██▍       | 49/200 [00:00<00:02, 55.16 it/sec, obj=152]
INFO - 08:58:33:     25%|██▌       | 50/200 [00:00<00:02, 55.25 it/sec, obj=152]
INFO - 08:58:33:     26%|██▌       | 51/200 [00:00<00:02, 55.28 it/sec, obj=152]
INFO - 08:58:33:     26%|██▌       | 52/200 [00:00<00:02, 55.33 it/sec, obj=152]
INFO - 08:58:33:     26%|██▋       | 53/200 [00:00<00:02, 55.38 it/sec, obj=152]
INFO - 08:58:33:     27%|██▋       | 54/200 [00:00<00:02, 55.45 it/sec, obj=152]
INFO - 08:58:33:     28%|██▊       | 55/200 [00:00<00:02, 55.47 it/sec, obj=152]
INFO - 08:58:33:     28%|██▊       | 56/200 [00:01<00:02, 55.52 it/sec, obj=152]
INFO - 08:58:33:     28%|██▊       | 57/200 [00:01<00:02, 55.58 it/sec, obj=152]
INFO - 08:58:33:     29%|██▉       | 58/200 [00:01<00:02, 55.64 it/sec, obj=152]
INFO - 08:58:33:     30%|██▉       | 59/200 [00:01<00:02, 55.71 it/sec, obj=152]
INFO - 08:58:33:     30%|███       | 60/200 [00:01<00:02, 55.74 it/sec, obj=152]
INFO - 08:58:33:     30%|███       | 61/200 [00:01<00:02, 55.78 it/sec, obj=152]
INFO - 08:58:33:     31%|███       | 62/200 [00:01<00:02, 55.84 it/sec, obj=152]
INFO - 08:58:33:     32%|███▏      | 63/200 [00:01<00:02, 55.90 it/sec, obj=152]
INFO - 08:58:33:     32%|███▏      | 64/200 [00:01<00:02, 55.95 it/sec, obj=152]
INFO - 08:58:33:     32%|███▎      | 65/200 [00:01<00:02, 55.98 it/sec, obj=152]
INFO - 08:58:33:     33%|███▎      | 66/200 [00:01<00:02, 56.01 it/sec, obj=152]
INFO - 08:58:33:     34%|███▎      | 67/200 [00:01<00:02, 56.05 it/sec, obj=152]
INFO - 08:58:33:     34%|███▍      | 68/200 [00:01<00:02, 56.04 it/sec, obj=152]
INFO - 08:58:33:     34%|███▍      | 69/200 [00:01<00:02, 56.08 it/sec, obj=152]
INFO - 08:58:33:     35%|███▌      | 70/200 [00:01<00:02, 56.13 it/sec, obj=152]
INFO - 08:58:33:     36%|███▌      | 71/200 [00:01<00:02, 56.20 it/sec, obj=152]
INFO - 08:58:33:     36%|███▌      | 72/200 [00:01<00:02, 56.25 it/sec, obj=152]
INFO - 08:58:33:     36%|███▋      | 73/200 [00:01<00:02, 56.28 it/sec, obj=152]
INFO - 08:58:33:     37%|███▋      | 74/200 [00:01<00:02, 56.32 it/sec, obj=152]
INFO - 08:58:33:     38%|███▊      | 75/200 [00:01<00:02, 56.38 it/sec, obj=152]
INFO - 08:58:33:     38%|███▊      | 76/200 [00:01<00:02, 56.43 it/sec, obj=152]
INFO - 08:58:33:     38%|███▊      | 77/200 [00:01<00:02, 56.49 it/sec, obj=152]
INFO - 08:58:33:     39%|███▉      | 78/200 [00:01<00:02, 56.52 it/sec, obj=152]
INFO - 08:58:33:     40%|███▉      | 79/200 [00:01<00:02, 56.58 it/sec, obj=152]
INFO - 08:58:33:     40%|████      | 80/200 [00:01<00:02, 56.61 it/sec, obj=152]
INFO - 08:58:33:     40%|████      | 81/200 [00:01<00:02, 56.66 it/sec, obj=152]
INFO - 08:58:33:     41%|████      | 82/200 [00:01<00:02, 56.71 it/sec, obj=152]
INFO - 08:58:33:     42%|████▏     | 83/200 [00:01<00:02, 56.75 it/sec, obj=152]
INFO - 08:58:34:     42%|████▏     | 84/200 [00:01<00:02, 56.78 it/sec, obj=152]
INFO - 08:58:34:     42%|████▎     | 85/200 [00:01<00:02, 56.83 it/sec, obj=152]
INFO - 08:58:34:     43%|████▎     | 86/200 [00:01<00:02, 56.86 it/sec, obj=152]
INFO - 08:58:34:     44%|████▎     | 87/200 [00:01<00:01, 56.90 it/sec, obj=152]
INFO - 08:58:34:     44%|████▍     | 88/200 [00:01<00:01, 56.94 it/sec, obj=152]
INFO - 08:58:34:     44%|████▍     | 89/200 [00:01<00:01, 56.99 it/sec, obj=152]
INFO - 08:58:34:     45%|████▌     | 90/200 [00:01<00:01, 57.04 it/sec, obj=152]
INFO - 08:58:34:     46%|████▌     | 91/200 [00:01<00:01, 57.07 it/sec, obj=152]
INFO - 08:58:34:     46%|████▌     | 92/200 [00:01<00:01, 57.11 it/sec, obj=152]
INFO - 08:58:34:     46%|████▋     | 93/200 [00:01<00:01, 57.15 it/sec, obj=152]
INFO - 08:58:34:     47%|████▋     | 94/200 [00:01<00:01, 57.20 it/sec, obj=152]
INFO - 08:58:34:     48%|████▊     | 95/200 [00:01<00:01, 57.24 it/sec, obj=152]
INFO - 08:58:34:     48%|████▊     | 96/200 [00:01<00:01, 57.26 it/sec, obj=152]
INFO - 08:58:34:     48%|████▊     | 97/200 [00:01<00:01, 57.30 it/sec, obj=152]
INFO - 08:58:34:     49%|████▉     | 98/200 [00:01<00:01, 57.34 it/sec, obj=152]
INFO - 08:58:34:     50%|████▉     | 99/200 [00:01<00:01, 57.38 it/sec, obj=152]
INFO - 08:58:34:     50%|█████     | 100/200 [00:01<00:01, 57.39 it/sec, obj=152]
INFO - 08:58:34:     50%|█████     | 101/200 [00:01<00:01, 57.41 it/sec, obj=152]
INFO - 08:58:34:     51%|█████     | 102/200 [00:01<00:01, 57.45 it/sec, obj=152]
INFO - 08:58:34:     52%|█████▏    | 103/200 [00:01<00:01, 57.49 it/sec, obj=152]
INFO - 08:58:34:     52%|█████▏    | 104/200 [00:01<00:01, 57.53 it/sec, obj=152]
INFO - 08:58:34:     52%|█████▎    | 105/200 [00:01<00:01, 57.56 it/sec, obj=152]
INFO - 08:58:34:     53%|█████▎    | 106/200 [00:01<00:01, 57.59 it/sec, obj=152]
INFO - 08:58:34:     54%|█████▎    | 107/200 [00:01<00:01, 57.62 it/sec, obj=152]
INFO - 08:58:34:     54%|█████▍    | 108/200 [00:01<00:01, 57.64 it/sec, obj=152]
INFO - 08:58:34:     55%|█████▍    | 109/200 [00:01<00:01, 57.67 it/sec, obj=152]
INFO - 08:58:34:     55%|█████▌    | 110/200 [00:01<00:01, 57.70 it/sec, obj=152]
INFO - 08:58:34:     56%|█████▌    | 111/200 [00:01<00:01, 57.74 it/sec, obj=152]
INFO - 08:58:34:     56%|█████▌    | 112/200 [00:01<00:01, 57.77 it/sec, obj=152]
INFO - 08:58:34:     56%|█████▋    | 113/200 [00:01<00:01, 57.77 it/sec, obj=152]
INFO - 08:58:34:     57%|█████▋    | 114/200 [00:01<00:01, 57.80 it/sec, obj=152]
INFO - 08:58:34:     57%|█████▊    | 115/200 [00:01<00:01, 57.83 it/sec, obj=152]
INFO - 08:58:34:     58%|█████▊    | 116/200 [00:02<00:01, 57.86 it/sec, obj=152]
INFO - 08:58:34:     58%|█████▊    | 117/200 [00:02<00:01, 57.89 it/sec, obj=152]
INFO - 08:58:34:     59%|█████▉    | 118/200 [00:02<00:01, 57.93 it/sec, obj=152]
INFO - 08:58:34:     60%|█████▉    | 119/200 [00:02<00:01, 57.95 it/sec, obj=152]
INFO - 08:58:34:     60%|██████    | 120/200 [00:02<00:01, 57.97 it/sec, obj=152]
INFO - 08:58:34:     60%|██████    | 121/200 [00:02<00:01, 58.00 it/sec, obj=152]
INFO - 08:58:34:     61%|██████    | 122/200 [00:02<00:01, 58.03 it/sec, obj=152]
INFO - 08:58:34:     62%|██████▏   | 123/200 [00:02<00:01, 58.06 it/sec, obj=152]
INFO - 08:58:34:     62%|██████▏   | 124/200 [00:02<00:01, 58.09 it/sec, obj=152]
INFO - 08:58:34:     62%|██████▎   | 125/200 [00:02<00:01, 58.11 it/sec, obj=152]
INFO - 08:58:34:     63%|██████▎   | 126/200 [00:02<00:01, 58.14 it/sec, obj=152]
INFO - 08:58:34:     64%|██████▎   | 127/200 [00:02<00:01, 58.17 it/sec, obj=152]
INFO - 08:58:34:     64%|██████▍   | 128/200 [00:02<00:01, 58.19 it/sec, obj=152]
INFO - 08:58:34:     64%|██████▍   | 129/200 [00:02<00:01, 58.22 it/sec, obj=152]
INFO - 08:58:34:     65%|██████▌   | 130/200 [00:02<00:01, 58.24 it/sec, obj=152]
INFO - 08:58:34:     66%|██████▌   | 131/200 [00:02<00:01, 58.27 it/sec, obj=152]
INFO - 08:58:34:     66%|██████▌   | 132/200 [00:02<00:01, 58.27 it/sec, obj=152]
INFO - 08:58:34:     66%|██████▋   | 133/200 [00:02<00:01, 58.25 it/sec, obj=152]
INFO - 08:58:34:     67%|██████▋   | 134/200 [00:02<00:01, 58.27 it/sec, obj=152]
INFO - 08:58:34:     68%|██████▊   | 135/200 [00:02<00:01, 58.28 it/sec, obj=152]
INFO - 08:58:34:     68%|██████▊   | 136/200 [00:02<00:01, 58.30 it/sec, obj=152]
INFO - 08:58:34:     68%|██████▊   | 137/200 [00:02<00:01, 58.32 it/sec, obj=152]
INFO - 08:58:34:     69%|██████▉   | 138/200 [00:02<00:01, 58.34 it/sec, obj=152]
INFO - 08:58:34:     70%|██████▉   | 139/200 [00:02<00:01, 58.36 it/sec, obj=152]
INFO - 08:58:34:     70%|███████   | 140/200 [00:02<00:01, 58.39 it/sec, obj=152]
INFO - 08:58:34:     70%|███████   | 141/200 [00:02<00:01, 58.41 it/sec, obj=152]
INFO - 08:58:34:     71%|███████   | 142/200 [00:02<00:00, 58.43 it/sec, obj=152]
INFO - 08:58:34:     72%|███████▏  | 143/200 [00:02<00:00, 58.45 it/sec, obj=152]
INFO - 08:58:34:     72%|███████▏  | 144/200 [00:02<00:00, 58.47 it/sec, obj=152]
INFO - 08:58:35:     72%|███████▎  | 145/200 [00:02<00:00, 58.49 it/sec, obj=152]
INFO - 08:58:35:     73%|███████▎  | 146/200 [00:02<00:00, 58.50 it/sec, obj=152]
INFO - 08:58:35:     74%|███████▎  | 147/200 [00:02<00:00, 58.52 it/sec, obj=152]
INFO - 08:58:35:     74%|███████▍  | 148/200 [00:02<00:00, 58.53 it/sec, obj=152]
INFO - 08:58:35:     74%|███████▍  | 149/200 [00:02<00:00, 58.54 it/sec, obj=152]
INFO - 08:58:35:     75%|███████▌  | 150/200 [00:02<00:00, 58.55 it/sec, obj=152]
INFO - 08:58:35:     76%|███████▌  | 151/200 [00:02<00:00, 58.56 it/sec, obj=152]
INFO - 08:58:35:     76%|███████▌  | 152/200 [00:02<00:00, 58.57 it/sec, obj=152]
INFO - 08:58:35:     76%|███████▋  | 153/200 [00:02<00:00, 58.58 it/sec, obj=152]
INFO - 08:58:35:     77%|███████▋  | 154/200 [00:02<00:00, 58.60 it/sec, obj=152]
INFO - 08:58:35:     78%|███████▊  | 155/200 [00:02<00:00, 58.62 it/sec, obj=152]
INFO - 08:58:35:     78%|███████▊  | 156/200 [00:02<00:00, 58.64 it/sec, obj=152]
INFO - 08:58:35:     78%|███████▊  | 157/200 [00:02<00:00, 58.66 it/sec, obj=152]
INFO - 08:58:35:     79%|███████▉  | 158/200 [00:02<00:00, 58.67 it/sec, obj=152]
INFO - 08:58:35:     80%|███████▉  | 159/200 [00:02<00:00, 58.68 it/sec, obj=152]
INFO - 08:58:35:     80%|████████  | 160/200 [00:02<00:00, 58.69 it/sec, obj=152]
INFO - 08:58:35:     80%|████████  | 161/200 [00:02<00:00, 58.70 it/sec, obj=152]
INFO - 08:58:35:     81%|████████  | 162/200 [00:02<00:00, 58.72 it/sec, obj=152]
INFO - 08:58:35:     82%|████████▏ | 163/200 [00:02<00:00, 58.74 it/sec, obj=152]
INFO - 08:58:35:     82%|████████▏ | 164/200 [00:02<00:00, 58.75 it/sec, obj=152]
INFO - 08:58:35:     82%|████████▎ | 165/200 [00:02<00:00, 58.76 it/sec, obj=152]
INFO - 08:58:35:     83%|████████▎ | 166/200 [00:02<00:00, 58.76 it/sec, obj=152]
INFO - 08:58:35:     84%|████████▎ | 167/200 [00:02<00:00, 58.77 it/sec, obj=152]
INFO - 08:58:35:     84%|████████▍ | 168/200 [00:02<00:00, 58.78 it/sec, obj=152]
INFO - 08:58:35:     84%|████████▍ | 169/200 [00:02<00:00, 58.79 it/sec, obj=152]
INFO - 08:58:35:     85%|████████▌ | 170/200 [00:02<00:00, 58.81 it/sec, obj=152]
INFO - 08:58:35:     86%|████████▌ | 171/200 [00:02<00:00, 58.82 it/sec, obj=152]
INFO - 08:58:35:     86%|████████▌ | 172/200 [00:02<00:00, 58.82 it/sec, obj=152]
INFO - 08:58:35:     86%|████████▋ | 173/200 [00:02<00:00, 58.83 it/sec, obj=152]
INFO - 08:58:35:     87%|████████▋ | 174/200 [00:02<00:00, 58.83 it/sec, obj=152]
INFO - 08:58:35:     88%|████████▊ | 175/200 [00:02<00:00, 58.85 it/sec, obj=152]
INFO - 08:58:35:     88%|████████▊ | 176/200 [00:02<00:00, 58.86 it/sec, obj=152]
INFO - 08:58:35:     88%|████████▊ | 177/200 [00:03<00:00, 58.87 it/sec, obj=152]
INFO - 08:58:35:     89%|████████▉ | 178/200 [00:03<00:00, 58.88 it/sec, obj=152]
INFO - 08:58:35:     90%|████████▉ | 179/200 [00:03<00:00, 58.90 it/sec, obj=152]
INFO - 08:58:35:     90%|█████████ | 180/200 [00:03<00:00, 58.91 it/sec, obj=152]
INFO - 08:58:35:     90%|█████████ | 181/200 [00:03<00:00, 58.92 it/sec, obj=152]
INFO - 08:58:35:     91%|█████████ | 182/200 [00:03<00:00, 58.93 it/sec, obj=152]
INFO - 08:58:35:     92%|█████████▏| 183/200 [00:03<00:00, 58.94 it/sec, obj=152]
INFO - 08:58:35:     92%|█████████▏| 184/200 [00:03<00:00, 58.95 it/sec, obj=152]
INFO - 08:58:35:     92%|█████████▎| 185/200 [00:03<00:00, 58.96 it/sec, obj=152]
INFO - 08:58:35:     93%|█████████▎| 186/200 [00:03<00:00, 58.97 it/sec, obj=152]
INFO - 08:58:35:     94%|█████████▎| 187/200 [00:03<00:00, 58.98 it/sec, obj=152]
INFO - 08:58:35:     94%|█████████▍| 188/200 [00:03<00:00, 58.99 it/sec, obj=152]
INFO - 08:58:35:     94%|█████████▍| 189/200 [00:03<00:00, 58.98 it/sec, obj=152]
INFO - 08:58:35:     95%|█████████▌| 190/200 [00:03<00:00, 58.99 it/sec, obj=152]
INFO - 08:58:35:     96%|█████████▌| 191/200 [00:03<00:00, 59.01 it/sec, obj=152]
INFO - 08:58:35:     96%|█████████▌| 192/200 [00:03<00:00, 59.02 it/sec, obj=152]
INFO - 08:58:35:     96%|█████████▋| 193/200 [00:03<00:00, 59.03 it/sec, obj=152]
INFO - 08:58:35:     97%|█████████▋| 194/200 [00:03<00:00, 59.05 it/sec, obj=152]
INFO - 08:58:35:     98%|█████████▊| 195/200 [00:03<00:00, 59.05 it/sec, obj=152]
INFO - 08:58:35:     98%|█████████▊| 196/200 [00:03<00:00, 59.07 it/sec, obj=152]
INFO - 08:58:35:     98%|█████████▊| 197/200 [00:03<00:00, 59.08 it/sec, obj=152]
INFO - 08:58:35:     99%|█████████▉| 198/200 [00:03<00:00, 59.09 it/sec, obj=152]
INFO - 08:58:35:    100%|█████████▉| 199/200 [00:03<00:00, 59.10 it/sec, obj=152]
INFO - 08:58:35:    100%|██████████| 200/200 [00:03<00:00, 59.28 it/sec, obj=152]
INFO - 08:58:35: Optimization result:
INFO - 08:58:35:    Optimizer info:
INFO - 08:58:35:       Status: None
INFO - 08:58:35:       Message: Maximum number of iterations reached. GEMSEO Stopped the driver
INFO - 08:58:35:       Number of calls to the objective function by the optimizer: 201
INFO - 08:58:35:    Solution:
INFO - 08:58:35:       The solution is feasible.
INFO - 08:58:35:       Objective: 151.6287318635838
INFO - 08:58:35:       Standardized constraints:
INFO - 08:58:35:          [volume fraction-0.3] = 1.0976701955156543e-06
INFO - 08:58:35: *** End MDOScenario execution (time: 0:00:03.387657) ***

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


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


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

Gallery generated by Sphinx-Gallery