hookeai.data_generation.strain_paths.proportional_path.ProportionalStrainPathGenerator

class ProportionalStrainPathGenerator(strain_formulation, n_dim)[source]

Bases: StrainPathGenerator

Proportional strain loading path generator.

_strain_formulation

Problem strain formulation.

Type:

{‘infinitesimal’, ‘finite’}

_n_dim

Problem number of spatial dimensions.

Type:

int

_comp_order_sym

Strain/Stress components symmetric order.

Type:

tuple[str]

_comp_order_nsym

Strain/Stress components nonsymmetric order.

Type:

tuple[str]

generate_strain_path(self, strain_bounds, n_time, time_init=0.0, time_end=1.0, inc_strain_norm=None, strain_noise_std=None, n_cycle=None, random_seed=None)[source]

Generate strain path.

Constructor.

Parameters:
  • strain_formulation ({'infinitesimal', 'finite'}) – Problem strain formulation.

  • n_dim (int) – Problem number of spatial dimensions.

List of Public Methods

build_strain_tensor

Build second-order strain tensor from strain components.

generate_strain_path

Generate strain path.

plot_strain_path

Plot strain path.

Methods

__init__(strain_formulation, n_dim)

Constructor.

Parameters:
  • strain_formulation ({'infinitesimal', 'finite'}) – Problem strain formulation.

  • n_dim (int) – Problem number of spatial dimensions.

static build_strain_tensor(n_dim, strain_comps, strain_comp_order, is_symmetric=False)

Build second-order strain tensor from strain components.

All the components required to build the complete second-order strain tensor must be provided.

Parameters:
  • n_dim (int) – Number of spatial dimensions.

  • strain_comps (np.ndarray(1d)) – Strain tensor components sorted according with given components order.

  • strain_comp_order (tuple[str]) – Strain components order.

  • is_symmetric (bool, default=False) – If True, then assembles off-diagonal strain components from symmetric component.

Returns:

strain – Strain tensor.

Return type:

np.ndarray(2d)

generate_strain_path(strain_bounds, n_time, time_init=0.0, time_end=1.0, inc_strain_norm=None, strain_noise_std=None, n_cycle=None, random_seed=None)[source]

Generate strain path.

Parameters:
  • strain_bounds (dict) – Lower and upper sampling bounds (item, tuple(lower, upper)) for each independent strain component (key, str).

  • n_time (int) – Number of discrete time points.

  • time_init (float, default=0.0) – Initial time.

  • time_end (float, default=1.0) – Final time.

  • inc_strain_norm (float, default=None) – Enforce given incremental strain norm in all time steps of the strain path.

  • strain_noise_std (float, default=None) – For each discrete time, add noise to the strain components sampled from a Gaussian distribution with zero mean and given standard deviation.

  • n_cycle (int, default=None) – Number of strain path (similar) loading/reverse-loading cycles. Last time step (corresponding to the initial strain state) is replicated until the prescribed number of discrete time points is met.

  • random_seed (int, default=None) – Seed used to initialize the random number generator of Python and other libraries to preserve reproducibility.

Returns:

  • strain_comps_order (tuple[str]) – Strain components order.

  • time_hist (numpy.ndarray(1d)) – Discrete time history.

  • strain_path (numpy.ndarray(2d)) – Strain path history stored as numpy.ndarray(2d) of shape (sequence_length, n_strain_comps).

static plot_strain_path(strain_formulation, n_dim, strain_comps_order, time_hist, strain_path, is_plot_strain_path=False, is_plot_strain_comp_hist=False, is_plot_strain_norm=False, is_plot_strain_norm_hist=False, is_plot_inc_strain_norm=False, is_plot_inc_strain_norm_hist=False, is_plot_strain_path_pairs=False, is_plot_strain_pairs_hist=False, is_plot_strain_pairs_marginals=False, is_plot_strain_comp_box=False, strain_label='Strain', strain_units='', filename='strain_path', save_dir=None, is_save_fig=False, is_stdout_display=False, is_latex=False)

Plot strain path.

Parameters:
  • strain_formulation ({'infinitesimal', 'finite'}) – Problem strain formulation.

  • n_dim (int) – Problem number of spatial dimensions.

  • strain_comps_order (tuple[str]) – Strain components order.

  • time_hist ({numpy.ndarray(1d), list[numpy.ndarray(1d)]}) – Discrete time history or list of multiple discrete time histories.

  • strain_path ({numpy.ndarray(2d), list[numpy.ndarray(2d)]}) – Strain path history stored as numpy.ndarray(2d) of shape (sequence_length, n_strain_comps) or list of multiple strain path histories.

  • is_plot_strain_path (bool, default=False) – Plot the strain components path. If multiple strain paths are provided, the strain components path is only plotted for the first three available paths.

  • is_plot_strain_comp_hist (bool, default=False) – Plot a histogram for each strain component.

  • is_plot_strain_norm (bool, default=False) – Plot strain norm path and distribution.

  • is_plot_strain_norm_hist (bool, default=False) – Plot strain norm distribution.

  • is_plot_inc_strain_norm (bool, default=False) – Plot incremental strain norm path.

  • is_plot_inc_strain_norm_hist (bool, default=False) – Plot incremental strain norm distribution.

  • is_plot_strain_path_pairs (bool, default=False) – Plot the strain path for pairs of strain components in the strain space.

  • is_plot_strain_pairs_hist (bool, default=False) – Plot the distribution for pairs of strain components in the strain space.

  • is_plot_strain_pairs_marginals (bool, default=False) – Plot the pairs of strain components in the strain space together with the marginal distributions for each component.

  • is_plot_strain_comp_box (bool, default=False) – If True, then plot a box plot including the different strain components.

  • strain_label (str, default='Strain') – Strain label.

  • strain_units (str, default='') – Strain units label.

  • filename (str, default='strain_path') – Figure name.

  • save_dir (str, default=None) – Directory where figure is saved. If None, then figure is saved in current working directory.

  • is_save_fig (bool, default=False) – Save figure.

  • is_stdout_display (bool, default=False) – True if displaying figure to standard output device, False otherwise.

  • is_latex (bool, default=False) – If True, then render all strings in LaTeX. If LaTex is not available, then this option is silently set to False and all input strings are processed to remove $(…)$ enclosure.