Elasticity Solver (Spectral)
ElasticitySolverSpectral is the FFT-based spectral solver for the mechanical-equilibrium problem in OpenPhase. It iterates on the deformation gradient until the residual stress satisfies the convergence criteria the user sets, then writes the resulting stress and strain back into ElasticProperties. The continuum derivation (Piola-Kirchhoff, homogeneous / inhomogeneous split, external-BC handling) is in Mechanics; this page documents the solver's input parameters and execution contract.
Key Classes and Concepts
ElasticitySolverSpectral : public OPObject: the solver. Allocates the real-space RHS and Fourier-space displacement buffers, creates FFTW plans on initialization, and exposesSolve(EP, BC, dt).
Convergence parameters
The solver converges when both strain and stress residuals fall below their tolerances or the iteration cap is reached.
| Token | Meaning |
|---|---|
$StrainAccuracy | Residual strain tolerance. |
$StressAccuracy | Residual stress tolerance. |
$MAXIterations | Maximum number of iterations per call. |
$IncrementScaling | Scales the per-iteration update to the deformation gradient; reduce to damp oscillations. |
$VerboseIterations | Echo the residuals at each iteration. |
$DiscreteDerivatives | Use discrete (stencil-based) derivatives instead of spectral when evaluating gradients. |
All defaults come from the in-class member initialisers in include/ElasticitySolverSpectral.h; every field is optional.
Usage
Input
Defined in the @ElasticitySolverSpectral block.
@ElasticitySolverSpectral
$StrainAccuracy Residual strain tolerance : 1.0e-6
$StressAccuracy Residual stress tolerance : 1.0e-3
$MAXIterations Maximum iterations per call : 50
$IncrementScaling Damping factor on the update : 1.0
$VerboseIterations Echo per-iteration residual : No
$DiscreteDerivatives Use discrete gradient stencils : NoOutput
No dedicated file. The solver mutates the stress / strain fields held by ElasticProperties; those fields are written by ElasticProperties::WriteVTK.
Example
#include "ElasticProperties.h"
#include "ElasticitySolverSpectral.h"
ElasticProperties EP(OPSettings, InputFile);
ElasticitySolverSpectral ES(OPSettings, InputFile);
for(RTC.tStep = RTC.tStart; RTC.tStep <= RTC.nSteps; RTC.IncrementTimeStep())
{
// ... phase-field update (may change the effective stiffness)...
ES.Solve(EP, BC, RTC.dt);
if (RTC.WriteVTK()) EP.WriteVTK(OPSettings, RTC.tStep);
}See also: examples
In OpenPhase-main/examples/:
Superalloys— superalloy microstructure with elasticity coupling.Pearlite— pearlite formation with mechanical coupling.PrecipitationNiTi— precipitation kinetics with transformation stretches.- The full polycrystalline-plasticity-with-damage example on
damage.mddrivesElasticitySolverSpectralalongsideMechanicalLoadsandElasticProperties.
Dependencies
- ElasticProperties — the state the solver reads and writes.
- BoundaryConditions — face-level BC for the periodic Fourier machinery.
- Mechanics — theory.
- FFTW (external).
Notes on applicability
The spectral solver assumes periodic boundary conditions in the Fourier sense. Non-periodic applied conditions are handled through the homogeneous / inhomogeneous split described in Mechanics → External boundary conditions. Simple shear that requires a non-symmetric deformation tensor cannot be represented (only pure shear combined with volumetric change is supported).