BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
BakeLattice.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Lattice/BakeLattice.cpp
6 //! @brief Implements class Lattice.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
17 
19 {
20  kvector_t a1(a, 0.0, 0.0);
21  kvector_t a2(0.0, a, 0.0);
22  kvector_t a3(0.0, 0.0, a);
23  return Lattice3D(a1, a2, a3);
24 }
25 
27 {
28  double b = a / 2.0;
29  kvector_t a1(0.0, b, b);
30  kvector_t a2(b, 0.0, b);
31  kvector_t a3(b, b, 0.0);
32  return Lattice3D(a1, a2, a3);
33 }
34 
35 Lattice3D bake::HexagonalLattice(double a, double c)
36 {
37  kvector_t a1(a, 0.0, 0.0);
38  kvector_t a2(-a / 2.0, std::sqrt(3.0) * a / 2.0, 0.0);
39  kvector_t a3(0.0, 0.0, c);
40  return Lattice3D(a1, a2, a3);
41 }
42 
43 Lattice3D bake::HCPLattice(double a, double c)
44 {
45  kvector_t a1(a, 0.0, 0.0);
46  kvector_t a2(-a / 2.0, std::sqrt(3.0) * a / 2.0, 0);
47  kvector_t a3(a / 2.0, a / std::sqrt(3.0) / 2.0, c / 2.0);
48  return Lattice3D(a1, a2, a3);
49 }
50 
52 {
53  kvector_t a1(a, 0.0, 0.0);
54  kvector_t a2(0.0, a, 0.0);
55  kvector_t a3(0.0, 0.0, c);
56  return Lattice3D(a1, a2, a3);
57 }
58 
59 Lattice3D bake::BCTLattice(double a, double c)
60 {
61  kvector_t a1(a, 0.0, 0.0);
62  kvector_t a2(0.0, a, 0.0);
63  kvector_t a3(a / 2.0, a / 2.0, c / 2.0);
64  return Lattice3D(a1, a2, a3);
65 }
Defines class Lattice.
Defines class Lattice.
A Bravais lattice, characterized by three basis vectors, and optionally an ISelectionRule.
Definition: Lattice3D.h:29
Lattice3D FCCLattice(double a)
Returns a face-centered cubic (cF) lattice with edge length a.
Definition: BakeLattice.cpp:26
Lattice3D HexagonalLattice(double a, double c)
Returns a primitive hexagonal (hP) lattice with hexagonal edge a and height c.
Definition: BakeLattice.cpp:35
Lattice3D BCTLattice(double a, double c)
Returns a body-centered cubic (cI) lattice with edge length a.
Definition: BakeLattice.cpp:59
Lattice3D HCPLattice(double a, double c)
TODO: Clarify how this is meant: HCP is not a Bravais lattice.
Definition: BakeLattice.cpp:43
Lattice3D CubicLattice(double a)
Returns a primitive cubic (cP) lattice with edge length a.
Definition: BakeLattice.cpp:18
Lattice3D TetragonalLattice(double a, double c)
Returns a primitive tetragonal (tP) lattice with square base edge a and height c.
Definition: BakeLattice.cpp:51