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.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 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,
    "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 - 10:43:04:
    INFO - 10:43:04: *** Start MDOScenario execution ***
    INFO - 10:43:04: MDOScenario
    INFO - 10:43:04:    Disciplines: DensityFilter FiniteElementAnalysis MaterialModelInterpolation VolumeFraction
    INFO - 10:43:04:    MDO formulation: DisciplinaryOpt
    INFO - 10:43:04: Optimization problem:
    INFO - 10:43:04:    minimize compliance(x)
    INFO - 10:43:04:    with respect to x
    INFO - 10:43:04:    subject to constraints:
    INFO - 10:43:04:       volume fraction(x) <= 0.3
    INFO - 10:43:04: Solving optimization problem with algorithm NLOPT_MMA:
    INFO - 10:43:05:      1%|          | 2/200 [00:00<00:11, 16.54 it/sec, obj=1.46e+3]
    INFO - 10:43:05:      2%|▏         | 3/200 [00:00<00:10, 18.48 it/sec, obj=1.45e+3]
    INFO - 10:43:05:      2%|▏         | 4/200 [00:00<00:09, 19.63 it/sec, obj=1.45e+3]
    INFO - 10:43:05:      2%|▎         | 5/200 [00:00<00:09, 20.29 it/sec, obj=1.45e+3]
    INFO - 10:43:05:      3%|▎         | 6/200 [00:00<00:09, 20.77 it/sec, obj=1.43e+3]
    INFO - 10:43:05:      4%|▎         | 7/200 [00:00<00:09, 21.19 it/sec, obj=1.4e+3]
    INFO - 10:43:05:      4%|▍         | 8/200 [00:00<00:08, 21.41 it/sec, obj=1.36e+3]
    INFO - 10:43:05:      4%|▍         | 9/200 [00:00<00:08, 21.61 it/sec, obj=1.2e+3]
    INFO - 10:43:05:      5%|▌         | 10/200 [00:00<00:08, 21.79 it/sec, obj=1.01e+3]
    INFO - 10:43:05:      6%|▌         | 11/200 [00:00<00:08, 21.97 it/sec, obj=756]
    INFO - 10:43:05:      6%|▌         | 12/200 [00:00<00:08, 22.13 it/sec, obj=573]
    INFO - 10:43:05:      6%|▋         | 13/200 [00:00<00:08, 22.27 it/sec, obj=509]
    INFO - 10:43:05:      7%|▋         | 14/200 [00:00<00:08, 22.41 it/sec, obj=448]
    INFO - 10:43:05:      8%|▊         | 15/200 [00:00<00:08, 22.48 it/sec, obj=399]
    INFO - 10:43:05:      8%|▊         | 16/200 [00:00<00:08, 22.54 it/sec, obj=360]
    INFO - 10:43:05:      8%|▊         | 17/200 [00:00<00:08, 22.59 it/sec, obj=329]
    INFO - 10:43:05:      9%|▉         | 18/200 [00:00<00:08, 22.65 it/sec, obj=304]
    INFO - 10:43:05:     10%|▉         | 19/200 [00:00<00:07, 22.76 it/sec, obj=278]
    INFO - 10:43:05:     10%|█         | 20/200 [00:00<00:07, 22.83 it/sec, obj=251]
    INFO - 10:43:05:     10%|█         | 21/200 [00:00<00:07, 22.93 it/sec, obj=231]
    INFO - 10:43:05:     11%|█         | 22/200 [00:00<00:07, 22.98 it/sec, obj=213]
    INFO - 10:43:05:     12%|█▏        | 23/200 [00:00<00:07, 23.03 it/sec, obj=193]
    INFO - 10:43:05:     12%|█▏        | 24/200 [00:01<00:07, 23.07 it/sec, obj=175]
    INFO - 10:43:06:     12%|█▎        | 25/200 [00:01<00:07, 23.13 it/sec, obj=161]
    INFO - 10:43:06:     13%|█▎        | 26/200 [00:01<00:07, 23.20 it/sec, obj=153]
    INFO - 10:43:06:     14%|█▎        | 27/200 [00:01<00:07, 23.26 it/sec, obj=148]
    INFO - 10:43:06:     14%|█▍        | 28/200 [00:01<00:07, 23.33 it/sec, obj=145]
    INFO - 10:43:06:     14%|█▍        | 29/200 [00:01<00:07, 23.40 it/sec, obj=143]
    INFO - 10:43:06:     15%|█▌        | 30/200 [00:01<00:07, 23.47 it/sec, obj=142]
    INFO - 10:43:06:     16%|█▌        | 31/200 [00:01<00:07, 23.53 it/sec, obj=141]
    INFO - 10:43:06:     16%|█▌        | 32/200 [00:01<00:07, 23.59 it/sec, obj=140]
    INFO - 10:43:06:     16%|█▋        | 33/200 [00:01<00:07, 23.67 it/sec, obj=140]
    INFO - 10:43:06:     17%|█▋        | 34/200 [00:01<00:06, 23.72 it/sec, obj=140]
    INFO - 10:43:06:     18%|█▊        | 35/200 [00:01<00:06, 23.79 it/sec, obj=139]
    INFO - 10:43:06:     18%|█▊        | 36/200 [00:01<00:06, 23.84 it/sec, obj=139]
    INFO - 10:43:06:     18%|█▊        | 37/200 [00:01<00:06, 23.90 it/sec, obj=139]
    INFO - 10:43:06:     19%|█▉        | 38/200 [00:01<00:06, 23.94 it/sec, obj=139]
    INFO - 10:43:06:     20%|█▉        | 39/200 [00:01<00:06, 23.98 it/sec, obj=139]
    INFO - 10:43:06:     20%|██        | 40/200 [00:01<00:06, 24.02 it/sec, obj=139]
    INFO - 10:43:06:     20%|██        | 41/200 [00:01<00:06, 24.05 it/sec, obj=139]
    INFO - 10:43:06:     21%|██        | 42/200 [00:01<00:06, 24.08 it/sec, obj=138]
    INFO - 10:43:06:     22%|██▏       | 43/200 [00:01<00:06, 24.09 it/sec, obj=138]
    INFO - 10:43:06:     22%|██▏       | 44/200 [00:01<00:06, 24.11 it/sec, obj=138]
    INFO - 10:43:06:     22%|██▎       | 45/200 [00:01<00:06, 24.13 it/sec, obj=138]
    INFO - 10:43:06:     23%|██▎       | 46/200 [00:01<00:06, 24.16 it/sec, obj=138]
    INFO - 10:43:06:     24%|██▎       | 47/200 [00:01<00:06, 24.18 it/sec, obj=138]
    INFO - 10:43:06:     24%|██▍       | 48/200 [00:01<00:06, 24.20 it/sec, obj=138]
    INFO - 10:43:06:     24%|██▍       | 49/200 [00:02<00:06, 24.24 it/sec, obj=138]
    INFO - 10:43:06:     25%|██▌       | 50/200 [00:02<00:06, 24.27 it/sec, obj=138]
    INFO - 10:43:07:     26%|██▌       | 51/200 [00:02<00:06, 24.30 it/sec, obj=138]
    INFO - 10:43:07:     26%|██▌       | 52/200 [00:02<00:06, 24.33 it/sec, obj=138]
    INFO - 10:43:07:     26%|██▋       | 53/200 [00:02<00:06, 24.36 it/sec, obj=138]
    INFO - 10:43:07:     27%|██▋       | 54/200 [00:02<00:05, 24.39 it/sec, obj=137]
    INFO - 10:43:07:     28%|██▊       | 55/200 [00:02<00:05, 24.41 it/sec, obj=137]
    INFO - 10:43:07:     28%|██▊       | 56/200 [00:02<00:05, 24.43 it/sec, obj=137]
    INFO - 10:43:07:     28%|██▊       | 57/200 [00:02<00:05, 24.46 it/sec, obj=137]
    INFO - 10:43:07:     29%|██▉       | 58/200 [00:02<00:05, 24.48 it/sec, obj=137]
    INFO - 10:43:07:     30%|██▉       | 59/200 [00:02<00:05, 24.51 it/sec, obj=137]
    INFO - 10:43:07:     30%|███       | 60/200 [00:02<00:05, 24.54 it/sec, obj=137]
    INFO - 10:43:07:     30%|███       | 61/200 [00:02<00:05, 24.56 it/sec, obj=137]
    INFO - 10:43:07:     31%|███       | 62/200 [00:02<00:05, 24.58 it/sec, obj=137]
    INFO - 10:43:07:     32%|███▏      | 63/200 [00:02<00:05, 24.60 it/sec, obj=137]
    INFO - 10:43:07:     32%|███▏      | 64/200 [00:02<00:05, 24.62 it/sec, obj=137]
    INFO - 10:43:07:     32%|███▎      | 65/200 [00:02<00:05, 24.64 it/sec, obj=137]
    INFO - 10:43:07:     33%|███▎      | 66/200 [00:02<00:05, 24.65 it/sec, obj=137]
    INFO - 10:43:07:     34%|███▎      | 67/200 [00:02<00:05, 24.66 it/sec, obj=137]
    INFO - 10:43:07:     34%|███▍      | 68/200 [00:02<00:05, 24.67 it/sec, obj=137]
    INFO - 10:43:07:     34%|███▍      | 69/200 [00:02<00:05, 24.68 it/sec, obj=137]
    INFO - 10:43:07:     35%|███▌      | 70/200 [00:02<00:05, 24.70 it/sec, obj=137]
    INFO - 10:43:07:     36%|███▌      | 71/200 [00:02<00:05, 24.71 it/sec, obj=137]
    INFO - 10:43:07:     36%|███▌      | 72/200 [00:02<00:05, 24.73 it/sec, obj=137]
    INFO - 10:43:07:     36%|███▋      | 73/200 [00:02<00:05, 24.74 it/sec, obj=137]
    INFO - 10:43:07:     37%|███▋      | 74/200 [00:02<00:05, 24.75 it/sec, obj=137]
    INFO - 10:43:07:     38%|███▊      | 75/200 [00:03<00:05, 24.76 it/sec, obj=137]
    INFO - 10:43:07:     38%|███▊      | 76/200 [00:03<00:05, 24.78 it/sec, obj=137]
    INFO - 10:43:08:     38%|███▊      | 77/200 [00:03<00:04, 24.80 it/sec, obj=137]
    INFO - 10:43:08:     39%|███▉      | 78/200 [00:03<00:04, 24.82 it/sec, obj=137]
    INFO - 10:43:08:     40%|███▉      | 79/200 [00:03<00:04, 24.83 it/sec, obj=137]
    INFO - 10:43:08:     40%|████      | 80/200 [00:03<00:04, 24.85 it/sec, obj=137]
    INFO - 10:43:08:     40%|████      | 81/200 [00:03<00:04, 24.86 it/sec, obj=137]
    INFO - 10:43:08:     41%|████      | 82/200 [00:03<00:04, 24.87 it/sec, obj=137]
    INFO - 10:43:08:     42%|████▏     | 83/200 [00:03<00:04, 24.88 it/sec, obj=137]
    INFO - 10:43:08:     42%|████▏     | 84/200 [00:03<00:04, 24.90 it/sec, obj=137]
    INFO - 10:43:08:     42%|████▎     | 85/200 [00:03<00:04, 24.91 it/sec, obj=137]
    INFO - 10:43:08:     43%|████▎     | 86/200 [00:03<00:04, 24.92 it/sec, obj=137]
    INFO - 10:43:08:     44%|████▎     | 87/200 [00:03<00:04, 24.94 it/sec, obj=137]
    INFO - 10:43:08:     44%|████▍     | 88/200 [00:03<00:04, 24.95 it/sec, obj=137]
    INFO - 10:43:08:     44%|████▍     | 89/200 [00:03<00:04, 24.97 it/sec, obj=137]
    INFO - 10:43:08:     45%|████▌     | 90/200 [00:03<00:04, 24.98 it/sec, obj=137]
    INFO - 10:43:08:     46%|████▌     | 91/200 [00:03<00:04, 24.99 it/sec, obj=137]
    INFO - 10:43:08:     46%|████▌     | 92/200 [00:03<00:04, 25.00 it/sec, obj=137]
    INFO - 10:43:08:     46%|████▋     | 93/200 [00:03<00:04, 25.01 it/sec, obj=137]
    INFO - 10:43:08:     47%|████▋     | 94/200 [00:03<00:04, 25.01 it/sec, obj=137]
    INFO - 10:43:08:     48%|████▊     | 95/200 [00:03<00:04, 25.02 it/sec, obj=137]
    INFO - 10:43:08:     48%|████▊     | 96/200 [00:03<00:04, 25.02 it/sec, obj=137]
    INFO - 10:43:08:     48%|████▊     | 97/200 [00:03<00:04, 25.04 it/sec, obj=137]
    INFO - 10:43:08:     49%|████▉     | 98/200 [00:03<00:04, 25.04 it/sec, obj=137]
    INFO - 10:43:08:     50%|████▉     | 99/200 [00:03<00:04, 25.06 it/sec, obj=137]
    INFO - 10:43:08:     50%|█████     | 100/200 [00:03<00:03, 25.07 it/sec, obj=137]
    INFO - 10:43:08:     50%|█████     | 101/200 [00:04<00:03, 25.08 it/sec, obj=137]
    INFO - 10:43:08:     51%|█████     | 102/200 [00:04<00:03, 25.09 it/sec, obj=137]
    INFO - 10:43:09:     52%|█████▏    | 103/200 [00:04<00:03, 25.10 it/sec, obj=137]
    INFO - 10:43:09:     52%|█████▏    | 104/200 [00:04<00:03, 25.10 it/sec, obj=137]
    INFO - 10:43:09:     52%|█████▎    | 105/200 [00:04<00:03, 25.11 it/sec, obj=137]
    INFO - 10:43:09:     53%|█████▎    | 106/200 [00:04<00:03, 25.12 it/sec, obj=137]
    INFO - 10:43:09:     54%|█████▎    | 107/200 [00:04<00:03, 25.12 it/sec, obj=137]
    INFO - 10:43:09:     54%|█████▍    | 108/200 [00:04<00:03, 25.13 it/sec, obj=137]
    INFO - 10:43:09:     55%|█████▍    | 109/200 [00:04<00:03, 25.14 it/sec, obj=137]
    INFO - 10:43:09:     55%|█████▌    | 110/200 [00:04<00:03, 25.14 it/sec, obj=137]
    INFO - 10:43:09:     56%|█████▌    | 111/200 [00:04<00:03, 25.15 it/sec, obj=137]
    INFO - 10:43:09:     56%|█████▌    | 112/200 [00:04<00:03, 25.17 it/sec, obj=137]
    INFO - 10:43:09:     56%|█████▋    | 113/200 [00:04<00:03, 25.18 it/sec, obj=137]
    INFO - 10:43:09:     57%|█████▋    | 114/200 [00:04<00:03, 25.19 it/sec, obj=137]
    INFO - 10:43:09:     57%|█████▊    | 115/200 [00:04<00:03, 25.19 it/sec, obj=137]
    INFO - 10:43:09:     58%|█████▊    | 116/200 [00:04<00:03, 25.20 it/sec, obj=137]
    INFO - 10:43:09:     58%|█████▊    | 117/200 [00:04<00:03, 25.21 it/sec, obj=137]
    INFO - 10:43:09:     59%|█████▉    | 118/200 [00:04<00:03, 25.21 it/sec, obj=137]
    INFO - 10:43:09:     60%|█████▉    | 119/200 [00:04<00:03, 25.21 it/sec, obj=137]
    INFO - 10:43:09:     60%|██████    | 120/200 [00:04<00:03, 25.21 it/sec, obj=137]
    INFO - 10:43:09:     60%|██████    | 121/200 [00:04<00:03, 25.21 it/sec, obj=137]
    INFO - 10:43:09:     61%|██████    | 122/200 [00:04<00:03, 25.22 it/sec, obj=137]
    INFO - 10:43:09:     62%|██████▏   | 123/200 [00:04<00:03, 25.22 it/sec, obj=137]
    INFO - 10:43:09:     62%|██████▏   | 124/200 [00:04<00:03, 25.22 it/sec, obj=137]
    INFO - 10:43:09:     62%|██████▎   | 125/200 [00:04<00:02, 25.23 it/sec, obj=137]
    INFO - 10:43:09:     63%|██████▎   | 126/200 [00:04<00:02, 25.23 it/sec, obj=137]
    INFO - 10:43:09:     64%|██████▎   | 127/200 [00:05<00:02, 25.24 it/sec, obj=137]
    INFO - 10:43:09:     64%|██████▍   | 128/200 [00:05<00:02, 25.24 it/sec, obj=137]
    INFO - 10:43:10:     64%|██████▍   | 129/200 [00:05<00:02, 25.25 it/sec, obj=137]
    INFO - 10:43:10:     65%|██████▌   | 130/200 [00:05<00:02, 25.25 it/sec, obj=137]
    INFO - 10:43:10:     66%|██████▌   | 131/200 [00:05<00:02, 25.26 it/sec, obj=137]
    INFO - 10:43:10:     66%|██████▌   | 132/200 [00:05<00:02, 25.27 it/sec, obj=137]
    INFO - 10:43:10:     66%|██████▋   | 133/200 [00:05<00:02, 25.27 it/sec, obj=137]
    INFO - 10:43:10:     67%|██████▋   | 134/200 [00:05<00:02, 25.28 it/sec, obj=137]
    INFO - 10:43:10:     68%|██████▊   | 135/200 [00:05<00:02, 25.29 it/sec, obj=137]
    INFO - 10:43:10:     68%|██████▊   | 136/200 [00:05<00:02, 25.29 it/sec, obj=137]
    INFO - 10:43:10:     68%|██████▊   | 137/200 [00:05<00:02, 25.30 it/sec, obj=137]
    INFO - 10:43:10:     69%|██████▉   | 138/200 [00:05<00:02, 25.30 it/sec, obj=137]
    INFO - 10:43:10:     70%|██████▉   | 139/200 [00:05<00:02, 25.31 it/sec, obj=137]
    INFO - 10:43:10:     70%|███████   | 140/200 [00:05<00:02, 25.31 it/sec, obj=137]
    INFO - 10:43:10:     70%|███████   | 141/200 [00:05<00:02, 25.31 it/sec, obj=137]
    INFO - 10:43:10:     71%|███████   | 142/200 [00:05<00:02, 25.32 it/sec, obj=137]
    INFO - 10:43:10:     72%|███████▏  | 143/200 [00:05<00:02, 25.32 it/sec, obj=137]
    INFO - 10:43:10:     72%|███████▏  | 144/200 [00:05<00:02, 25.32 it/sec, obj=137]
    INFO - 10:43:10:     72%|███████▎  | 145/200 [00:05<00:02, 25.33 it/sec, obj=137]
    INFO - 10:43:10:     73%|███████▎  | 146/200 [00:05<00:02, 25.33 it/sec, obj=137]
    INFO - 10:43:10:     74%|███████▎  | 147/200 [00:05<00:02, 25.34 it/sec, obj=137]
    INFO - 10:43:10:     74%|███████▍  | 148/200 [00:05<00:02, 25.33 it/sec, obj=137]
    INFO - 10:43:10:     74%|███████▍  | 149/200 [00:05<00:02, 25.34 it/sec, obj=137]
    INFO - 10:43:10:     75%|███████▌  | 150/200 [00:05<00:01, 25.34 it/sec, obj=137]
    INFO - 10:43:10:     76%|███████▌  | 151/200 [00:05<00:01, 25.35 it/sec, obj=137]
    INFO - 10:43:10:     76%|███████▌  | 152/200 [00:05<00:01, 25.35 it/sec, obj=137]
    INFO - 10:43:10:     76%|███████▋  | 153/200 [00:06<00:01, 25.36 it/sec, obj=137]
    INFO - 10:43:10:     77%|███████▋  | 154/200 [00:06<00:01, 25.36 it/sec, obj=137]
    INFO - 10:43:11:     78%|███████▊  | 155/200 [00:06<00:01, 25.37 it/sec, obj=137]
    INFO - 10:43:11:     78%|███████▊  | 156/200 [00:06<00:01, 25.37 it/sec, obj=137]
    INFO - 10:43:11:     78%|███████▊  | 157/200 [00:06<00:01, 25.37 it/sec, obj=137]
    INFO - 10:43:11:     79%|███████▉  | 158/200 [00:06<00:01, 25.38 it/sec, obj=137]
    INFO - 10:43:11:     80%|███████▉  | 159/200 [00:06<00:01, 25.39 it/sec, obj=137]
    INFO - 10:43:11:     80%|████████  | 160/200 [00:06<00:01, 25.40 it/sec, obj=137]
    INFO - 10:43:11:     80%|████████  | 161/200 [00:06<00:01, 25.41 it/sec, obj=137]
    INFO - 10:43:11:     81%|████████  | 162/200 [00:06<00:01, 25.42 it/sec, obj=137]
    INFO - 10:43:11:     82%|████████▏ | 163/200 [00:06<00:01, 25.42 it/sec, obj=137]
    INFO - 10:43:11:     82%|████████▏ | 164/200 [00:06<00:01, 25.44 it/sec, obj=137]
    INFO - 10:43:11:     82%|████████▎ | 165/200 [00:06<00:01, 25.44 it/sec, obj=137]
    INFO - 10:43:11:     83%|████████▎ | 166/200 [00:06<00:01, 25.44 it/sec, obj=137]
    INFO - 10:43:11:     84%|████████▎ | 167/200 [00:06<00:01, 25.45 it/sec, obj=137]
    INFO - 10:43:11:     84%|████████▍ | 168/200 [00:06<00:01, 25.45 it/sec, obj=137]
    INFO - 10:43:11:     84%|████████▍ | 169/200 [00:06<00:01, 25.45 it/sec, obj=137]
    INFO - 10:43:11:     85%|████████▌ | 170/200 [00:06<00:01, 25.45 it/sec, obj=137]
    INFO - 10:43:11:     86%|████████▌ | 171/200 [00:06<00:01, 25.46 it/sec, obj=137]
    INFO - 10:43:11:     86%|████████▌ | 172/200 [00:06<00:01, 25.46 it/sec, obj=137]
    INFO - 10:43:11:     86%|████████▋ | 173/200 [00:06<00:01, 25.47 it/sec, obj=137]
    INFO - 10:43:11:     87%|████████▋ | 174/200 [00:06<00:01, 25.47 it/sec, obj=137]
    INFO - 10:43:11:     88%|████████▊ | 175/200 [00:06<00:00, 25.48 it/sec, obj=137]
    INFO - 10:43:11:     88%|████████▊ | 176/200 [00:06<00:00, 25.48 it/sec, obj=137]
    INFO - 10:43:11:     88%|████████▊ | 177/200 [00:06<00:00, 25.48 it/sec, obj=137]
    INFO - 10:43:11:     89%|████████▉ | 178/200 [00:06<00:00, 25.48 it/sec, obj=137]
    INFO - 10:43:11:     90%|████████▉ | 179/200 [00:07<00:00, 25.48 it/sec, obj=137]
    INFO - 10:43:11:     90%|█████████ | 180/200 [00:07<00:00, 25.48 it/sec, obj=137]
    INFO - 10:43:12:     90%|█████████ | 181/200 [00:07<00:00, 25.49 it/sec, obj=137]
    INFO - 10:43:12:     91%|█████████ | 182/200 [00:07<00:00, 25.49 it/sec, obj=137]
    INFO - 10:43:12:     92%|█████████▏| 183/200 [00:07<00:00, 25.50 it/sec, obj=137]
    INFO - 10:43:12:     92%|█████████▏| 184/200 [00:07<00:00, 25.50 it/sec, obj=137]
    INFO - 10:43:12:     92%|█████████▎| 185/200 [00:07<00:00, 25.51 it/sec, obj=137]
    INFO - 10:43:12:     93%|█████████▎| 186/200 [00:07<00:00, 25.52 it/sec, obj=137]
    INFO - 10:43:12:     94%|█████████▎| 187/200 [00:07<00:00, 25.52 it/sec, obj=137]
    INFO - 10:43:12:     94%|█████████▍| 188/200 [00:07<00:00, 25.53 it/sec, obj=137]
    INFO - 10:43:12:     94%|█████████▍| 189/200 [00:07<00:00, 25.53 it/sec, obj=137]
    INFO - 10:43:12:     95%|█████████▌| 190/200 [00:07<00:00, 25.54 it/sec, obj=137]
    INFO - 10:43:12:     96%|█████████▌| 191/200 [00:07<00:00, 25.54 it/sec, obj=137]
    INFO - 10:43:12:     96%|█████████▌| 192/200 [00:07<00:00, 25.54 it/sec, obj=137]
    INFO - 10:43:12:     96%|█████████▋| 193/200 [00:07<00:00, 25.55 it/sec, obj=137]
    INFO - 10:43:12:     97%|█████████▋| 194/200 [00:07<00:00, 25.55 it/sec, obj=137]
    INFO - 10:43:12:     98%|█████████▊| 195/200 [00:07<00:00, 25.55 it/sec, obj=137]
    INFO - 10:43:12:     98%|█████████▊| 196/200 [00:07<00:00, 25.56 it/sec, obj=137]
    INFO - 10:43:12:     98%|█████████▊| 197/200 [00:07<00:00, 25.56 it/sec, obj=137]
    INFO - 10:43:12:     99%|█████████▉| 198/200 [00:07<00:00, 25.56 it/sec, obj=137]
    INFO - 10:43:12:    100%|█████████▉| 199/200 [00:07<00:00, 25.55 it/sec, obj=137]
    INFO - 10:43:12:    100%|██████████| 200/200 [00:07<00:00, 25.64 it/sec, obj=137]
    INFO - 10:43:12: Optimization result:
    INFO - 10:43:12:    Optimizer info:
    INFO - 10:43:12:       Status: None
    INFO - 10:43:12:       Message: Maximum number of iterations reached. GEMSEO stopped the driver.
    INFO - 10:43:12:       Number of calls to the objective function by the optimizer: 201
    INFO - 10:43:12:    Solution:
    INFO - 10:43:12:       The solution is feasible.
    INFO - 10:43:12:       Objective: 136.56123312100124
    INFO - 10:43:12:       Standardized constraints:
    INFO - 10:43:12:          [volume fraction-0.3] = -1.9140380946858215e-09
    INFO - 10:43:12: *** End MDOScenario execution (time: 0:00:07.815885) ***

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

Results

Post-process the optimization history:

scenario.post_process(
    "BasicHistory", variable_names=["compliance"], show=True, save=False
)
History plot
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/develop/lib/python3.9/site-packages/gemseo/datasets/dataset.py:483: 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 0x7f130619c070>

Plot the solution

scenario.post_process("TopologyView", n_x=n_x, n_y=n_y, show=True, save=False)
plot topology optimization short cantilever
<gemseo.post.topology_view.TopologyView object at 0x7f130657d160>

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

Gallery generated by Sphinx-Gallery