Mantid
Loading...
Searching...
No Matches
ReducedCell.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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
9#include "MantidGeometry/DllConfig.h"
10#include "MantidKernel/Matrix.h"
11#include <string>
12
13namespace Mantid {
14namespace Geometry {
32class MANTID_GEOMETRY_DLL ReducedCell {
33public:
34 // Construct a ReducedCell for the specified form and lattice parameters
35 ReducedCell(size_t form_num = 0, double a = 1, double b = 1, double c = 1, double alpha = 90, double beta = 90,
36 double gamma = 90);
37
38 size_t GetFormNum() const;
39 std::string GetCellType() const;
40 std::string GetCentering() const;
41
42 // Get the "distance" between the scalars for this form and another form
43 double WeightedDistance(const ReducedCell &other) const;
44
45 // Get transformation between the Niggli cell and the conventional cell
46 Kernel::DblMatrix GetTransformation();
47
48 enum { NUM_CELL_TYPES = 44 };
49
50 // String constants for cell types
51 static const std::string NONE() { return "None"; }
52 static const std::string CUBIC() { return "Cubic"; }
53 static const std::string HEXAGONAL() { return "Hexagonal"; }
54 static const std::string RHOMBOHEDRAL() { return "Rhombohedral"; }
55 static const std::string TETRAGONAL() { return "Tetragonal"; }
56 static const std::string ORTHORHOMBIC() { return "Orthorhombic"; }
57 static const std::string MONOCLINIC() { return "Monoclinic"; }
58 static const std::string TRICLINIC() { return "Triclinic"; }
59
60 // String constants for centerings
61 static const std::string F_CENTERED() { return "F"; }
62 static const std::string I_CENTERED() { return "I"; }
63 static const std::string C_CENTERED() { return "C"; }
64 static const std::string P_CENTERED() { return "P"; }
65 static const std::string R_CENTERED() { return "R"; }
66
67private:
68 void init(size_t f_num, double a_a, double b_b, double c_c, double b_c, double a_c, double a_b);
69 void foot_note_b(double a_a, double a_c);
70 void foot_note_c(double b_b, double b_c);
71 void foot_note_d(double c_c, double b_c);
72 void foot_note_e(double a_a, double c_c, double a_c);
73 void foot_note_f(double b_b, double c_c, double b_c);
74 void premultiply(size_t index);
75 std::vector<double> norm_vals(const ReducedCell &info) const;
76
77 size_t form_num;
78 double scalars[6];
80 std::string cell_type;
81 std::string centering;
82};
83
84} // namespace Geometry
85} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Instances of this class represent information about reduced cell types including the transformation r...
Definition: ReducedCell.h:32
static const std::string HEXAGONAL()
Definition: ReducedCell.h:53
Kernel::DblMatrix transform
Definition: ReducedCell.h:79
static const std::string MONOCLINIC()
Definition: ReducedCell.h:57
static const std::string RHOMBOHEDRAL()
Definition: ReducedCell.h:54
static const std::string CUBIC()
Definition: ReducedCell.h:52
static const std::string F_CENTERED()
Definition: ReducedCell.h:61
static const std::string TRICLINIC()
Definition: ReducedCell.h:58
static const std::string NONE()
Definition: ReducedCell.h:51
static const std::string R_CENTERED()
Definition: ReducedCell.h:65
static const std::string TETRAGONAL()
Definition: ReducedCell.h:55
static const std::string ORTHORHOMBIC()
Definition: ReducedCell.h:56
static const std::string P_CENTERED()
Definition: ReducedCell.h:64
static const std::string I_CENTERED()
Definition: ReducedCell.h:62
static const std::string C_CENTERED()
Definition: ReducedCell.h:63
Helper class which provides the Collimation Length for SANS instruments.