fatpy
¶
FatPy - A Python package for fatigue life evaluation of materials.
core
¶
Core fatigue analysis methods and functionality.
damage_cumulation
¶
Damage cumulation module.
The module implements various fatigue damage accumulation rules used to estimate the total damage under variable amplitude loading. They include both classical linear models, such as Palmgren–Miner’s rule, and more advanced non-linear approaches that account for load sequence effects, mean stress influence, and material-specific behavior for improved fatigue life prediction.
decompositions
¶
Decompositions module.
Methods for breaking down complex load signals to cycles. Contains both the uniaxial and the multiaxial procedures.
multiaxial
¶
Multiaxial decompositions methods.
These routines provide tools for decomposing multiaxial stress and strain states into their individual components, such as normal and shear parts, principal values, and others. They are essential for analyzing complex loading conditions, enabling accurate evaluation of material behavior under multiaxial fatigue.
load_path_analysis_5d
¶
Load Path Analysis 5D methods of multiaxial decompositions.
These methods compute the amplitude (J_2,a) and mean (J_2,m) values of the second invariant of the deviatoric stress tensor in five-dimensional deviatoric space. This evaluation is particularly useful in advanced multiaxial fatigue models, where accurate representation of cyclic loading paths and stress states in the deviatoric space is critical for predicting material response.
shear_path_analysis_2d
¶
Shear Path Analysis 2D methods of multiaxial decompositions.
These methods are designed to evaluate the mean shear stress and shear stress amplitude acting on a specified material plane, typically used in multiaxial fatigue analysis. By projecting the stress tensor onto the plane of interest, they provide key parameters for assessing crack initiation risks and fatigue life under complex loading paths.
uniaxial
¶
Uniaxial decompositions methods.
Implements algorithms designed to decompose one-dimensional signals into individual load cycles, enabling detailed analysis of variable amplitude loading. By identifying turning points and extracting cycles based on established criteria (e.g., rainflow counting), they facilitate fatigue analysis, damage assessment, and other time-domain signal evaluations.
energy_life
¶
Energy-based fatigue life analysis methods.
Fatigue analysis methods based on the relationship between the strain energy (usually strain energy density) and number of cycles to failure.
plane_based_methods
¶
Plane-based methods module.
Methods for processing stress tensor path on a material plane. Provides basic infrastructure for prediction methods based on critical-plane and integral approaches.
plane_search
¶
Plane Search methods.
Algorithms to identify a subset of potentially critical planes for further detailed analysis and processing by critical-plane and integral methods.
strain_life
¶
Strain-based fatigue life analysis methods.
These methods perform fatigue analysis using the relationship between strain amplitude and the number of cycles to failure, as expressed by strain-life (ε-N) approaches such as the Coffin-Manson and Basquin laws. They are particularly suited for low-cycle and transitional fatigue regimes, where plastic strain plays a significant role, enabling life prediction under variable amplitude or multiaxial loading when combined with appropriate mean stress corrections and cycle counting techniques.
base_methods
¶
Base methods for the strain-life.
correction_methods
¶
Correction methods for the strain-life approach.
Methods to estimate notch stress/strain with local yielding and apply mean stress correction.
elastic_plastic_conversion
¶
Elastic-Plastic Conversion methods for Strain-Life analysis.
These methods convert purely elastic stress or strain states into their elastic-plastic equivalents to account for local yielding effects in fatigue or fracture assessments. Using approaches such as Neuber's rule or Glinka's strain energy density method, they provide corrected stress-strain values that better represent actual material behavior under high local stresses, especially at notches or other stress concentrators.
mean_stress_effect
¶
Mean Stress Effect correction methods for Strain-Life Analysis.
The methods for incorporating the effect of mean stress in strain-life (ε-N) analysis.
damage_params
¶
Damage parameters calculation methods for the strain-life approach.
This module includes both uniaxial and multiaxial parameters for low-cycle fatigue assessment, covering a range of strain-life-based damage models suitable for high plastic strain regimes. It also incorporates methods based on the FKM Guideline, enabling standardized evaluation of fatigue strength under complex loading conditions.
fkm_nonlin
¶
fkm non-linear damage parameter calculations for strain-life analysis.
The module contains damage parameters based on FKM-Guideline Non-Linear.
multiaxial
¶
Multiaxial fatigue criteria methods for the strain-life approach.
These methods perform low-cycle fatigue assessment using multiaxial damage parameters that combine stress, strain, and mean stress effects into a single fatigue-relevant quantity. By incorporating critical plane, invariant-based, and energy-based criteria, they enable life prediction for components subjected to complex non-proportional loading paths where significant plastic deformation occurs.
uniaxial
¶
Uniaxial fatigue criteria methods for the strain-life approach.
These methods compute uniaxial damage parameters used in strain-life (ε-N) analysis to correlate cyclic strain amplitudes with fatigue life. They include parameters such as Coffin-Manson, Morrow, and Smith-Watson-Topper (SWT), which combine elastic and plastic strain components—and, when applicable, mean stress effects—into a single scalar value for life prediction under uniaxial loading conditions.
stress_life
¶
Stress-based fatigue life analysis methods.
Stress-based fatigue assessment methods. Contains approach to estimate fatigue damage and their correction on various fatigue effects (stress concentration, size, surface quality, etc.)
base_methods
¶
Base methods for the stress-life.
correction_methods
¶
Correction methods for the stress-life.
These methods project how various factors—such as surface finish, size effect, mean stress, residual stresses, temperature, manufacturing defects, and notch geometry—modify the fatigue strength of a real component by quantifying shifts in the S-N curve or fatigue limit.
eq_stress_at_crit_dist
¶
Equivalent stress at critical distance correction methods for stress-life approach.
These modules implement various Theory of Critical Distances (TCD)-based approaches for stress-gradient correction, which improve fatigue strength predictions near stress concentrators such as notches or cracks. By incorporating characteristic length parameters, the methods account for the spatial distribution of stress and mitigate the over-conservatism of local stress-based criteria, offering more accurate fatigue assessments under both uniaxial and multiaxial loading conditions.
fatigue_limit
¶
Fatigue limit correction methods for the stress-life approach.
These routines calculate correction factors that modify the fatigue limit in an S-N curve to account for real-world influences such as surface finish, size effect, mean stress, residual stresses, temperature, and notches. By combining these empirical correction models, adjusted endurance limits may be produced for component-level fatigue prediction.
power_law
¶
Power law correction methods for the stress-life approach.
These methods are used to project the influence of various factors—such as surface finish, size effect, mean stress, or residual stresses—on the slope of the S-N curve for a real component. The fatigue behavior is modeled using a power law formulation.
damage_params
¶
Damage parameters calculation methods for the stress-life approach.
These methods provide parameters for evaluating stress-based fatigue damage under uniaxial or multiaxial loading conditions. They include critical plane and invariant-based approaches, such as maximum principal stress, Findley's and Dang Van's criteria, which relate the applied stress state to fatigue life by identifying the most damaging stress components or orientations.
multiaxial
¶
Multiaxial fatigue criteria methods for the stress-life approach.
These modules implement a range of criteria for assessing fatigue strength under multiaxial stress states, addressing both proportional and non-proportional loading paths. The implemented models include critical plane approaches, energy-based methods, and stress invariants, enabling prediction of fatigue limits/strengths for complex loading scenarios across various materials and geometries.
uniaxial
¶
Uniaxial fatigue criteria methods for the stress-life approach.
Contains criteria that address uniaxial high-cycle fatigue by incorporating the mean stress effect through an equivalent stress amplitude approach. By adjusting the stress amplitude to account for mean stress influences—using models such as Goodman, Gerber, or Soderberg—they enable more accurate fatigue life predictions where mean stresses significantly affect material endurance.
data_parsing
¶
examples
¶
This module contains an example function with a detailed docstring.
docstring_example_tmp
¶
This module contains an example function with a detailed docstring.
ExampleClass
¶
An example class to demonstrate docstring formatting.
Source code in src/fatpy/examples/docstring_example_tmp.py
__init__(value)
¶
Initialize the ExampleClass with a value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
The initial value for the class instance. |
required |
increment(amount)
¶
Increment the stored value by a specified amount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
int
|
The amount to increment the value by. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The new value after incrementing. |
Source code in src/fatpy/examples/docstring_example_tmp.py
example_method_with_docstring(a, b)
¶
Docstring with a cross-reference to the example function.
This method demonstrates how to reference another function's docstring.
It calls example_function_with_docstring with sample arguments.
Cross-reference
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
int
|
The first integer value. |
required |
b
|
int
|
The second integer value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The result of the example function. |
Source code in src/fatpy/examples/docstring_example_tmp.py
example_function_with_docstring(a, b)
¶
This docstring highlights Mermaid diagrams, math expressions, and code examples.
This function takes two integers and returns their sum. It demonstrates various mkdocs-material features:
Information
This is an informational admonition block.
Important Note
Make sure both parameters are integers.
Mermaid Diagram¶
graph TD
A[Start] --> B{Is it a number?}
B -- Yes --> C[Process the number]
B -- No --> D[Throw an error]
C --> E[End]
D --> E
Mathematical Expression¶
Inline math: \(E = mc^2\)
Code Examples¶
Expandable Example
This is a collapsible content section that shows more detailed usage:
Table Example¶
| Input A | Input B | Result |
|---|---|---|
| 1 | 2 | 3 |
| 5 | 7 | 12 |
| 0 | 0 | 0 |
Args:¶
a(int): The first integer.b(int): The second integer.
Returns:¶
- int: The sum of the two integers.
Raises:¶
TypeError: If inputs are not integers.
Examples:¶
Source code in src/fatpy/examples/docstring_example_tmp.py
material_laws
¶
Material laws module.
Contains classes and functions that define material laws and enable their calibration for the material under consideration.
cyclic_stress_strain_curve
¶
Cyclic stress–strain curve approximation models.
Implements various formulations, such as the Ramberg–Osgood model, describing the relationship between elastic–plastic stress and strain.
en_curve
¶
Strain-life curve approximations.
Implements strain-life (ε-N) curve models such as the Manson-Coffin and Basquin relations, and provides conversions between strain amplitude and fatigue life in both directions.
hookes_law
¶
Hooke's law.
Converts between elastic stress and strain with varying levels of complexity depending on dimensionality.
regression_analysis
¶
Regression analysis methods of material laws.
Implements linear and non-linear regression methods for calibrating material laws.
sn_curve
¶
Stress-life curve methods of material laws.
Provides implementations of Wöhler (S-N) curve models along with methods for converting between stress amplitude and fatigue life in both directions.
struct_mech
¶
Structural mechanics module.
Contains structural mechanics related classes and methods.
strain
¶
Calculate fundamental strain metrics and invariants.
These functions provide principal strains, hydrostatic strain, von Mises equivalent strain, and invariants of the strain tensor. They are essential for strength, fatigue, and fracture analyses under both uniaxial and multiaxial loading conditions.
Conventions: - Vectors use Voigt notation with shape (..., 6), where the last dimension contains the six Voigt components and leading dimensions are preserved:
(ε_11, ε_22, ε_33, ε_23, ε_13, ε_12)
(ε_xx, ε_yy, ε_zz, ε_yz, ε_xz, ε_xy)
- Principal strains are ordered in descending order throughout the module: ε1 ≥ ε2 ≥ ε3.
- Principal directions (eigenvectors) are aligned to this ordering (columns correspond to ε1, ε2, ε3).
calc_principal_strains_and_directions(strain_vector_voigt)
¶
Calculate principal strains and principal directions for each state.
Math Equations
Principal strains and directions are found by solving the eigenvalue problem for the strain tensor:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strain_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt strain components. Leading dimensions are preserved. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Tuple |
(eigvals, eigvecs)
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/strain.py
calc_principal_strains(strain_vector_voigt)
¶
Calculate principal strains for each strain state.
Math Equations
Principal strains are found by solving the eigenvalue problem for the strain tensor:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strain_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt strain components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (..., 3). Principal strains (descending: ε1 ≥ ε2 ≥ ε3). |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/strain.py
calc_strain_invariants(strain_vector_voigt)
¶
Calculate the first, second, and third invariants for each strain state.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strain_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt strain components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (..., 3). The last dimension contains (I1, I2, I3) for each entry. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/strain.py
calc_volumetric_strain(strain_vector_voigt)
¶
Calculate the volumetric (mean normal)strain for each strain state.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strain_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt strain components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Volumetric (mean normal) strain for each input state. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/strain.py
calc_deviatoric_strain(strain_vector_voigt)
¶
Calculate the deviatoric strain for each strain state.
Math Equations
The strain tensor decomposes as:
where the deviatoric part is traceless and obtained by subtracting the volumetric part from the normal components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strain_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt strain components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (..., 6). Deviatoric strain for each input state. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/strain.py
calc_von_mises_strain(strain_vector_voigt)
¶
Von Mises equivalent strain computed directly from Voigt components.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strain_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt strain components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Von Mises equivalent strain for each entry. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/strain.py
calc_signed_von_mises_by_max_abs_principal(strain_vector_voigt, rtol=1e-05, atol=1e-08)
¶
Calculate signed von Mises equivalent strain for each strain state.
Sign is determined by average of the maximum and minimum principal strains.
Sign Convention
The sign assignment follows these rules:
- Positive (+): When (ε₁ + ε₃)/2 > 0 (tension dominant)
- Negative (-): When (ε₁ + ε₃)/2 < 0 (compression dominant)
- Positive (+): When (ε₁ + ε₃)/2 ≈ 0 (within tolerance, default fallback)
Tolerance parameters ensure numerical stability in edge cases where the determining value is very close to zero, preventing erratic sign changes that could occur due to floating-point precision limitations.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strain_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt strain components. Leading dimensions are preserved. |
required |
rtol
|
float
|
Relative tolerance for comparing the average of maximum and minimum principal strain to zero. Default is 1e-5. |
1e-05
|
atol
|
float
|
Absolute tolerance for comparing the average of maximum and minimum principal strain to zero. Default is 1e-8. |
1e-08
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Signed von Mises equivalent strain for each entry. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/strain.py
stress
¶
Calculate fundamental stress metrics and invariants.
These functions provide principal stresses, maximum shear (Tresca) stress, hydrostatic stress, von Mises equivalent stress, and invariants of the stress tensor. They are essential for strength, fatigue, and fracture analyses under both uniaxial and multiaxial loading conditions.
Conventions: - Vectors use Voigt notation with shape (..., 6), where the last dimension contains the six Voigt components and leading dimensions are preserved:
(σ_11, σ_22, σ_33, σ_23, σ_13, σ_12)
(σ_xx, σ_yy, σ_zz, σ_yz, σ_xz, σ_xy)
-
Principal stresses are ordered in descending order throughout the module (σ_1 ≥ σ_2 ≥ σ_3).
-
Principal directions (eigenvectors) are aligned to this ordering (columns correspond to σ_1, σ_2, σ_3).
calc_principal_stresses_and_directions(stress_vector_voigt)
¶
Calculate principal stresses and principal directions for each state.
Math Equations
Principal stresses and directions are found by solving the eigenvalue problem for the stress tensor:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Tuple |
(eigvals, eigvecs)
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_principal_stresses(stress_vector_voigt)
¶
Calculate principal stresses for each stress state.
Math Equations
Principal stresses are found by solving the eigenvalue problem for the stress tensor:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (..., 3). Principal stresses (descending: σ1 ≥ σ2 ≥ σ3). |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_stress_invariants(stress_vector_voigt)
¶
Calculate the first, second, and third invariants for each stress state.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (..., 3). The last dimension contains (I1, I2, I3) for each entry. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_hydrostatic_stress(stress_vector_voigt)
¶
Calculate the hydrostatic (mean normal) stress for each stress state.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Hydrostatic stress for each input state. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_stress_deviator(stress_vector_voigt)
¶
Calculate stress deviator for each stress state.
Math Equations
The stress tensor decomposes as:
where the deviatoric part \(\mathbf{s}\) is traceless and obtained by subtracting the hydrostatic part from the normal components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (..., 6). Stress deviator for each entry. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_von_mises_stress(stress_vector_voigt)
¶
Calculate von Mises equivalent stress for each stress state.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Von Mises equivalent stress for each entry. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_signed_von_mises_by_hydrostatic(stress_vector_voigt, rtol=1e-05, atol=1e-08)
¶
Calculate signed von Mises stress for each stress state.
Sign is determined by the hydrostatic stress.
Sign Convention
The sign assignment follows these rules:
- Positive (+): When hydrostatic stress > 0 (tensile dominant state)
- Negative (-): When hydrostatic stress < 0 (compressive dominant state)
- Positive (+): When hydrostatic stress ≈ 0 (within tolerance, default fallback)
Tolerance parameters ensure numerical stability in edge cases where the determining value is very close to zero, preventing erratic sign changes that could occur due to floating-point precision limitations.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
rtol
|
float
|
Relative tolerance for comparing hydrostatic stress to zero. Default is 1e-5. |
1e-05
|
atol
|
float
|
Absolute tolerance for comparing hydrostatic stress to zero. Default is 1e-8. |
1e-08
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Signed von Mises stress for each entry. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_signed_von_mises_by_max_abs_principal(stress_vector_voigt, rtol=1e-05, atol=1e-08)
¶
Calculate signed von Mises stress for each stress state.
Sign is determined by average of the maximum and minimum principal stresses.
Sign Convention
The sign assignment follows these rules:
- Positive (+): When (σ₁ + σ₃)/2 > 0 (tension dominant)
- Negative (-): When (σ₁ + σ₃)/2 < 0 (compression dominant)
- Positive (+): When (σ₁ + σ₃)/2 ≈ 0 (within tolerance, default fallback)
Tolerance parameters ensure numerical stability in edge cases where the determining value is very close to zero, preventing erratic sign changes that could occur due to floating-point precision limitations.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
rtol
|
float
|
Relative tolerance for comparing the average of maximum and minimum principal stresses to zero. Default is 1e-5. |
1e-05
|
atol
|
float
|
Absolute tolerance for comparing the average of maximum and minimum principal stresses to zero. Default is 1e-8. |
1e-08
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Signed von Mises stress for each entry. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_signed_von_mises_by_first_invariant(stress_vector_voigt, rtol=1e-05, atol=1e-08)
¶
Calculate signed von Mises stress for each stress state.
Sign is determined by the first invariant of the stress tensor.
Sign Convention
The sign assignment follows these rules:
- Positive (+): When tr(σ) > 0 (tensile volumetric stress)
- Negative (-): When tr(σ) < 0 (compressive volumetric stress)
- Positive (+): When tr(σ) ≈ 0 (within tolerance, default fallback)
Tolerance parameters ensure numerical stability in edge cases where the determining value is very close to zero, preventing erratic sign changes that could occur due to floating-point precision limitations.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
rtol
|
float
|
Relative tolerance for comparing the first invariant to zero. Default is 1e-5. |
1e-05
|
atol
|
float
|
Absolute tolerance for comparing the first invariant to zero. Default is 1e-8. |
1e-08
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Signed von Mises stress for each entry. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_tresca_stress(stress_vector_voigt)
¶
Calculate Tresca (maximum shear) stress for each stress state.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Tresca stress for each entry. For principal stresses σ1 ≥ σ2 ≥ σ3, Tresca = (σ1 − σ3)/2. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_signed_tresca_by_hydrostatic(stress_vector_voigt, rtol=1e-05, atol=1e-08)
¶
Calculate signed Tresca stress for each stress state.
Sign is determined by the hydrostatic stress.
Sign Convention
The sign assignment follows these rules:
- Positive (+): When hydrostatic stress > 0 (tensile dominant state)
- Negative (-): When hydrostatic stress < 0 (compressive dominant state)
- Positive (+): When hydrostatic stress ≈ 0 (within tolerance, default fallback)
Tolerance parameters ensure numerical stability in edge cases where the determining value is very close to zero, preventing erratic sign changes that could occur due to floating-point precision limitations.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
rtol
|
float
|
Relative tolerance for comparing hydrostatic stress to zero. Default is 1e-5. |
1e-05
|
atol
|
float
|
Absolute tolerance for comparing hydrostatic stress to zero. Default is 1e-8. |
1e-08
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Signed Tresca stress for each entry. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
calc_signed_tresca_by_max_abs_principal(stress_vector_voigt, rtol=1e-05, atol=1e-08)
¶
Calculate signed Tresca stress for each stress state.
Sign is determined by the maximum absolute principal stress value.
Sign Convention
The sign assignment follows these rules:
- Positive (+): When (σ₁ + σ₃)/2 > 0 (tension dominant)
- Negative (-): When (σ₁ + σ₃)/2 < 0 (compression dominant)
- Positive (+): When (σ₁ + σ₃)/2 ≈ 0 (within tolerance, default fallback)
Tolerance parameters ensure numerical stability in edge cases where the determining value is very close to zero, preventing erratic sign changes that could occur due to floating-point precision limitations.
Math Equations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stress_vector_voigt
|
NDArray[float64]
|
Array of shape (..., 6). The last dimension contains the Voigt stress components. Leading dimensions are preserved. |
required |
rtol
|
float
|
Relative tolerance for comparing the average of maximum and minimum principal stresses to zero. Default is 1e-5. |
1e-05
|
atol
|
float
|
Absolute tolerance for comparing the average of maximum and minimum principal stresses to zero. Default is 1e-8. |
1e-08
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (...). Signed Tresca stress for each entry. Tensor rank is reduced by one. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/struct_mech/stress.py
transformations
¶
Transformations methods of structural mechanics.
These routines perform mathematical operations to transform stress and strain tensors between different coordinate systems or reference frames. They include tensor rotation, transformation to principal axes, and projection onto specified planes, enabling detailed analysis of material response under complex loading conditions and supporting criteria based on critical plane, invariant, or principal stress/strain approaches. Includes 5D deviatoric stress reduction.
utils
¶
Utilities module.
A collection of general utility functions.
mesh
¶
Mesh processing utilities module.
This module provides various functions and classes for mesh processing tasks.
signal
¶
Signal processing utilities module.
This module provides various functions and classes for signal processing tasks.
voigt
¶
Tools for working with Voigt notation in continuum mechanics.
Overview
This module provides general utilities for handling vectors and tensors represented in Voigt notation. Voigt notation is widely used to express symmetric 3x3 tensors, such as stress and strain, in a compact vector form.
Input Shape Convention
- Arrays are expected to have shape (..., 6), where the last dimension contains the six Voigt components: (σ_11, σ_22, σ_33, σ_23, σ_13, σ_12) (σ_xx, σ_yy, σ_zz, σ_yz, σ_xz, σ_xy) Leading dimensions (the '...' part) are preserved and can be arbitrary, allowing batch processing of multiple vectors or tensors.
check_shape(vector)
¶
Validate the Voigt vector shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
NDArray[float64]
|
Array with shape (..., 6) where the last dimension has length 6. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/utils/voigt.py
voigt_to_tensor(vector)
¶
Convert Voigt vectors to symmetric 3x3 tensors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
NDArray[float64]
|
Array of shape (..., 6) where the last dimension contains the stress/strain components in order according to Voigt notation: (σ_11, σ_22, σ_33, σ_23, σ_13, σ_12) (σ_xx, σ_yy, σ_zz, σ_yz, σ_xz, σ_xy) |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array with shape (..., 3, 3). The last two axes are the symmetric |
NDArray[float64]
|
3x3 tensor for each input index. Leading dimensions are preserved. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last dimension is not of size 6. |
Source code in src/fatpy/utils/voigt.py
tensor_to_voigt(tensor)
¶
Convert symmetric 3x3 tensors to Voigt vectors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tensor
|
NDArray[float64]
|
Array of shape (..., 3, 3) where the last two dimensions represent symmetric 3x3 tensors. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array with shape (..., 6). The last dimension contains the stress/strain |
NDArray[float64]
|
components in order according to Voigt notation: (σ_11, σ_22, σ_33, σ_23, σ_13, σ_12) (σ_xx, σ_yy, σ_zz, σ_yz, σ_xz, σ_xy) |
NDArray[float64]
|
Leading dimensions are preserved. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the last two dimensions are not of size (3, 3). |