Usage of FreeFEM programs attached to Chapter 9in “Shape Optimization Problems”
Hideyuki Azegami (azegami@nagoya-u.jp)
December 9, 2020

1

Tree of folders and ﬁles
9.11.5 shape elastic
2d-cantileverboundary integral
grad
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
domain integral
grad
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton gH
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp1 make graph.bat
2 make pdf.tex
2 make pdf.pdf
graph config.mp(be continued)(9.11.5 shape elastic)
2d-holeboundary integral
grad
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
domain integral
grad
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton gH
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
1 make graph.bat
2 make pdf.tex
2 make pdf.pdf
graph config.mp(be continued)1

(9.11.5 shape elastic)
2d-hookboundary integral
grad
0 main.edp
0 main errnorm.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
domain integral
grad
0 main.edp
0 main errnorm.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton0 main.edp
0 main errnorm.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton gH
0 main.edp
0 main errnorm.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
1 make graph.bat
2 make pdf.tex
2 make pdf.pdf
graph config.mp(be continued)2(9.11.5 shape elastic)
2d-L-shapeboundary integral
grad
0 main.edp
0 main P1.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
domain integral
grad
0 main.edp
0 main P1.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton gH
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
1 make graph.bat
2 make pdf.tex
2 make pdf.pdf
graph config.mp(be continued)

(9.11.5 shape elastic)
3d-cantileverboundary integral
grad
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
domain integral
grad
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton gH
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
1 make graph.bat
2 make pdf.tex
2 make pdf.pdf
graph config.mp

3

9.12.5 shape stokes
2d-iso-bodyboundary integral
grad
0 main.edp0 main errnorm.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
domain integral
grad
0 main.edp
0 main errnorm.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton0 main.edp
0 main errnorm.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton gH
0 main.edp
0 main errnorm.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
1 make graph.bat
2 make pdf.tex
2 make pdf.pdf
graph config.mp(be continued)2(9.12.5 shape stokes)
2d-Y-tube
boundary integral
grad
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
domain integral
grad
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
Newton gH
0 main.edp
1 make graph.bat
2 make pdf.tex
graph config.mp
1 make graph.bat
2 make pdf.tex
2 make pdf.pdf
graph config.mp

Explanation of folders and ﬁles

The index number of 9.11.5 in the ﬁrst folder name 9.11.5 shape elastic corresponds to Section 9.11.5 in the book. The folder name 2d-cantilever refers to
the type of problem. In the folders boundary integral and domain integral,
the shape derivatives ḡ0 and ḡ1 of the boundary integral type and g0 and g1 ofthe domain integral type are used, respectively. The folder names grad, Newton
and Newton gH contain the script for solving the problem using the H 1 gradientmethod, H 1 Newton method and H 1 Newton method using Hesse gradient, respec4

tively. In each folder, the roles of ﬁles are as follows:• 0 main.edp is an executable ﬁle written in the FreeFEM language. You can
edit it by a text editor. To run the program,FreeFEM (https://freefem.org/)
has to be installed.
• 0 main errnorm.edp is provided for evaluation of distance ∥ϕk − ϕ∗ ∥X froman approximate minimum point ϕ∗ .
• In 0 main P1.edp, the P1 elements are used to solve the state determination
problem and the H 1 gradient method.
• 1 make graph.bat is a batch ﬁle for Windows system to make graphs fromthe output ﬁles obtained by running 0 main.edp and 0 main errnorm.edp(if there is) using MetaPost. To run the program, a TEX distribution haveto be installed. In the distribution, for example,
C:/texlive/2020/bin/win32/mpost.exe
is used. If the batch ﬁle does not work, you can type in%mpost graph conﬁg.mp
on Command prompt for Windows and Terminal for Mac. By running thecommand, graph ﬁles in EPS format will be generated.
• 2 make pdf.tex is a TEX ﬁle to create a PDF ﬁle from the EPS ﬁles where
all the graphs are plotted.
• The ﬁles 1 make graph.bat and 2 make pdf.tex in parent folders are madeavailable after 0 main.edp and 0 main errnorm.edp (if there is) in all thechild folders are executed. The ﬁles 2 make pdf.pdf in parent folders are theoutput ﬁles generated by running 2 make pdf.tex.

5