Skip to content

Orientations

Orientations is the per-grid-point storage for crystallographic orientation data. Each point carries an orientation (as a quaternion internally; Euler angles and rotation matrices are derived on demand). The module exposes advection of the orientation field (via AdvectionHR and Velocities), EBSD-style VTK output, misorientation maps, and a 100-direction visualisation.

Key Classes and Concepts

  • Orientations : public OPObject: storage + output pipeline.
  • Underlying container types: see Quaternion and EulerAngles.

Public API (selected)

cpp
void Initialize(Settings& locSettings, std::string ObjectNameSuffix = "") override;
void Remesh(int newNx, int newNy, int newNz, const BoundaryConditions& BC) override;
void SetBoundaryConditions(const BoundaryConditions& BC) override;

void WriteVTK(const Settings& locSettings, ...);
void WriteTotalVTK(const Settings& locSettings, ...);
void WriteGrainEBSDDataQuaternions(const Settings& locSettings, ...);
void WriteMisorientationsVTK(const Settings& locSettings, ...);
void WriteRotated100VectorVTK(const Settings& locSettings, ...);

void PrintPointStatistics(int x, int y, int z);

void Advect(AdvectionHR& Adv, const Velocities& Vel, PhaseField& Phi,
            const double dt, const double tStep) override;

Usage

Input

No dedicated .opi block. Orientations are populated through the Initializations helpers (e.g. RandomOrientations, TwoDimEBSDWithOrientations) or by assignment during the setup phase.

Output

  • WriteVTK — per-grid quaternion / Euler-angle fields.
  • WriteMisorientationsVTK — scalar misorientation between neighbour grains.
  • WriteRotated100VectorVTK — crystallographic 100 vector rotated by the local orientation, for texture visualisation.
  • WriteGrainEBSDDataQuaternions — per-grain EBSD-style export.

Example

From the anisotropy-aware grain-growth example on Interface Properties:

cpp
#include "Initializations.h"

int number_of_grains = 100;
size_t GrainsPhase   = 0;
Initializations::VoronoiTessellation(Phi, BC, number_of_grains, GrainsPhase);
Initializations::RandomOrientations(Phi);   // populates Orientations

Dependencies

Released under the GNU GPLv3 License.