Skip to content

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

ClassHeaderRole
AnalysisSinteringTools/AnalysisSintering.hSintering-specific metrics (line-intersection method, reference density).
MicrostructureAnalysisTools/MicrostructureAnalysis.hGrain statistics (counts, size distributions) with CSV writers.
CSVParserTools/CSVParser.hReads CSV files into numeric tables.
ProbabilityDistributionsTools/ProbabilityDistributions.hNormal / Cauchy / uniform sampling helpers (used by Nucleation).
TimeInfoTools/TimeInfo.hWall-time profiling helper for the time loop.
ElementsTools/Elements.hStatic periodic-table lookup.
SphericalHarmonicsTools/SphericalHarmonics.hSpherical-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-5

The $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

Released under the GNU GPLv3 License.