Parametrization class

Parametrization class link the (possibly filtered) density parameter to the simulation material propertie. Each parametrization requires the parametrized material property name such as defined in the solver IO shield. A helper plot function also allow visualizing the transformation of the density parameter to material properties. See the end of the page.


class HydrOpTop.Materials.Identity(cell_ids_to_parametrize, property_name)
Description:

Create a 1 for 1 correspondance between the density parameter and the material property. Designed for debugging purpose.


class HydrOpTop.Materials.SIMP(cell_ids_to_parametrize, property_name, bounds, power=3, reverse=False)
Description:

SIMP stands for Standard Isotropic Material Parametrization. It applies the following relation between the material properties \(X\) and the density parameter \(p\):

\[X(p) = X_0 + (X_1 - X_0) p^n\]

Where \(X_0\) and \(X_1\) is the material property values when \(p=0\) and \(p=1\). \(n\) the penalization power (see X).

Parameters:

cell_ids_to_parametrize (iterable): the cell ids on which to apply the parametrization

property_name (str): the name of the material parameter (same as defined in the solver IO shield)

bounds (list): the X_0 and X_1 values in a list

power (float): the penalization power n

reverse (bool): set to True, reverse the bounds.


Similar to the previous parametrization but in logarithm scale

class HydrOpTop.Materials.Log_SIMP(cell_ids_to_parametrize, property_name, bounds, power=3, reverse=False)
Description:

SIMP stands for Standard Isotropic Material Parametrization. It applies the following relation between the material properties \(X\) and the density parameter \(p\):

\[X(p) = 10^{\log{X_0} + \log(\frac{X_1}{X_0}) p^n}\]

Where \(X_0\) and \(X_1\) is the material property values when \(p=0\) and \(p=1\). \(n\) the penalization power (see X).

Parameters:

cell_ids_to_parametrize (iterable): the cell ids on which to apply the parametrization

property_name (str): the name of the material parameter (same as defined in the solver IO shield)

bounds (list): the X_0 and X_1 values in a list

power (float): the penalization power n

reverse (bool): set to True, reverse the bounds.


class HydrOpTop.Materials.RAMP(cell_ids_to_parametrize, property_name, bounds, parameter=3, reverse=False)
Description:

RAMP stands for Rational Approximation of of Material Properties. It applies the following relation between the material properties \(X\) and the density parameter \(p\):

\[X(p) = X_0 + (X_1 - X_0) \frac{p} {1 + q (1-p)}\]

Where \(X_0\) and \(X_1\) is the material property values when \(p=0\) and \(p=1\), and \(q\) is the RAMP parameter.

Parameters:

cell_ids_to_parametrize (iterable): the cell ids on which to apply the parametrization

property_name (str): the name of the material parameter (same as defined in the solver IO shield)

bounds (list): the X_0 and X_1 values in a list

parameter (float): the RAMP parameter q

reverse (bool): set to True, reverse the bounds.


HydrOpTop.Materials.plot_function.plot_function(parametrization_class, block=True)
Description:

Help visualize the transformation applied to the (filtered) density parameter the get the material properties. Require the matplotlib library to be installed.

Parameter:

parametrization_class (parametrization instance): the material parametrization instance as define above.

block (bool): set to False, does not block the GUI.