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.
- _conv_hom_state¶
Converged homogenized state (item, numpy.ndarray of shape (n_comps,)) for key in {‘strain’, ‘stress’}.
- Type:
- _increm_state¶
Increment state: key inc contains the current increment number (int), key subpath_id contains the current loading subpath index (int).
- Type:
- increment_cut(self, n_dim, comp_order)[source]¶
Perform loading increment cut and setup new increment.
- _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 incremental state.
Get current loading subpath state.
Perform loading increment cut and setup new increment.
Setup new loading increment and get associated data.
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:
- _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:
- 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:
- _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.
- 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:
- 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:
- 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.