Mantid
Loading...
Searching...
No Matches
OrientedLattice.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include <nexus/NeXusFile.hpp>
11
12namespace Mantid {
13namespace Geometry {
21class MANTID_GEOMETRY_DLL OrientedLattice : public UnitCell {
22public:
23 // Default constructor. a = b = c = 1, alpha = beta = gamma = 90 degrees
24 OrientedLattice(const Kernel::DblMatrix &Umatrix = Kernel::DblMatrix(3, 3, true));
25 // a,b,c constructor
26 OrientedLattice(const double _a, const double _b, const double _c,
27 const Kernel::DblMatrix &Umatrix = Kernel::DblMatrix(3, 3, true));
28 // a,b,c,alpha,beta,gamma constructor
29 OrientedLattice(const double _a, const double _b, const double _c, const double _alpha, const double _beta,
30 const double _gamma, const Kernel::DblMatrix &Umatrix = Kernel::DblMatrix(3, 3, true),
31 const int angleunit = angDegrees);
32 // UnitCell constructor
33 OrientedLattice(const UnitCell &uc, const Kernel::DblMatrix &Umatrix = Kernel::DblMatrix(3, 3, true));
34
35 // Access private variables
36 const Kernel::DblMatrix &getU() const;
37 const Kernel::DblMatrix &getUB() const;
38 const Kernel::DblMatrix &getModUB() const;
39 void setU(const Kernel::DblMatrix &newU, const bool force = true);
40 void setUB(const Kernel::DblMatrix &newUB);
41 void setModUB(const Kernel::DblMatrix &newModUB);
42 // get u and v vectors for Horace/Mslice
43 Kernel::V3D getuVector() const;
44 Kernel::V3D getvVector() const;
46 Kernel::V3D hklFromQ(const Kernel::V3D &Q) const;
48 Kernel::V3D qFromHKL(const Kernel::V3D &hkl) const;
50 const Kernel::DblMatrix &setUFromVectors(const Kernel::V3D &u, const Kernel::V3D &v);
52 void saveNexus(::NeXus::File *file, const std::string &group) const;
54 void loadNexus(::NeXus::File *file, const std::string &group);
56 static bool GetUB(Kernel::DblMatrix &UB, const Kernel::V3D &a_dir, const Kernel::V3D &b_dir,
57 const Kernel::V3D &c_dir);
58
60 static bool GetABC(const Kernel::DblMatrix &UB, Kernel::V3D &a_dir, Kernel::V3D &b_dir, Kernel::V3D &c_dir);
61
62 bool operator==(const OrientedLattice &other) const;
63 bool operator!=(const OrientedLattice &other) const;
64
65private:
69
71 void recalculateFromGstar(const Kernel::DblMatrix &NewGstar) override { UnitCell::recalculateFromGstar(NewGstar); }
72 void recalculate() override;
73};
74} // namespace Geometry
75} // namespace Mantid
Class to implement UB matrix.
void recalculateFromGstar(const Kernel::DblMatrix &NewGstar) override
Make recalculateFrom private.
Class to implement unit cell of crystals.
Definition: UnitCell.h:44
Class for 3D vectors.
Definition: V3D.h:34
Helper class which provides the Collimation Length for SANS instruments.
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
constexpr bool operator!=(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)