Filter classes
Smooth or project the density parameter p before to convert it to material properties.
Filtering can help the solver to better converge because it can delete large material property difference on neighbor cells, and to impose length constraint on the optimisation for example.
- class HydrOpTop.Filters.Density_Filter(filter_radius=1.0, distance_weighting_power=1)
- Description:
Smooth the density parameter p at a given cell i according to its value at the neighboring cells j weighted by the distance of their respective centers:
\[\bar{p}_i = \frac{R^n V_i p_i + \sum_{j \in \partial i} (R-d_{ij})^n V_j p_j} {R^n V_i + \sum_{j \in \partial i} (R-d_{ij})^n V_j}\]This filter was proposed by Bruns and Tortorelli (2001) and Bourdin (2001). Usefull to remove numerical instability and deals with the checkboard effect.
- Parameters:
filter_radius(float or list): the ball radius (float value) on which to search for neighboring cell center for averaging the density parameter. If a list is provided (i.e.[dx,dy,dz]), the cell centers are searched into a ellipsoid of half axis dx, dy and dz.distance_weighting_powerthe exponent for distance weighting \(n\)
Required solver outputs:
Filtering the density parameter according to its nearby value: (a) the density parameter, (b) filtered density parameter using a ball neighbors search, (c) using an ellipsoid neighbors search and (d) increasing the weighting power from 1 to 4.
- class HydrOpTop.Filters.Heaviside_Filter(cutoff=0.5, steepness=5)
- Decription:
Apply the smooth Heaviside function to the density parameter with a given steepness and cutoff. Heaviside filters are usually applied on already filtered field using the previous density filter to help impose a minimum length constrain and to avoid blurry contour. The smooth Heaviside function is defined as:
\[\tilde{p}_i = \frac{\tanh(\beta \eta) + \tanh(\beta (\bar p - \eta))} {\tanh(\beta \eta) + \tanh(\beta (1- \eta))}\]- Parameters:
cutoff(float): the cutoff parameter \(\eta\) (i.e. the value of \(p_i\) where the step is located)steepness(float): the steepness of the smooth Heaviside function \(\beta\)
Required solver output:
The three field filtering process: (a) the density parameter (1st field), (b) the filtered density parameter with a anisotropic density filter (2nd field), and (c) and (d) the projected density parameter using two heavyside density filter with different stepness parameter (3rd field).