This example demonstrates the generation of CSLs using rotations about an axis of a 3D lattice
- Define types
using VectorDimI = LatticeCore<3>::VectorDimI;
using VectorDimD = LatticeCore<3>::VectorDimD;
using IntScalarType = LatticeCore<3>::IntScalarType;
- Instantiate a lattice \(\mathcal A\)
const auto A(TextFileParser("bicrystal_3d.txt").readMatrix<double,3,3>("A",true));
Lattice<3> lattice(A);
- Specify an axis in the form of a reciprocal lattice direction
const auto axis (TextFileParser("bicrystal_3d.txt").readMatrix<double,3,1>("axis",true));
ReciprocalLatticeVector<3> rv(axis,lattice);
std::cout << "Miller indices of the tilt axis plane = " << std::endl;
std::cout << rv << std::endl;
- Generate a family of rotations about the given axis such that lattices \(\mathbf R\mathcal A\) and \(\mathbf R\mathcal A\) share a coincidence relation
const auto& coincidentRotations= lattice.generateCoincidentLattices(rv);
- Loop over the the above family of rotations and carry out SNF bicrystallography of bicrystals \(\mathcal A \cup \mathbf R\mathcal A\).
for (const auto& rotation : coincidentRotations)
{
try
{
double theta= acos((rotation.trace()-1.0)/2.0)*180/M_PI;
std::cout << "angle = " << theta << "; ";
BiCrystal<3> bc(lattice,Lattice<3>(lattice.latticeBasis,rotation),false);
std::cout << "Sigma = " << bc.sigma << std::endl;
}
catch(std::runtime_error& e)
{
std::cout << e.what() << "Moving on ..." << std::endl;
}
}
Full code:
{
const auto A(
TextFileParser(
"bicrystal_3d.txt").readMatrix<double,3,3>(
"A",
true));
const auto axis (
TextFileParser(
"bicrystal_3d.txt").readMatrix<double,3,1>(
"axis",
true));
std::cout << "Miller indices of the tilt axis plane = " << std::endl;
std::cout << rv << std::endl;
const auto& coincidentRotations= lattice.generateCoincidentLattices(rv);
for (const auto& rotation : coincidentRotations)
{
try
{
double theta= acos((rotation.trace()-1.0)/2.0)*180/M_PI;
std::cout << "angle = " << theta << "; ";
std::cout <<
"Sigma = " << bc.
sigma << std::endl;
}
catch(std::runtime_error& e)
{
std::cout << e.what() << "Moving on ..." << std::endl;
}
}
return 0;
}
int main(int argc, char **argv)
Eigen::Matrix< double, dim, 1 > VectorDimD
long long int IntScalarType
Eigen::Matrix< IntScalarType, dim, 1 > VectorDimI