MESOSCALE MICROSTRUCTURE MODELING · RUN AND EXPLORE

Two ways to solve inhomogeneous elasticity.

A precipitate wants to change shape. Its surroundings resist. Follow two independent numerical methods to the same mechanical equilibrium, with the equations and the iteration visible.

These teaching examples explain two methods used to solve mechanical equilibrium in materials with different elastic stiffnesses. The direct iteration follows my earlier research solvers. The equivalent-eigenstrain example follows the method described below, including Soumya Bandyopadhyay’s work.

Code use: teaching, learning and demonstration only. Any other use requires my written permission.

We keep the worked code examples public. For a complete solver notebook, 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. Code request details

Every solver on these pages.

My classroom notebook.

The teaching edition of Elastic.ipynb builds the stiffness tensor, eigenstress, acoustic tensor and elastic energy kernel \(B_{pq}(\mathbf n)\). Change the eigenstrain and elastic anisotropy separately, then compare self and cross kernels.

Request the code

How it is built

The notebook constructs cubic elasticity directly in indices, \(C_{ijkl}\) from \(C_{11}\), \(C_{12}\) and \(C_{44}\), and checks the shear and tensor symmetries before use. It handles the zero Fourier mode explicitly. It uses a full three-dimensional tensor with in-plane Fourier directions and a specified out-of-plane eigenstrain. The two solvers below use the two-dimensional sub-block with zero out-of-plane eigenstrain; their treatment of the average strain is cross-linked on each page (direct iteration, equivalent eigenstrain, homogenization).

One physical problem.

\[\epsilon_{ij}=E_{ij}+\tfrac12(u_{i,j}+u_{j,i}),\qquad \sigma_{ij}=C_{ijkl}(\mathbf x)(\epsilon_{kl}-\epsilon^0_{kl}),\qquad \sigma_{ij,j}=0.\]

Both examples use a smooth elliptical plate in a periodic unit square. One grid cell is 1 nm and stiffness, stress and energy density are in eV/nm³ (1 eV/nm³ = 160.2 MPa). The matrix is a superalloy at high temperature, \(\mu=80\) GPa, \(\nu=1/3\), \(A_Z=1\), converted by the Schmidt–Gross formulas of the Elastic Stress Effects Laboratory to \(C_{11}=1997.3\), \(C_{12}=998.6\), \(C_{44}=499.3\) eV/nm³ (320, 160 and 80 GPa); the plate's constants are the matrix constants times the stiffness ratio. Inside the plate the eigenstrain is

\[\epsilon^0=\epsilon_\eta\begin{pmatrix}1&0\\0&t\end{pmatrix},\qquad \epsilon_\eta=0.003,\]

as in my PhD thesis (Eq. 3.2): \(\epsilon_\eta=\epsilon^0_{11}\) is the characteristic misfit strain and \(t=\epsilon^0_{22}/\epsilon^0_{11}\) is the tetragonality, between \(-1\) and \(+1\). \(t=1\) is a dilatational misfit and \(t=-1\) pure shear. The default \(t=-0.5\), Case D of the thesis, means \(\epsilon^0_{11}=0.003\) and \(\epsilon^0_{22}=-0.0015\): the plate wants to stretch along \(x\) and contract half as much along \(y\), and the normal misfit vanishes along the invariant lines at \(\pm54.7^\circ\). The misfit components are measured along the crystal axes, which stay fixed when the plate is rotated. The average strain \(\mathbf E\) is prescribed; its default, zero, means macroscopic clamping, not zero average stress. Both notebooks can also hold an applied average stress instead. The shape is prescribed; it does not evolve during the equilibrium solve.

Physical eigenstrain is the transformation the material would undergo without constraint. Elastic strain is total strain minus eigenstrain. Both solvers report the physical energy \(\frac12\langle(\epsilon-\epsilon^0):C:(\epsilon-\epsilon^0)\rangle\).

Stress sigma 11 around a soft elliptical plate tilted at 30 degrees, computed by direct iteration: compressive inside the plate, tensile just above and below itThe same stress map computed by the equivalent-eigenstrain method, indistinguishable from panel aSigma 11 along the horizontal line through the plate center from both methods; the two curves lie on top of each otherRelative change per iteration on a logarithmic scale: the direct method reaches the tolerance of 10 to the minus 8 after 15 iterations and the equivalent-eigenstrain method after 19
Both methods give the same equilibrium. A soft plate (stiffness ratio 0.5) with eigenstrain \(\epsilon^0_{11}=0.003\), \(\epsilon^0_{22}=-0.0015\) (\(\epsilon_\eta=0.003\), tetragonality \(t=-0.5\)), tilted at 30° in a clamped 128 nm cell; the matrix is a superalloy with \(\mu=80\) GPa and stresses are in MPa. (a, b) \(\sigma_{11}\) from the direct method and from the equivalent-eigenstrain method; the plate is in compression, with tension just above and below its long faces. (c) \(\sigma_{11}\) along the dashed line from both methods: the curves coincide, the stresses differ by at most 6 × 10⁻⁶ of the peak, and the energies agree to nine digits (1.00103607 × 10⁻⁴ eV/nm³). (d) Convergence: the direct method stops after 15 iterations, when the relative change in displacement falls below 10⁻⁸; its equilibrium residual is then 1.8 × 10⁻⁸. The equivalent-eigenstrain method stops after 19 iterations, when the relative change in stress falls below 10⁻⁸; the two stresses it must match then agree to 3.5 × 10⁻⁸. Both iterations converge geometrically, the change shrinking three- to fourfold each iteration.

Method 1: Direct iterative perturbation.

Choose a uniform reference stiffness, split \(C=C^{ref}+\Delta C\), and iterate on the displacement. From the current displacement form the right-hand side and solve the homogeneous problem for the new displacement:

\[ts=C:(\epsilon^0-\bar E)-\Delta C:\delta\epsilon,\qquad Q_{ik}(\mathbf k)=C^{ref}_{ijkl}k_jk_l,\qquad \widetilde u_i=-\mathrm i\,[Q(\mathbf k)^{-1}]_{im}k_j\widetilde{ts}_{mj}.\]

This follows my older Fortran solvers, adapted to a single plate, in Voigt components, and the reference-stiffness approach of our CICP paper. Each iteration is a homogeneous Fourier solve; it stops when the displacement no longer changes.

Read the code explained, step by step Request the code

Method 2: Equivalent eigenstrain.

Replace the inhomogeneous solid by a homogeneous one, \(C^0\), with a virtual stress-free strain \(q\) chosen so that both carry the same stress:

\[C^0:(\epsilon-q)=C:(\epsilon-\epsilon^0).\]

\(q\) is found by relaxing an energy whose minimum is exactly this equivalence, the effective stress-free strain approach of Wang, Jin and Khachaturyan (2002). Where one phase is vacuum (\(C=0\)) the virtual strain simply follows the stress until the hole is stress-free; this is Soumya Bandyopadhyay's algorithm, checked here against Kirsch's solution for a circular hole. For two stiff phases the same energy, with \(C^0\) the stiffer phase, gives the answer of Method 1.

Physical insight: the virtual eigenstrain represents stiffness contrast mathematically. It is not a second physical transformation strain. Calculate energy using the real stiffness and physical eigenstrain.

Read the method derived and coded, step by step Request the code

How the inputs affect the result.

We can make the plate softer or stiffer than the matrix (stiffness ratio), change the tetragonality \(t\), rotate the plate, and prescribe either an average strain or an applied stress. The misfit strain \(\epsilon_\eta\) only scales the solution: stresses scale with \(\epsilon_\eta\) and energies with \(\epsilon_\eta^2\).

As in my Fortran codes, use FFT-friendly even grid sizes \(N=2^a3^b\): 64 for quick exploration, then 128 and 256 (or 96, 192). The plate and its interface width stay fixed in physical coordinates during refinement. The iteration count is not physical time.

The code boxes in each walkthrough are there to read and use. The complete notebooks are available on request: email me with the lesson title and why you need the code. If you would like a similar tutorial in Julia or C, email me with the lesson title and your intended use. I can share a Google Colab notebook with step-by-step explanations and worked examples.

Request the code Read the full derivations and instructions

How do we apply stress to a periodic box? See the hand-drawn lesson on homogenization, with a film between vacuum layers that you can run.

Voids and rigid inclusions. The same lesson explains and codes Method A, soft vacuum, Method B, the augmented Lagrangian and Method C, the hard constraint.

How do we know the answer is right?

The two methods share the same homogeneous Fourier solve, so their agreement alone does not settle the question. We want a problem whose answer is already known. A circular hole under uniaxial stress has one: Kirsch's exact solution. The equivalent-eigenstrain method leaves the hole stress-free to \(5\times10^{-4}\) of the load, and its stress follows Kirsch's within 1% across the load and within 0.025 of the load along it. The walkthrough shows the comparison.

Free outer surfaces and finite-strain mechanics are outside these examples.

The numerical details
  • Equilibrium. After the direct iteration converges, we compute \(\nabla\cdot\sigma\) separately; its relative residual is \(1.7\times10^{-8}\) on the 64 × 64 grid.
  • Grid refinement. For the plate in the figure the energy changes by 0.0016% from 64 to 128 and by \(5\times10^{-7}\)% from 128 to 256.
  • The two methods. On a 128 × 128 grid they agree to nine or ten digits in energy and \(10^{-7}\) or better in strain, for stiffness ratios 0.2, 0.5 and 2 in a clamped cell, and 0.5 and 2 in a stress-free cell.
  • Failed convergence raises an error instead of returning a result.

Follow the research into the code.

Direct iteration: Saswata Bhattacharyya, Tae Wook Heo, Kunok Chang and Long-Qing Chen, A Spectral Iterative Method for the Computation of Effective Properties of Elastically Inhomogeneous Polycrystals, Communications in Computational Physics 11 (2012), 726–738. Related formulations appear in Tushar Jogi's thesis, §§3.1.4–3.1.6 and Appendix B.

Equivalent eigenstrain: 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, and Soumya Bandyopadhyay's thesis and C/CUDA codes. These small teaching implementations expose the core equations; they are not verbatim ports of the larger research codes. Code use: teaching, learning and demonstration only (terms).

Return to the interactive Elastic Stress Effects Laboratory · Read the appendix-based kernel derivation