Microstructure Analysis
MicrostructureAnalysis is a collection of static helpers that derive aggregate statistics from a PhaseField state — grain counts, per-grain volumes, size distributions. Results are written as CSV at a user-controlled cadence. The helpers are code-driven: there is no .opi block.
Key Classes and Concepts
MicrostructureAnalysis: static-only class underinclude/Tools/MicrostructureAnalysis.h. Commonly used:WriteGrainsStatistics(Phi, tStep)— writes per-time-step CSV with grain count, volumes, and derived metrics.- Additional helpers for computing size distributions, active grain counts, and texture moments; consult the header for the full list.
Usage
Input
None.
Output
- CSV file(s) in the text-output directory declared by
$DATADironSettings.
Example
From the grain-growth walkthrough on Phase Field:
cpp
#include "Tools/MicrostructureAnalysis.h"
if (RTC.WriteVTK())
{
MicrostructureAnalysis::WriteGrainsStatistics(Phi, RTC.tStep);
}Dependencies
- PhaseField — the analysed state.
- Settings — output directory.
- RunTimeControl — cadence gate.