Two ways to solve inhomogeneous elasticity

Two ways to solve inhomogeneous elasticity

Model and loading update — 9 November 2026

The direct-iteration and equivalent-eigenstrain notebooks now offer two explicit models: model='generalized' retains 3D constitutive coupling and solves uniform Ezz on the 2D domain; model='intrinsic' uses only xx, yy and xy.

Loading is independent: control='stress_free' evaluates homogeneous strain from zero mean stress; control='constrained' specifies homogeneous strain; control='stress' evaluates strain for nonzero applied mean stress. In generalized stress-free calculations, mean sigma_zz is zero; local sigma_zz can be nonzero. This is not a local plane-stress reduction.

Strain uses engineering shear gamma_xy=2*epsilon_xy. Three-component inputs are (xx, yy, xy); four-component inputs are (xx, yy, zz, xy). The additional strain_zz, stress_zz and mean_strain_zz outputs expose the generalized response. Both solvers verify equilibrium and mean loading; the virtual solver also verifies the local constitutive law.

The hole example explicitly uses diffuse stiffness C=(1-phi)C0 and a compliance-preconditioned equivalent-eigenstrain update. Its default grid is a 64-point teaching example; resolve the interface and check domain/grid convergence before comparing with the isolated-hole Kirsch solution. The earlier 256-grid example exceeded the bounded 300-second execution check and is not certified by this update.

Validation includes analytical homogeneous loading and shear energy, independent dense variational solutions on small heterogeneous fields, both models under stress-free/constrained/applied-stress loading, and a non-proportional-stiffness example with zero physical zz eigenstrain and nonzero solved Ezz. The two updated notebooks were executed from fresh kernels.

Code use: teaching, learning and demonstration only. Research (including academic research) and commercial use require my explicit written permission. See CODE-USE-TERMS.txt. Complete notebooks and standalone implementations are available on request: write to saswata_at_msme.iith.ac.in (replace at with @), explaining which code you need, why you need it and how you intend to use it.

What is in this folder

  • Direct-iteration-Voigt.ipynb: direct iterative perturbation. This is my Fortran solver muelastV5.f90 adapted to a single elliptical plate in two dimensions. It iterates on the displacement and stops when the displacement no longer changes. Step-by-step explanation: https://saswataiith.github.io/resources/elastic-solvers/direct-iteration/
  • Equivalent-eigenstrain-Voigt.ipynb: the equivalent (virtual) eigenstrain method of Wang, Jin and Khachaturyan (J. Appl. Phys. 92, 1351, 2002). It covers a hole (C = 0), following Soumya Bandyopadhyay’s algorithm and checked against Kirsch’s solution, and two stiff phases, checked against the direct method. Step-by-step explanation: https://saswataiith.github.io/resources/elastic-solvers/equivalent-eigenstrain/
  • Elastic.ipynb: my classroom notebook on the stiffness tensor, eigenstress, acoustic tensor and the elastic energy kernel B(n).

Each notebook is self-contained and needs only NumPy and Matplotlib. Run it in Jupyter or Google Colab, cells from top to bottom.

python -m pip install numpy matplotlib jupyter

The problem

A coherent plate would like to undergo its eigenstrain; the surrounding matrix resists. On a periodic square with 1 nm grid spacing, find the displacement u and the stress:

ε = Ē + sym(grad u),   σ = C(x):(ε − ε⁰),   div σ = 0.

Ē is the average strain. Stress-free loading evaluates it from zero mean stress; constrained loading prescribes it (the clamped example uses zero). The plate’s shape is prescribed; it does not evolve.

The examples offer generalized plane strain and intrinsic 2D cubic elasticity, with engineering shear γ12 = 2ε12. The isotropic matrix uses mu=80 GPa and nu=1/3, giving C11≈1997.3, C12≈998.6 and C44≈499.3 eV/nm³. The plate’s constants are the matrix constants times the stiffness ratio (contrast). Inside the plate the eigenstrain is

ε⁰11 = εη,   ε⁰22 = t εη,   ε⁰12 = 0,   with εη = 0.01,

as in my PhD thesis (Eq. 3.2): εη is the characteristic misfit strain and t = ε⁰22/ε⁰11 is the tetragonality (misfit_ratio), between −1 (pure shear) and +1 (dilatation). The default t = −0.5 (Case D of the thesis) means the eigenstrain amplitudes are ε⁰11 = 0.003 and ε⁰22 = −0.0015. Both are measured along the crystal axes, which stay fixed when the plate is rotated. Stresses scale with εη and energies with εη². Thesis: https://saswataiith.github.io/files/research/theses/saswata-phd-multivariant.pdf

Grids

As in my Fortran codes, use FFT-friendly even grid sizes N = 2^a 3^b, such as 64, 96, 128, 192 or 256. Wavenumbers are k = 2πm with m = 0, 1, …, N/2, −N/2+1, …, −1. The plate and its interface width are fixed in physical coordinates during refinement.

Checks

  • Equilibrium: after the direct iteration converges, the relative residual of div σ is 1.7 × 10⁻⁸ on a 64 × 64 grid.
  • Grid refinement: the energy of the default plate changes by 0.0016% from 64 to 128 and by 5 × 10⁻⁷ % from 128 to 256.
  • Two methods, one answer: on a 128 × 128 grid the methods agree to nine or ten digits in energy for stiffness ratios 0.2, 0.5 and 2 (clamped), and 0.5 and 2 (stress-free).
  • Circular-hole comparison: the default 64-grid periodic diffuse-hole example is a qualitative comparison with the isolated sharp-hole Kirsch solution, not a uniform 1% accuracy assertion. At the sampled radii, finite interface, grid and periodic-domain effects remain visible. Exact void pixels are separately checked in the small automated tests.

Sources

  • S. Bhattacharyya, T. W. Heo, K. Chang and L.-Q. Chen, A Spectral Iterative Method for the Computation of Effective Properties of Elastically Inhomogeneous Polycrystals, Communications in Computational Physics 11 (2012), 726–738, https://doi.org/10.4208/cicp.290610.060411a
  • Y. U. Wang, Y. M. Jin and A. G. Khachaturyan, Phase field microelasticity theory and modeling of elastically and structurally inhomogeneous solid, Journal of Applied Physics 92 (2002), 1351–1360, https://doi.org/10.1063/1.1492859
  • Soumya Bandyopadhyay, PhD thesis, IIT Hyderabad, Section 3.4.2. His C and CUDA codes are not distributed here.

These small teaching implementations expose the core equations; they are not verbatim ports of the larger research codes.

Access to the implementations

The complete notebooks and solver archive are private and supplied on request. The website retains the worked code blocks, derivations, algorithm explanations and computed comparisons. Request access at https://saswataiith.github.io/using-my-resources/#request-code.