class SuperCell

Overview

The SuperCell defines the size, shape and boundary condx of a simulation. More…

#include <SuperCell.h>
 
class SuperCell {
public:
    // fields
 
    bool periodic[3];
    Vec vectors[3];
    Vec inverse[3];
    double heights[3];
    Vec translations[27];
 
    // construction
 
    SuperCell(const Vec v[3], const bool p[3]);
    SuperCell(const SuperCell* original);
 
    // methods
 
    void SetAtoms(Atoms* a);
    void TransformToScaledSpace(Vec* positions, int nAtoms) const;
    void TransformToRealSpace(Vec* positions, int nAtoms) const;
    void ClosestLatticeSiteIndices(int intVector[3], Vec& diff) const;
    double GetVolume() const;
    void SetBasis(const Vec v[3]);
    Vec GetBasis(int a);
    void SetPeriodic(const bool newperiodic[3]);
};

Detailed Documentation

The SuperCell defines the size, shape and boundary condx of a simulation.

The SuperCell serves two purposes. The most important is the computational box of a simulation: it defines the size, shape and boundary conditions of the simulation. A second use is for the unit cell of the lattice in the elements of a Quasicontinuum simulation.

Fields

bool periodic[3]

Periodic boundary conditions along the 3 axes?

Vec vectors[3]

The basis vectors.

Vec inverse[3]

The inverse of the vectors matrix.

double heights[3]

The heights of the supercell.

Vec translations[27]

The 27 possible translations due to the periodic boundaries.

Construction

SuperCell(const Vec v[3], const bool p[3])

Create a new supercell with basis vectors Vec and periodicity p.

SuperCell(const SuperCell* original)

Copy constructor.

Methods

void SetAtoms(Atoms* a)

Set the atoms associated with the supercell.

void TransformToScaledSpace(Vec* positions, int nAtoms) const

In-place transformation of positions from real to scaled space.

void TransformToRealSpace(Vec* positions, int nAtoms) const

In-place transformation of positions from scaled to real space.

void ClosestLatticeSiteIndices(int intVector[3], Vec& diff) const

Quasicontinuum only: convert position to closest lattice site.

When the supercell is used in a QC simulation to represent the crystal lattice of an element, this function is used to convert the position of an atom into lattice coordinates.

double GetVolume() const

Get the volume of the supercell.

void SetBasis(const Vec v[3])

Change the basis. The atoms are not moved. Should only be called from the atoms.

Vec GetBasis(int a)

Get the basis vectors.

void SetPeriodic(const bool newperiodic[3])

Set the periodicity. USE WITH CAUTION!

Change the periodicity of the supercell. Other classes may not notice that this has happened. This cannot be done after the atoms have been assigned a Potential.