cratepy.ioput.readprocedures.read_macroscale_loading¶
- read_macroscale_loading(file, file_path, mac_load_type, strain_formulation, n_dim, comp_order_nsym)[source]¶
Read macroscale loading constraints.
The storage of the macroscale strain/stress tensors is performed according to the problem type nonsymmetric component order.
The specification of the data associated with the macroscale loading constraints has the following input data file syntax:
2D Problem:
Macroscale strain constraint:
Macroscale_Strain [< n_load_subpaths >] < component_name_11 > < float > < float > ... < component_name_21 > < float > < float > ... < component_name_12 > < float > < float > ... < component_name_22 > < float > < float > ...
where n_load_subpaths is the number of loading subpaths (defaults to 1), each associated with a given column. Irrespective of the name given to each component, it is assumed that all the components of the macroscale strain tensor (assumed nonsymmetric) are specified in columnwise order.
Macroscale stress constraint:
Macroscale_Stress [< n_load_subpaths >] < component_name_11 > < float > < float > ... < component_name_21 > < float > < float > ... < component_name_12 > < float > < float > ... < component_name_22 > < float > < float > ...
where n_load_subpaths is the number of loading subpaths (defaults to 1), each associated with a given column. Irrespective of the name given to each component, it is assumed that all the components of the macroscale stress tensor (assumed nonsymmetric) are specified in columnwise order.
Macroscale strain and stress constraint:
Macroscale_Strain [< n_load_subpaths >] < component_name_11 > < float > < float > ... < component_name_21 > < float > < float > ... < component_name_12 > < float > < float > ... < component_name_22 > < float > < float > ... Macroscale_Stress < n_load_subpaths > < component_name_11 > < float > < float > ... < component_name_21 > < float > < float > ... < component_name_12 > < float > < float > ... < component_name_22 > < float > < float > ... Mixed_Prescription_Index < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ...
where n_load_subpaths is the number of loading subpaths (defaults to 1), each associated with a given column. The corresponding nature of each strain (0) or stress (1) component is specified accordingly under the Mixed_Prescription_Index keyword. Irrespective of the name given to each component, it is assumed that all the components of the macroscale strain and stress tensors (assumed nonsymmetric) are specified in columnwise order. Components not enforced through the mixed loading prescription are ignored.
3D Problem:
Macroscale strain constraint:
Macroscale_Strain [< n_load_subpaths >] < component_name_11 > < float > < float > ... < component_name_21 > < float > < float > ... < component_name_31 > < float > < float > ... < component_name_12 > < float > < float > ... < component_name_22 > < float > < float > ... < component_name_32 > < float > < float > ... < component_name_13 > < float > < float > ... < component_name_23 > < float > < float > ... < component_name_33 > < float > < float > ...
where n_load_subpaths is the number of loading subpaths (defaults to 1), each associated with a given column. Irrespective of the name given to each component, it is assumed that all the components of the macroscale strain tensor (assumed nonsymmetric) are specified in columnwise order.
Macroscale stress constraint:
Macroscale_Stress [< n_load_subpaths >] < component_name_11 > < float > < float > ... < component_name_21 > < float > < float > ... < component_name_31 > < float > < float > ... < component_name_12 > < float > < float > ... < component_name_22 > < float > < float > ... < component_name_32 > < float > < float > ... < component_name_13 > < float > < float > ... < component_name_23 > < float > < float > ... < component_name_33 > < float > < float > ...
where n_load_subpaths is the number of loading subpaths (defaults to 1), each associated with a given column. Irrespective of the name given to each component, it is assumed that all the components of the macroscale stress tensor (assumed nonsymmetric) are specified in columnwise order.
Macroscale strain and stress constraint:
Macroscale_Strain [< n_load_subpaths >] < component_name_11 > < float > < float > ... < component_name_21 > < float > < float > ... < component_name_31 > < float > < float > ... < component_name_12 > < float > < float > ... < component_name_22 > < float > < float > ... < component_name_32 > < float > < float > ... < component_name_13 > < float > < float > ... < component_name_23 > < float > < float > ... < component_name_33 > < float > < float > ... Macroscale_Stress [< n_load_subpaths >] < component_name_11 > < float > < float > ... < component_name_21 > < float > < float > ... < component_name_31 > < float > < float > ... < component_name_12 > < float > < float > ... < component_name_22 > < float > < float > ... < component_name_32 > < float > < float > ... < component_name_13 > < float > < float > ... < component_name_23 > < float > < float > ... < component_name_33 > < float > < float > ... Mixed_Prescription_Index < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ... < 0 or 1 > < 0 or 1 > ...
where n_load_subpaths is the number of loading subpaths (defaults to 1), each associated with a given column. The corresponding nature of each strain (0) or stress (1) component is specified accordingly under the Mixed_Prescription_Index keyword. Irrespective of the name given to each component, it is assumed that all the components of the macroscale strain and stress tensors (assumed nonsymmetric) are specified in columnwise order. Components not enforced through the mixed loading prescription are ignored.
- Parameters:
file (file) – Data file.
file_path (str) – Data file path.
mac_load_type ({1, 2, 3}) –
Macroscale loading type:
1 : Macroscale strain constraint
2 : Macroscale stress constraint
3 : Macroscale strain and stress constraint
strain_formulation ({'infinitesimal', 'finite'}) – Problem strain formulation.
n_dim (int) – Problem number of spatial dimensions.
comp_order_nsym (list[str]) – Strain/Stress components nonsymmetric order.
- Returns:
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 (ndarray 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.