upxo.mechanics.twins_calculations module
Created on Thu Jun 27 10:10:12 2024
@author: Dr. Sunil Anandatheertha
- upxo.mechanics.twins_calculations.calculate_schmid_factor(loading_axis, K1, eta1)[source]
Calculates the Schmid factor for a given twin variant.
- Parameters:
loading_axis – The loading axis as a 3D unit vector (e.g., [1, 0, 0] for [100] direction).
K1 – The twin plane normal as a 3D unit vector.
eta1 – The twinning shear direction as a 3D unit vector.
- Returns:
The Schmid factor (a float value).
- upxo.mechanics.twins_calculations.calculate_crss(stress, schmid_factor)[source]
Calculates the critical resolved shear stress (CRSS).
- Parameters:
stress – The applied stress at twinning initiation.
schmid_factor – The Schmid factor of the twin variant.
- Returns:
The CRSS (a float value).
- upxo.mechanics.twins_calculations.calculate_all_crss(loading_axis, twin_variants, stress)[source]
Calculates CRSS for all twin variants and returns a dictionary.
- Parameters:
loading_axis – The loading axis as a 3D unit vector (e.g., [1, 0, 0] for [100] direction).
twin_variants – A list of tuples, each containing (K1, eta1) for a twin variant, where K1 and eta1 are 3D unit vectors.
stress – The applied stress at twinning initiation.
- Returns:
A dictionary where keys are twin variant indices (1-based) and values are dictionaries with keys ‘K1’, ‘eta1’, and ‘CRSS’, containing the corresponding values.
- upxo.mechanics.twins_calculations.euler_to_rotation_matrix(phi1, Phi, phi2, degrees=False)[source]
Converts Bunge Euler angles to a rotation matrix.
- Parameters:
phi1 – Bunge Euler angles (in radians by default).
Phi – Bunge Euler angles (in radians by default).
phi2 – Bunge Euler angles (in radians by default).
degrees – If True, input angles are interpreted as degrees.
- Returns:
A 3x3 NumPy array representing the rotation matrix.
- upxo.mechanics.twins_calculations.miller_to_cartesian(miller_indices, R)[source]
Converts Miller indices to a Cartesian vector in the grain’s frame.
- Parameters:
miller_indices – A list or tuple of Miller indices (h, k, l).
R – The rotation matrix representing the grain’s orientation.
- Returns:
A NumPy array representing the Cartesian vector.
- upxo.mechanics.twins_calculations.calculate_activated_twins(loading_axis_miller, euler_angles, twin_variants, stress)[source]
Calculates activated twin variants and their morphological orientations.
- upxo.mechanics.twins_calculations.calculate_twin_plane_normal(K1_grain, euler_angles)[source]
Calculates the normal unit vector of a twin plane and its projections.
- Parameters:
K1_grain – The twin plane normal in the grain’s frame (a 3D NumPy array).
euler_angles – The Bunge Euler angles of the grain (phi1, Phi, phi2).
- Returns:
‘normal’: The twin plane normal unit vector in the grain structure’s frame. ‘proj_xy’: Projection of the normal onto the xy plane. ‘proj_yz’: Projection of the normal onto the yz plane. ‘proj_zx’: Projection of the normal onto the zx plane.
- Return type:
A dictionary containing