Filtering of the design variable¶
In some applications such as density based topology optimization, it can be useful to
apply some transformation to the design variable. The
decorator filtered_optimizable() allows to automate this process, it
converts an optimization problem
into the problem
where \(\rho\,:\,\R^n\to\R^n\) is a transformation of the design variable.
The decorator is used as follows:
from nullspace_optimizer import EuclideanOptimizable, filtered_optimizable
# Filter the design variable
# The optimizer will call J(filter(x)), G(filter(x)), etc.
@filtered_optimizable(filter, diff_filter)
class Problem(EuclideanOptimizable):
def x0(self):
#x0
#...
def J(self, x):
# J
# etc...
The decorator takes two arguments:
filter: the transformation mapdiff_filter: the derivative of the transformation map. It should be implemented such thatdiff_filter(x,v)=v @ dfilter(x)wheredfilter(x)is the Jacobian matrix of the filter. This is required so that the decoratorfiltered_optimizable()can update consistently the sensitivitiesDJ,DGandDHaccording to the chain rule\[\newcommand{\D}{\mathrm{D}} \frac{\D}{\D \texttt{x}}[\texttt{J}(\rho(\texttt{x}))]\cdot \texttt{dx} = \frac{\D \texttt{J}}{\D \texttt{x}}(\rho(\texttt{x})) \cdot \frac{\D \rho(\texttt{x})}{\D \texttt{x}}\cdot \texttt{dx}.\]