.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/topology_optimization/plot_topology_optimization_L_shape.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_topology_optimization_plot_topology_optimization_L_shape.py: Solve a 2D L-shape topology optimization problem ================================================ .. GENERATED FROM PYTHON SOURCE LINES 23-31 .. code-block:: Python from __future__ import annotations from gemseo import create_scenario from gemseo.problems.topology_optimization.topopt_initialize import ( initialize_design_space_and_discipline_to, ) .. GENERATED FROM PYTHON SOURCE LINES 32-35 Setup the topology optimization problem --------------------------------------- Define the target volume fraction: .. GENERATED FROM PYTHON SOURCE LINES 35-37 .. code-block:: Python volume_fraction = 0.3 .. GENERATED FROM PYTHON SOURCE LINES 38-39 Define the problem type: .. GENERATED FROM PYTHON SOURCE LINES 39-41 .. code-block:: Python problem_name = "L-Shape" .. GENERATED FROM PYTHON SOURCE LINES 42-43 Define the number of elements in the x- and y- directions: .. GENERATED FROM PYTHON SOURCE LINES 43-46 .. code-block:: Python n_x = 25 n_y = 25 .. GENERATED FROM PYTHON SOURCE LINES 47-48 Define the full material Young's modulus and Poisson's ratio: .. GENERATED FROM PYTHON SOURCE LINES 48-51 .. code-block:: Python e0 = 1 nu = 0.3 .. GENERATED FROM PYTHON SOURCE LINES 52-53 Define the penalty of the SIMP approach: .. GENERATED FROM PYTHON SOURCE LINES 53-55 .. code-block:: Python penalty = 3 .. GENERATED FROM PYTHON SOURCE LINES 56-57 Define the minimum member size in the solution: .. GENERATED FROM PYTHON SOURCE LINES 57-58 .. code-block:: Python min_member_size = 1.5 .. GENERATED FROM PYTHON SOURCE LINES 59-60 Instantiate the :class:`.DesignSpace` and the disciplines: .. GENERATED FROM PYTHON SOURCE LINES 60-72 .. code-block:: Python 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, ) .. GENERATED FROM PYTHON SOURCE LINES 73-76 Solve the topology optimization problem --------------------------------------- Generate an :class:`.MDOScenario`: .. GENERATED FROM PYTHON SOURCE LINES 76-82 .. code-block:: Python scenario = create_scenario( disciplines, "compliance", design_space, formulation_name="DisciplinaryOpt", ) .. GENERATED FROM PYTHON SOURCE LINES 83-84 Add the volume fraction constraint to the scenario: .. GENERATED FROM PYTHON SOURCE LINES 84-88 .. code-block:: Python scenario.add_constraint( "volume fraction", constraint_type="ineq", value=volume_fraction ) .. GENERATED FROM PYTHON SOURCE LINES 89-90 Generate the XDSM .. GENERATED FROM PYTHON SOURCE LINES 90-92 .. code-block:: Python scenario.xdsmize(save_html=False) .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 93-94 Execute the scenario .. GENERATED FROM PYTHON SOURCE LINES 94-96 .. code-block:: Python scenario.execute(algo_name="NLOPT_MMA", max_iter=200) .. rst-class:: sphx-glr-script-out .. code-block:: none INFO - 16:24:28: *** Start MDOScenario execution *** INFO - 16:24:28: MDOScenario INFO - 16:24:28: Disciplines: DensityFilter FiniteElementAnalysis MaterialModelInterpolation VolumeFraction INFO - 16:24:28: MDO formulation: DisciplinaryOpt INFO - 16:24:28: Optimization problem: INFO - 16:24:28: minimize compliance(x) INFO - 16:24:28: with respect to x INFO - 16:24:28: under the inequality constraints INFO - 16:24:28: volume fraction(x) <= 0.3 INFO - 16:24:28: Solving optimization problem with algorithm NLOPT_MMA: INFO - 16:24:28: 1%| | 2/200 [00:00<00:02, 82.23 it/sec, feas=True, obj=2.23e+3] INFO - 16:24:28: 2%|▏ | 3/200 [00:00<00:02, 90.21 it/sec, feas=True, obj=1.96e+3] INFO - 16:24:28: 2%|▏ | 4/200 [00:00<00:02, 95.05 it/sec, feas=True, obj=1.75e+3] INFO - 16:24:28: 2%|▎ | 5/200 [00:00<00:02, 97.12 it/sec, feas=True, obj=1.57e+3] INFO - 16:24:28: 3%|▎ | 6/200 [00:00<00:01, 98.07 it/sec, feas=True, obj=1.2e+3] INFO - 16:24:28: 4%|▎ | 7/200 [00:00<00:01, 98.34 it/sec, feas=True, obj=963] INFO - 16:24:28: 4%|▍ | 8/200 [00:00<00:01, 98.82 it/sec, feas=True, obj=624] INFO - 16:24:28: 4%|▍ | 9/200 [00:00<00:01, 99.18 it/sec, feas=True, obj=497] INFO - 16:24:28: 5%|▌ | 10/200 [00:00<00:01, 99.71 it/sec, feas=True, obj=395] INFO - 16:24:28: 6%|▌ | 11/200 [00:00<00:01, 99.59 it/sec, feas=True, obj=306] INFO - 16:24:28: 6%|▌ | 12/200 [00:00<00:01, 100.22 it/sec, feas=True, obj=251] INFO - 16:24:28: 6%|▋ | 13/200 [00:00<00:01, 100.78 it/sec, feas=True, obj=225] INFO - 16:24:28: 7%|▋ | 14/200 [00:00<00:01, 101.31 it/sec, feas=True, obj=209] INFO - 16:24:28: 8%|▊ | 15/200 [00:00<00:01, 101.95 it/sec, feas=True, obj=201] INFO - 16:24:28: 8%|▊ | 16/200 [00:00<00:01, 102.49 it/sec, feas=True, obj=195] INFO - 16:24:28: 8%|▊ | 17/200 [00:00<00:01, 102.94 it/sec, feas=True, obj=190] INFO - 16:24:28: 9%|▉ | 18/200 [00:00<00:01, 103.63 it/sec, feas=True, obj=186] INFO - 16:24:28: 10%|▉ | 19/200 [00:00<00:01, 104.24 it/sec, feas=True, obj=182] INFO - 16:24:28: 10%|█ | 20/200 [00:00<00:01, 104.84 it/sec, feas=True, obj=178] INFO - 16:24:28: 10%|█ | 21/200 [00:00<00:01, 105.18 it/sec, feas=True, obj=174] INFO - 16:24:28: 11%|█ | 22/200 [00:00<00:01, 105.62 it/sec, feas=True, obj=169] INFO - 16:24:28: 12%|█▏ | 23/200 [00:00<00:01, 106.03 it/sec, feas=True, obj=164] INFO - 16:24:28: 12%|█▏ | 24/200 [00:00<00:01, 106.55 it/sec, feas=True, obj=161] INFO - 16:24:28: 12%|█▎ | 25/200 [00:00<00:01, 106.92 it/sec, feas=True, obj=159] INFO - 16:24:28: 13%|█▎ | 26/200 [00:00<00:01, 107.38 it/sec, feas=True, obj=157] INFO - 16:24:28: 14%|█▎ | 27/200 [00:00<00:01, 107.88 it/sec, feas=True, obj=156] INFO - 16:24:28: 14%|█▍ | 28/200 [00:00<00:01, 108.25 it/sec, feas=True, obj=155] INFO - 16:24:28: 14%|█▍ | 29/200 [00:00<00:01, 108.43 it/sec, feas=True, obj=154] INFO - 16:24:28: 15%|█▌ | 30/200 [00:00<00:01, 108.80 it/sec, feas=True, obj=154] INFO - 16:24:28: 16%|█▌ | 31/200 [00:00<00:01, 109.09 it/sec, feas=True, obj=153] INFO - 16:24:28: 16%|█▌ | 32/200 [00:00<00:01, 109.33 it/sec, feas=True, obj=153] INFO - 16:24:28: 16%|█▋ | 33/200 [00:00<00:01, 109.77 it/sec, feas=True, obj=152] INFO - 16:24:28: 17%|█▋ | 34/200 [00:00<00:01, 110.19 it/sec, feas=True, obj=152] INFO - 16:24:28: 18%|█▊ | 35/200 [00:00<00:01, 110.44 it/sec, feas=True, obj=152] INFO - 16:24:28: 18%|█▊ | 36/200 [00:00<00:01, 110.70 it/sec, feas=True, obj=152] INFO - 16:24:28: 18%|█▊ | 37/200 [00:00<00:01, 111.01 it/sec, feas=True, obj=152] INFO - 16:24:28: 19%|█▉ | 38/200 [00:00<00:01, 111.32 it/sec, feas=True, obj=152] INFO - 16:24:28: 20%|█▉ | 39/200 [00:00<00:01, 111.66 it/sec, feas=True, obj=152] INFO - 16:24:28: 20%|██ | 40/200 [00:00<00:01, 112.03 it/sec, feas=True, obj=152] INFO - 16:24:28: 20%|██ | 41/200 [00:00<00:01, 112.36 it/sec, feas=True, obj=152] INFO - 16:24:28: 21%|██ | 42/200 [00:00<00:01, 112.68 it/sec, feas=True, obj=152] INFO - 16:24:28: 22%|██▏ | 43/200 [00:00<00:01, 112.95 it/sec, feas=True, obj=152] INFO - 16:24:28: 22%|██▏ | 44/200 [00:00<00:01, 113.21 it/sec, feas=True, obj=152] INFO - 16:24:28: 22%|██▎ | 45/200 [00:00<00:01, 113.53 it/sec, feas=True, obj=152] INFO - 16:24:28: 23%|██▎ | 46/200 [00:00<00:01, 113.76 it/sec, feas=True, obj=152] INFO - 16:24:28: 24%|██▎ | 47/200 [00:00<00:01, 114.15 it/sec, feas=True, obj=152] INFO - 16:24:28: 24%|██▍ | 48/200 [00:00<00:01, 114.57 it/sec, feas=True, obj=152] INFO - 16:24:28: 24%|██▍ | 49/200 [00:00<00:01, 114.96 it/sec, feas=True, obj=152] INFO - 16:24:28: 25%|██▌ | 50/200 [00:00<00:01, 115.25 it/sec, feas=True, obj=152] INFO - 16:24:28: 26%|██▌ | 51/200 [00:00<00:01, 115.49 it/sec, feas=True, obj=152] INFO - 16:24:28: 26%|██▌ | 52/200 [00:00<00:01, 115.73 it/sec, feas=True, obj=152] INFO - 16:24:28: 26%|██▋ | 53/200 [00:00<00:01, 115.86 it/sec, feas=True, obj=152] INFO - 16:24:28: 27%|██▋ | 54/200 [00:00<00:01, 116.03 it/sec, feas=True, obj=152] INFO - 16:24:28: 28%|██▊ | 55/200 [00:00<00:01, 116.18 it/sec, feas=True, obj=152] INFO - 16:24:28: 28%|██▊ | 56/200 [00:00<00:01, 115.89 it/sec, feas=True, obj=152] INFO - 16:24:28: 28%|██▊ | 57/200 [00:00<00:01, 116.03 it/sec, feas=True, obj=152] INFO - 16:24:28: 29%|██▉ | 58/200 [00:00<00:01, 116.14 it/sec, feas=True, obj=152] INFO - 16:24:28: 30%|██▉ | 59/200 [00:00<00:01, 116.20 it/sec, feas=True, obj=152] INFO - 16:24:28: 30%|███ | 60/200 [00:00<00:01, 116.38 it/sec, feas=True, obj=152] INFO - 16:24:28: 30%|███ | 61/200 [00:00<00:01, 116.54 it/sec, feas=True, obj=152] INFO - 16:24:28: 31%|███ | 62/200 [00:00<00:01, 116.72 it/sec, feas=True, obj=152] INFO - 16:24:28: 32%|███▏ | 63/200 [00:00<00:01, 116.81 it/sec, feas=True, obj=152] INFO - 16:24:28: 32%|███▏ | 64/200 [00:00<00:01, 116.99 it/sec, feas=True, obj=152] INFO - 16:24:28: 32%|███▎ | 65/200 [00:00<00:01, 117.11 it/sec, feas=True, obj=152] INFO - 16:24:28: 33%|███▎ | 66/200 [00:00<00:01, 117.25 it/sec, feas=True, obj=152] INFO - 16:24:28: 34%|███▎ | 67/200 [00:00<00:01, 117.38 it/sec, feas=True, obj=152] INFO - 16:24:28: 34%|███▍ | 68/200 [00:00<00:01, 117.51 it/sec, feas=True, obj=152] INFO - 16:24:28: 34%|███▍ | 69/200 [00:00<00:01, 117.65 it/sec, feas=True, obj=152] INFO - 16:24:28: 35%|███▌ | 70/200 [00:00<00:01, 117.80 it/sec, feas=True, obj=152] INFO - 16:24:28: 36%|███▌ | 71/200 [00:00<00:01, 118.03 it/sec, feas=True, obj=152] INFO - 16:24:28: 36%|███▌ | 72/200 [00:00<00:01, 118.16 it/sec, feas=True, obj=152] INFO - 16:24:28: 36%|███▋ | 73/200 [00:00<00:01, 118.27 it/sec, feas=True, obj=152] INFO - 16:24:28: 37%|███▋ | 74/200 [00:00<00:01, 118.36 it/sec, feas=True, obj=152] INFO - 16:24:28: 38%|███▊ | 75/200 [00:00<00:01, 118.56 it/sec, feas=True, obj=152] INFO - 16:24:28: 38%|███▊ | 76/200 [00:00<00:01, 118.67 it/sec, feas=True, obj=152] INFO - 16:24:28: 38%|███▊ | 77/200 [00:00<00:01, 118.55 it/sec, feas=True, obj=152] INFO - 16:24:28: 39%|███▉ | 78/200 [00:00<00:01, 118.65 it/sec, feas=True, obj=152] INFO - 16:24:28: 40%|███▉ | 79/200 [00:00<00:01, 118.85 it/sec, feas=True, obj=152] INFO - 16:24:28: 40%|████ | 80/200 [00:00<00:01, 118.96 it/sec, feas=True, obj=152] INFO - 16:24:28: 40%|████ | 81/200 [00:00<00:00, 119.14 it/sec, feas=True, obj=152] INFO - 16:24:28: 41%|████ | 82/200 [00:00<00:00, 119.28 it/sec, feas=True, obj=152] INFO - 16:24:28: 42%|████▏ | 83/200 [00:00<00:00, 119.33 it/sec, feas=True, obj=152] INFO - 16:24:28: 42%|████▏ | 84/200 [00:00<00:00, 119.40 it/sec, feas=True, obj=152] INFO - 16:24:28: 42%|████▎ | 85/200 [00:00<00:00, 119.56 it/sec, feas=True, obj=152] INFO - 16:24:28: 43%|████▎ | 86/200 [00:00<00:00, 119.65 it/sec, feas=True, obj=152] INFO - 16:24:28: 44%|████▎ | 87/200 [00:00<00:00, 119.81 it/sec, feas=True, obj=152] INFO - 16:24:28: 44%|████▍ | 88/200 [00:00<00:00, 119.97 it/sec, feas=True, obj=152] INFO - 16:24:28: 44%|████▍ | 89/200 [00:00<00:00, 120.11 it/sec, feas=True, obj=152] INFO - 16:24:28: 45%|████▌ | 90/200 [00:00<00:00, 120.28 it/sec, feas=True, obj=152] INFO - 16:24:28: 46%|████▌ | 91/200 [00:00<00:00, 120.39 it/sec, feas=True, obj=152] INFO - 16:24:28: 46%|████▌ | 92/200 [00:00<00:00, 120.55 it/sec, feas=True, obj=152] INFO - 16:24:28: 46%|████▋ | 93/200 [00:00<00:00, 120.67 it/sec, feas=True, obj=152] INFO - 16:24:28: 47%|████▋ | 94/200 [00:00<00:00, 120.83 it/sec, feas=True, obj=152] INFO - 16:24:28: 48%|████▊ | 95/200 [00:00<00:00, 120.97 it/sec, feas=True, obj=152] INFO - 16:24:28: 48%|████▊ | 96/200 [00:00<00:00, 121.05 it/sec, feas=True, obj=152] INFO - 16:24:28: 48%|████▊ | 97/200 [00:00<00:00, 121.20 it/sec, feas=True, obj=152] INFO - 16:24:28: 49%|████▉ | 98/200 [00:00<00:00, 121.33 it/sec, feas=True, obj=152] INFO - 16:24:28: 50%|████▉ | 99/200 [00:00<00:00, 121.47 it/sec, feas=True, obj=152] INFO - 16:24:28: 50%|█████ | 100/200 [00:00<00:00, 121.59 it/sec, feas=True, obj=152] INFO - 16:24:28: 50%|█████ | 101/200 [00:00<00:00, 121.66 it/sec, feas=True, obj=152] INFO - 16:24:28: 51%|█████ | 102/200 [00:00<00:00, 121.77 it/sec, feas=True, obj=152] INFO - 16:24:28: 52%|█████▏ | 103/200 [00:00<00:00, 121.90 it/sec, feas=True, obj=152] INFO - 16:24:29: 52%|█████▏ | 104/200 [00:00<00:00, 122.02 it/sec, feas=True, obj=152] INFO - 16:24:29: 52%|█████▎ | 105/200 [00:00<00:00, 122.09 it/sec, feas=True, obj=152] INFO - 16:24:29: 53%|█████▎ | 106/200 [00:00<00:00, 122.21 it/sec, feas=True, obj=152] INFO - 16:24:29: 54%|█████▎ | 107/200 [00:00<00:00, 122.34 it/sec, feas=True, obj=152] INFO - 16:24:29: 54%|█████▍ | 108/200 [00:00<00:00, 122.40 it/sec, feas=True, obj=152] INFO - 16:24:29: 55%|█████▍ | 109/200 [00:00<00:00, 122.51 it/sec, feas=True, obj=152] INFO - 16:24:29: 55%|█████▌ | 110/200 [00:00<00:00, 122.64 it/sec, feas=True, obj=152] INFO - 16:24:29: 56%|█████▌ | 111/200 [00:00<00:00, 122.74 it/sec, feas=True, obj=152] INFO - 16:24:29: 56%|█████▌ | 112/200 [00:00<00:00, 122.86 it/sec, feas=True, obj=152] INFO - 16:24:29: 56%|█████▋ | 113/200 [00:00<00:00, 122.89 it/sec, feas=True, obj=152] INFO - 16:24:29: 57%|█████▋ | 114/200 [00:00<00:00, 123.00 it/sec, feas=True, obj=152] INFO - 16:24:29: 57%|█████▊ | 115/200 [00:00<00:00, 123.11 it/sec, feas=True, obj=152] INFO - 16:24:29: 58%|█████▊ | 116/200 [00:00<00:00, 123.21 it/sec, feas=True, obj=152] INFO - 16:24:29: 58%|█████▊ | 117/200 [00:00<00:00, 123.31 it/sec, feas=True, obj=152] INFO - 16:24:29: 59%|█████▉ | 118/200 [00:00<00:00, 123.41 it/sec, feas=True, obj=152] INFO - 16:24:29: 60%|█████▉ | 119/200 [00:00<00:00, 123.52 it/sec, feas=True, obj=152] INFO - 16:24:29: 60%|██████ | 120/200 [00:00<00:00, 123.62 it/sec, feas=True, obj=152] INFO - 16:24:29: 60%|██████ | 121/200 [00:00<00:00, 123.72 it/sec, feas=True, obj=152] INFO - 16:24:29: 61%|██████ | 122/200 [00:00<00:00, 123.82 it/sec, feas=True, obj=152] INFO - 16:24:29: 62%|██████▏ | 123/200 [00:00<00:00, 123.91 it/sec, feas=True, obj=152] INFO - 16:24:29: 62%|██████▏ | 124/200 [00:00<00:00, 124.01 it/sec, feas=True, obj=152] INFO - 16:24:29: 62%|██████▎ | 125/200 [00:01<00:00, 124.05 it/sec, feas=True, obj=152] INFO - 16:24:29: 63%|██████▎ | 126/200 [00:01<00:00, 124.15 it/sec, feas=True, obj=152] INFO - 16:24:29: 64%|██████▎ | 127/200 [00:01<00:00, 124.25 it/sec, feas=True, obj=152] INFO - 16:24:29: 64%|██████▍ | 128/200 [00:01<00:00, 124.34 it/sec, feas=True, obj=152] INFO - 16:24:29: 64%|██████▍ | 129/200 [00:01<00:00, 124.41 it/sec, feas=True, obj=152] INFO - 16:24:29: 65%|██████▌ | 130/200 [00:01<00:00, 124.46 it/sec, feas=True, obj=152] INFO - 16:24:29: 66%|██████▌ | 131/200 [00:01<00:00, 124.53 it/sec, feas=True, obj=152] INFO - 16:24:29: 66%|██████▌ | 132/200 [00:01<00:00, 124.60 it/sec, feas=True, obj=152] INFO - 16:24:29: 66%|██████▋ | 133/200 [00:01<00:00, 124.67 it/sec, feas=True, obj=152] INFO - 16:24:29: 67%|██████▋ | 134/200 [00:01<00:00, 124.73 it/sec, feas=True, obj=152] INFO - 16:24:29: 68%|██████▊ | 135/200 [00:01<00:00, 124.81 it/sec, feas=True, obj=152] INFO - 16:24:29: 68%|██████▊ | 136/200 [00:01<00:00, 124.86 it/sec, feas=True, obj=152] INFO - 16:24:29: 68%|██████▊ | 137/200 [00:01<00:00, 124.93 it/sec, feas=True, obj=152] INFO - 16:24:29: 69%|██████▉ | 138/200 [00:01<00:00, 125.00 it/sec, feas=True, obj=152] INFO - 16:24:29: 70%|██████▉ | 139/200 [00:01<00:00, 125.07 it/sec, feas=True, obj=152] INFO - 16:24:29: 70%|███████ | 140/200 [00:01<00:00, 125.14 it/sec, feas=True, obj=152] INFO - 16:24:29: 70%|███████ | 141/200 [00:01<00:00, 125.21 it/sec, feas=True, obj=152] INFO - 16:24:29: 71%|███████ | 142/200 [00:01<00:00, 125.28 it/sec, feas=True, obj=152] INFO - 16:24:29: 72%|███████▏ | 143/200 [00:01<00:00, 125.36 it/sec, feas=True, obj=152] INFO - 16:24:29: 72%|███████▏ | 144/200 [00:01<00:00, 125.44 it/sec, feas=True, obj=152] INFO - 16:24:29: 72%|███████▎ | 145/200 [00:01<00:00, 125.50 it/sec, feas=True, obj=152] INFO - 16:24:29: 73%|███████▎ | 146/200 [00:01<00:00, 125.57 it/sec, feas=True, obj=152] INFO - 16:24:29: 74%|███████▎ | 147/200 [00:01<00:00, 125.65 it/sec, feas=True, obj=152] INFO - 16:24:29: Optimization result: INFO - 16:24:29: Optimizer info: INFO - 16:24:29: Status: None INFO - 16:24:29: Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO stopped the driver. INFO - 16:24:29: Solution: INFO - 16:24:29: The solution is feasible. INFO - 16:24:29: Objective: 151.62879223124227 INFO - 16:24:29: Standardized constraints: INFO - 16:24:29: [volume fraction-0.3] = 1.0261640776554337e-06 INFO - 16:24:29: *** End MDOScenario execution *** .. GENERATED FROM PYTHON SOURCE LINES 97-100 Results ------- Post-process the optimization history: .. GENERATED FROM PYTHON SOURCE LINES 100-104 .. code-block:: Python scenario.post_process( post_name="BasicHistory", variable_names=["compliance"], show=True, save=False ) .. image-sg:: /examples/topology_optimization/images/sphx_glr_plot_topology_optimization_L_shape_001.png :alt: History plot :srcset: /examples/topology_optimization/images/sphx_glr_plot_topology_optimization_L_shape_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 105-106 Plot the solution .. GENERATED FROM PYTHON SOURCE LINES 106-107 .. code-block:: Python scenario.post_process(post_name="TopologyView", n_x=n_x, n_y=n_y, show=True, save=False) .. image-sg:: /examples/topology_optimization/images/sphx_glr_plot_topology_optimization_L_shape_002.png :alt: plot topology optimization L shape :srcset: /examples/topology_optimization/images/sphx_glr_plot_topology_optimization_L_shape_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.552 seconds) .. _sphx_glr_download_examples_topology_optimization_plot_topology_optimization_L_shape.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_topology_optimization_L_shape.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_topology_optimization_L_shape.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_topology_optimization_L_shape.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_