Computing the Shape Stiffness via Distance to the Boundaries¶
Problem Formulation¶
We are solving the same problem as in Optimization of an Obstacle in Stokes Flow, but now use a different approach for computing the stiffness of the shape gradient. Recall, that the corresponding (regularized) shape optimization problem is given by
For a background on the stiffness of the shape gradient, we refer to Section ShapeGradient, where it is defined as the parameter \(\mu\) used in the computation of the shape gradient. Note, that the distance computation is done via an eikonal equation, hence the name of the demo.
Implementation¶
The complete python code can be found in the file demo_eikonal_stiffness.py
,
and the corresponding config can be found in config.ini
.
Changes in the config file¶
In order to compute the stiffness \(\mu\) based on the distance to selected boundaries, we only have to change the configuration file we are using, the python code for solving the shape optimization problem with CASHOCS stays exactly as it was in Optimization of an Obstacle in Stokes Flow.
To use the stiffness computation based on the distance to the boundary, we add the following lines to the config file
use_distance_mu = True
dist_min = 0.05
dist_max = 1.25
mu_min = 5e2
mu_max = 1.0
smooth_mu = false
boundaries_dist = [4]
The first line
use_distance_mu = True
ensures that the stiffness will be computed based on the distance to the boundary.
The next four lines then specify the behavior of this computation. In particular, we have the following behavior for \(\mu\)
where \(\delta\) denotes the distance to the boundary and \(\delta_\mathrm{min}\)
and \(\delta_\mathrm{max}\) correspond to dist_min
and dist_max
,
respectively.
The values in-between are given by interpolation. Either a linear, continuous interpolation is used, or a smooth \(C^1\) interpolation given by a third order polynomial. These can be selected with the option
smooth_mu = false
where smooth_mu = True
uses the third order polynomial, and smooth_mu = False
uses
the linear function.
Finally, the line
boundaries_dist = [4]
specifies, which boundaries are considered for the distance computation. These are again specified using the boundary markers, as it was previously explained in Section ShapeGradient.
The results should look like this