Skip to main content

Module simd_paths

Module simd_paths 

Source
Expand description

SIMD-accelerated bulk material evaluation using Structure-of-Arrays (SoA) layout.

This module provides batch (N-point) evaluation kernels for the most compute-intensive constitutive relations in OxiPhysics. Data is arranged in SoA format so that LLVM’s auto-vectorizer can emit wide SIMD instructions (SSE2 / AVX2 / NEON) on the inner loops.

§Constitutive kernels

FunctionModelDescription
elastic_stress_batchIsotropic linear elasticσ = λ tr(ε) I + 2μ ε
von_mises_yield_batchVon Mises plasticityf = √(3/2 s:s) − σ_y
neo_hookean_stress_batchNeo-Hookean hyperelasticFirst Piola–Kirchhoff via F
viscoplastic_rate_batchPerzyna viscoplasticityγ̇ = ⟨f/σ_y⟩ⁿ / η
miner_damage_batchMiner’s rule fatigueD += n/N_f per cycle block
thermal_expansion_stress_batchThermo-elasticσ_th = −3K α ΔT I

§SoA storage

SoaMaterialPoints stores the full state of N integration points with each field in its own contiguous Vec<f64> so the batch kernels read and write aligned slices that the compiler can vectorize.

§Usage

use oxiphysics_materials::simd_paths::{SoaMaterialPoints, elastic_stress_batch};

let n = 8;
let mut pts = SoaMaterialPoints::new(n);
// Set strains: ε_xx = 0.001 for all points
for i in 0..n { pts.strain_xx[i] = 0.001; }

let e  = 210e9_f64;
let nu = 0.3;
elastic_stress_batch(&mut pts, e, nu);

// σ_xx should equal E/(1-ν²) * ε_xx for plane stress
assert!(pts.stress_xx[0] > 0.0);

Structs§

MaterialBatchStats
Summary statistics for a batch of material points.
SoaMaterialPoints
Structure-of-Arrays storage for n material integration points.

Functions§

elastic_stress_batch
Compute isotropic linear elastic stress for all n material points.
elastic_stress_batch_x4
Same as elastic_stress_batch but processes 4 points at once with manually unrolled 4-wide scalar arithmetic (auto-vectorizer helper).
lame
Compute Lamé parameters (λ, μ) from Young’s modulus E and Poisson ratio ν.
miner_damage_batch
Accumulate Miner’s rule fatigue damage for a block of n_applied loading cycles.
neo_hookean_stress_batch
Compute the Cauchy stress for a Neo-Hookean hyperelastic material at each point.
return_mapping_batch
Radial return mapping for isotropic J2 plasticity (batch, linear isotropic hardening).
thermal_expansion_stress_batch
Add the thermal expansion stress increment to existing stress.
viscoplastic_rate_batch
Compute the viscoplastic strain rate for each point (Perzyna model).
von_mises_yield_batch
Evaluate the Von Mises yield function for each material point.