cratepy.online.crom.asca.LoadingPath

class LoadingPath(strain_formulation, problem_type, mac_load, mac_load_presctype, mac_load_increm, max_subinc_level=5, max_cinc_cuts=5)[source]

Bases: object

Loading incrementation flow.

This class contains a collection of loading subpaths, the current loading state and a set of methods to control the loading incrementation flow.

_n_dim

Problem number of spatial dimensions.

Type:

int

_comp_order_sym

Strain/Stress components symmetric order.

Type:

list[str]

_comp_order_nsym

Strain/Stress components nonsymmetric order.

Type:

list[str]

_n_load_subpaths

Number of loading subpaths.

Type:

int

_load_subpaths

List of LoadingSubpath.

Type:

list

_conv_hom_state

Converged homogenized state (item, numpy.ndarray of shape (n_comps,)) for key in {‘strain’, ‘stress’}.

Type:

dict

_is_last_inc

Loading last increment flag.

Type:

bool

_n_cinc_cuts

Consecutive loading increment cuts counter.

Type:

int

_increm_state

Increment state: key inc contains the current increment number (int), key subpath_id contains the current loading subpath index (int).

Type:

dict

new_load_increment(self)[source]

Setup new loading increment and get associated data.

increment_cut(self, n_dim, comp_order)[source]

Perform loading increment cut and setup new increment.

update_hom_state(self, hom_strain_mf, hom_stress_mf)[source]

Update converged homogenized state.

get_subpath_state(self)[source]

Get current loading subpath state.

get_increm_state(self)[source]

Get incremental state.

_new_subpath(self)[source]

Add a new loading subpath to the loading path.

_get_load_subpath(self)[source]

Get current loading subpath.

_update_inc(self)[source]

Update loading increment counters.

_get_applied_mac_load(self)[source]

Compute current applied loading.

_get_inc_mac_load(self)[source]

Compute current incremental loading.

_remove_sym(self, comp_order_sym, comp_order_nsym)[source]

Remove the symmetric components of loading related objects.

_get_load_mf(n_dim, comp_order, load_vector)[source]

Get matricial form of load tensor given in vector form.

Constructor.

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

  • problem_type (int) – Problem type: 2D plane strain (1), 2D plane stress (2), 2D axisymmetric (3) and 3D (4).

  • mac_load (dict) – For each loading nature type (key, {‘strain’, ‘stress’}), stores the loading constraints for each loading subpath in a numpy.ndarray (2d), where the i-th row is associated with the i-th strain/stress component and the j-th column is associated with the j-th loading subpath.

  • mac_load_presctype (numpy.ndarray (2d)) – Loading nature type ({‘strain’, ‘stress’}) associated with each loading constraint (numpy.ndarrayndarray of shape (n_comps, n_load_subpaths)), where the i-th row is associated with the i-th strain/stress component and the j-th column is associated with the j-th loading subpath.

  • mac_load_increm (dict) – For each loading subpath id (key, str), stores a numpy.ndarray of shape (n_load_increments, 2) where each row is associated with a prescribed loading increment, and the columns 0 and 1 contain the corresponding incremental load factor and incremental time, respectively.

  • max_subinc_level (int, default=5) – Maximum level of loading subincrementation.

  • max_cinc_cuts (int, default=5) – Maximum number of consecutive load increment cuts.

List of Public Methods

get_increm_state

Get incremental state.

get_subpath_state

Get current loading subpath state.

increment_cut

Perform loading increment cut and setup new increment.

new_load_increment

Setup new loading increment and get associated data.

update_hom_state

Update converged homogenized state.

Methods

__init__(strain_formulation, problem_type, mac_load, mac_load_presctype, mac_load_increm, max_subinc_level=5, max_cinc_cuts=5)[source]

Constructor.

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

  • problem_type (int) – Problem type: 2D plane strain (1), 2D plane stress (2), 2D axisymmetric (3) and 3D (4).

  • mac_load (dict) – For each loading nature type (key, {‘strain’, ‘stress’}), stores the loading constraints for each loading subpath in a numpy.ndarray (2d), where the i-th row is associated with the i-th strain/stress component and the j-th column is associated with the j-th loading subpath.

  • mac_load_presctype (numpy.ndarray (2d)) – Loading nature type ({‘strain’, ‘stress’}) associated with each loading constraint (numpy.ndarrayndarray of shape (n_comps, n_load_subpaths)), where the i-th row is associated with the i-th strain/stress component and the j-th column is associated with the j-th loading subpath.

  • mac_load_increm (dict) – For each loading subpath id (key, str), stores a numpy.ndarray of shape (n_load_increments, 2) where each row is associated with a prescribed loading increment, and the columns 0 and 1 contain the corresponding incremental load factor and incremental time, respectively.

  • max_subinc_level (int, default=5) – Maximum level of loading subincrementation.

  • max_cinc_cuts (int, default=5) – Maximum number of consecutive load increment cuts.

_get_applied_mac_load()[source]

Compute current applied loading.

Returns:

applied_mac_load – For each prescribed loading nature type (key, {‘strain’, ‘stress’}), stores the current applied loading constraints in a numpy.ndarray of shape (n_comps,).

Return type:

dict

_get_inc_mac_load()[source]

Compute current incremental loading.

Returns:

inc_mac_load – For each loading nature type (key, {‘strain’, ‘stress’}), stores the incremental loading constraint in a numpy.ndarray of shape (n_comps,).

Return type:

dict

static _get_load_mf(n_dim, comp_order, load_vector)[source]

Get matricial form of load tensor given in vector form.

Parameters:
  • comp_order (list[str]) – Strain/Stress components (str) order.

  • load_vector (numpy.ndarray (1d)) – Loading tensor in vector form (numpy.ndarray of shape (n_comps,)).

Returns:

load_mf – Loading tensor matricial form (numpy.ndarray of shape (n_comps,)).

Return type:

numpy.ndarray (1d)

_get_load_subpath()[source]

Get current loading subpath.

Returns:

load_subpath – Current loading subpath.

Return type:

LoadingSubpath

_new_subpath()[source]

Add a new loading subpath to the loading path.

_remove_sym(comp_order_sym, comp_order_nsym)[source]

Remove the symmetric components of loading related objects.

Under an infinitesimal strain formulation, remove the symmetric strain/stress components of loading related objects. In addition, the remaining independent components are sorted according to the problem strain/stress symmetric component order.


Parameters:
  • comp_order_sym (list[str]) – Symmetric strain/stress components (str) order.

  • comp_order_nsym (list[str]) – Nonsymmetric strain/stress components (str) order.

_update_inc()[source]

Update loading increment counters.

get_increm_state()[source]

Get incremental state.

Returns:

increm_state – Increment state: key inc contains the current increment number, key subpath_id contains the current loading subpath index.

Return type:

dict

get_subpath_state()[source]

Get current loading subpath state.

Returns:

  • id (int) – Loading subpath id.

  • inc (int) – Current loading subpath increment counter.

  • total_lfact (float) – Current loading subpath current total load factor.

  • inc_lfact (float) – Current loading subpath current incremental load factor.

  • total_time (float) – Current loading subpath current total time.

  • inc_time (float) – Current loading subpath current incremental time.

  • sub_inc_level (int) – Current loading subpath current subincrementation level.

increment_cut(n_dim, comp_order)[source]

Perform loading increment cut and setup new increment.

Parameters:
  • n_dim (int) – Problem dimension.

  • comp_order (list[str]) – Strain/Stress components (str) order.

Returns:

  • applied_mac_load_mf (dict) – For each prescribed loading nature type (key, {‘strain’, ‘stress’}), stores the current applied loading constraints in a numpy.ndarray of shape (n_comps,).

  • inc_mac_load_mf (dict) – For each loading nature type (key, {‘strain’, ‘stress’}), stores the incremental loading constraint matricial form in a numpy.ndarray of shape (n_comps,).

  • n_presc_strain (int) – Number of prescribed macroscale loading strain components.

  • presc_strain_idxs (list[int]) – Prescribed macroscale loading strain components indexes.

  • n_presc_stress (int) – Number of prescribed macroscale loading stress components.

  • presc_stress_idxs (list[int]) – Prescribed macroscale loading stress components indexes.

  • is_last_inc (bool) – Loading last increment flag.

new_load_increment()[source]

Setup new loading increment and get associated data.

Returns:

  • applied_mac_load_mf (dict) – For each prescribed loading nature type (key, {‘strain’, ‘stress’}), stores the current applied loading constraints in a numpy.ndarray of shape (n_comps,).

  • inc_mac_load_mf (dict) – For each loading nature type (key, {‘strain’, ‘stress’}), stores the incremental loading constraint matricial form in a numpy.ndarray of shape (n_comps,).

  • n_presc_strain (int) – Number of prescribed loading strain components.

  • presc_strain_idxs (list[int]) – Prescribed loading strain components indexes.

  • n_presc_stress (int) – Number of prescribed loading stress components.

  • presc_stress_idxs (list[int]) – Prescribed loading stress components indexes.

  • is_last_inc (bool) – Loading last increment flag.

update_hom_state(hom_strain_mf, hom_stress_mf)[source]

Update converged homogenized state.

Parameters:
  • hom_strain_mf (numpy.ndarray (1d)) – Homogenized strain tensor stored in matricial form.

  • hom_stress_mf (numpy.ndarray (1d)) – Homogenized stress tensor stored in matricial form.