Loading...
Searching...
No Matches
SuperCell.h
Go to the documentation of this file.
1// Emacs, this is -*- C++ -*-
2
3#ifndef _SUPERCELL_H
4#define _SUPERCELL_H
5
6#include "Vec.h"
7class Atoms;
8
9// vectors: supercell basis vectors
10// inverse: vectors[i] * inverse[j] = ((i = j) ? 1 : 0)
11// heights: heights of cell
12
14
20class SuperCell {
21public:
23 SuperCell(const Vec v[3], const bool p[3]);
24
26 SuperCell(const SuperCell *original);
27
29 void SetAtoms(Atoms *a);
30
32 void TransformToScaledSpace(Vec *positions, int nAtoms) const;
33
35 void TransformToRealSpace(Vec *positions, int nAtoms) const;
36
38
42 void ClosestLatticeSiteIndices(int intVector[3], Vec &diff) const;
43
45 double GetVolume() const;
46
49 void SetBasis(const Vec v[3]);
50
52 Vec GetBasis(int a) { return vectors[a]; }
53
55
59 void SetPeriodic(const bool newperiodic[3]);
60
61public:
62 bool periodic[3];
65 double heights[3];
68private:
71};
72
73#endif // _SUPERCELL_H
The main list of atoms class.
Definition Atoms.h:36
void SetPeriodic(const bool newperiodic[3])
Set the periodicity. USE WITH CAUTION!
bool periodic[3]
Periodic boundary conditions along the 3 axes?
Definition SuperCell.h:62
void TransformToScaledSpace(Vec *positions, int nAtoms) const
In-place transformation of positions from real to scaled space.
void ClosestLatticeSiteIndices(int intVector[3], Vec &diff) const
Quasicontinuum only: convert position to closest lattice site.
void TransformToRealSpace(Vec *positions, int nAtoms) const
In-place transformation of positions from scaled to real space.
void SetAtoms(Atoms *a)
Set the atoms associated with the supercell.
void SetBasis(const Vec v[3])
Change the basis.
Atoms * atoms
A pointer to the atoms associated with this supercell, if any.
Definition SuperCell.h:69
Vec GetBasis(int a)
Get the basis vectors.
Definition SuperCell.h:52
double GetVolume() const
Get the volume of the supercell.
Vec inverse[3]
The inverse of the vectors matrix.
Definition SuperCell.h:64
SuperCell(const Vec v[3], const bool p[3])
Create a new supercell with basis vectors Vec and periodicity p.
double heights[3]
The heights of the supercell.
Definition SuperCell.h:65
Vec translations[27]
The 27 possible translations due to the periodic boundaries.
Definition SuperCell.h:66
Vec vectors[3]
The basis vectors.
Definition SuperCell.h:63
SuperCell(const SuperCell *original)
Copy constructor.
A 3-vector useful for postions etc.
Definition Vec.h:18