Tools
The Tools/ directory groups utility classes used either by the simulation driver or by post-processing scripts. None of the tools are solvers — they are analysis and infrastructure helpers. This page enumerates them with a short description; detailed pages live under the Tools/ sub-folder of this documentation.
Catalogue
| Class | Header | Role |
|---|---|---|
AnalysisSintering | Tools/AnalysisSintering.h | Sintering-specific metrics (line-intersection method, reference density). |
MicrostructureAnalysis | Tools/MicrostructureAnalysis.h | Grain statistics (counts, size distributions) with CSV writers. |
CSVParser | Tools/CSVParser.h | Reads CSV files into numeric tables. |
ProbabilityDistributions | Tools/ProbabilityDistributions.h | Normal / Cauchy / uniform sampling helpers (used by Nucleation). |
TimeInfo | Tools/TimeInfo.h | Wall-time profiling helper for the time loop. |
Elements | Tools/Elements.h | Static periodic-table lookup. |
SphericalHarmonics | Tools/SphericalHarmonics.h | Spherical-harmonic basis evaluation. |
Usage
Input
Most tools are purely code-driven and carry no .opi block. AnalysisSintering is the exception and reads from the @AnalysisSintering block:
text
@AnalysisSintering
$Rho0 Reference density : 1.0
$LI Use line-intersection method : Yes
$LIX Line intersection along X : Yes
$LIY Line intersection along Y : Yes
$LIZ Line intersection along Z : Yes
$BBSX Bounding-box size in X (physical length) : 1.0e-5
$BBSY Bounding-box size in Y (physical length) : 1.0e-5
$BBSZ Bounding-box size in Z (physical length) : 1.0e-5The $BBSX/Y/Z values are divided by Grid.dx internally, so they are specified in the physical length units of the simulation.
Output
MicrostructureAnalysis::WriteGrainsStatistics(Phi, tStep)— writes a CSV per call with grain-count, volumes, and related metrics. This helper is used in the grain-growth walkthrough on PhaseField.TimeInfo— prints wall-time reports to the console when its report methods are called.
Example
Instrumenting a time loop with statistics and timing:
cpp
#include "Tools/MicrostructureAnalysis.h"
#include "Tools/TimeInfo.h"
for(RTC.tStep = RTC.tStart; RTC.tStep <= RTC.nSteps; RTC.IncrementTimeStep())
{
// ... solver updates ...
if (RTC.WriteVTK())
{
MicrostructureAnalysis::WriteGrainsStatistics(Phi, RTC.tStep);
}
}Dependencies
- Per tool, as noted above.
MicrostructureAnalysisconsumesPhaseField;AnalysisSinteringconsumesPhaseFieldandSettings;ProbabilityDistributionsis used byNucleation.