Web Analytics Made Easy - Statcounter
Skip to content

Class SBDTypeUnitCell#

ClassList > SBDTypeUnitCell

This class is used to represent a unit cell. More...

  • #include <SBDTypeUnitCell.hpp>

Public Types#

Type Name
enum ShapeType

Public Functions#

Type Name
SBDTypeUnitCell ()
Constructs an infinite unit cell.
SBDTypeUnitCell (const SBQuantity::length & length, SBDTypeUnitCell::ShapeType shapeType=SBDTypeUnitCell::ShapeType::Cubic)
Constructs a cubic, rhombic dodecahedral, or truncated octahedral box with the box length length .
SBDTypeUnitCell (const SBLength3 & lengths)
Constructs an orthorhombic unit cell with the box size lengths .
SBDTypeUnitCell (const SBLength3 & lengths, const SBVector3 & angles)
Constructs a triclinic unit cell with the box size length and anglesangles (in degrees)
SBDTypeUnitCell (const SBQuantity::length & a, const SBQuantity::length & b, const SBQuantity::length & c, const SBQuantity::degree & alpha, const SBQuantity::degree & beta, const SBQuantity::degree & gamma)
Constructs a triclinic unit cell with the box size and angles (in degrees)
SBDTypeUnitCell (const SBLength3 & vectorA, const SBLength3 & vectorB, const SBLength3 & vectorC)
Constructs a unit cell based on 3 vectors vectorA ,vectorB ,vectorC .
SBDTypeUnitCell (const SBMatrix33 & matrix)
Constructs a unit cell based on the matrix matrix (triclinic vectors)
bool checkTriclinicConditions (std::string & error) const
Returns true if the box described by the unit cell satisfies a set of triclinic box conditions.
const SBVector3 & getAngles () const
Returns the angles of the unit cell.
SBPosition3 getCenterOfTriclinicCell () const
Returns the center of the triclinic unit cell.
SBInverseLength3 getInverseLengths () const
Returns the inverse lengths of the unit cell.
const SBLength3 & getLengths () const
Returns the lengths of the unit cell.
const SBMatrix33 & getMatrix () const
Returns the matrix of the unit cell.
const SBPosition3 & getOrigin () const
Returns the origin of the unit cell.
SBDTypeUnitCell::ShapeType getShapeType () const
Returns the unit cell's shape type.
std::string getShapeTypeString () const
Returns the name of the unit cell's shape type.
SBQuantity::cubicLength getVolume () const
Returns the volume of the unit cell.
virtual bool isSerializable () const
Returns true.
bool operator!= (const SBDTypeUnitCell & unitCell)
Returns true if this unit cell is not equal to unit cell unitCell (component-wise)
SBDTypeUnitCell & operator= (const SBDTypeUnitCell & unitCell)
Assignment operator.
bool operator== (const SBDTypeUnitCell & unitCell)
Returns true if this unit cell is equal to unit cell unitCell (component-wise)
virtual void print () const
Prints the unit cell.
virtual void serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const
Serializes the color.
void setOrigin (const SBPosition3 & origin)
Sets the origin of the unit cell.
void setShapeType (SBDTypeUnitCell::ShapeType shapeType)
Sets the unit cell's shape type to shapeType .
virtual void unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER)
Unserializes the color.
~SBDTypeUnitCell ()

Public Static Functions#

Type Name
bool checkTriclinicConditions (const SBMatrix33 & matrix, std::string & error)
Returns true if the box described by the matrix matrix satisfies a set of triclinic box conditions.
SBVector3 getAngles (const SBMatrix33 & matrix)
Returns box angles based on the matrix matrix .
SBLength3 getLengths (const SBMatrix33 & matrix)
Returns box length based on the matrix matrix .
SBMatrix33 getMatrix (const SBLength3 & lengths, const SBVector3 & angles)
Returns box matrix based on length lengths and anglesangles .
SBDTypeUnitCell::ShapeType getShapeType (const SBMatrix33 & matrix)
Returns the unit cell's shape type based on the box matrix matrix .
std::string getShapeTypeString (SBDTypeUnitCell::ShapeType shapeType)
Returns the name of the unit cell's shape type shapeType .

Protected Attributes#

Type Name
SBVector3 angles
The angles, in degrees, of the unit cell between the box vectors (bc, ac, ab)
SBLength3 lengths
The lengths of the unit cell - the box vector lengths (a, b, c)
SBMatrix33 matrix
The unit cell matrix.
SBPosition3 origin
The origin of the unit cell, by default it is (0, 0, 0)
ShapeType shapeType
The type of the unit cell shape.

Detailed Description#

Short name: SBUnitCell

See also: SAMSON's unit system

Public Types Documentation#

enum ShapeType#

enum SBDTypeUnitCell::ShapeType {
    Undefined = 0,
    Infinite = 0,
    Cubic = 1,
    Orthorhombic = 2,
    Triclinic = 3,
    Dodecahedron = 4,
    RhombicDodecahedron = 4,
    Octahedron = 5,
    TruncatedOctahedron = 5
};

Public Functions Documentation#

function SBDTypeUnitCell [1/7]#

Constructs an infinite unit cell.

SBDTypeUnitCell::SBDTypeUnitCell () 


function SBDTypeUnitCell [2/7]#

Constructs a cubic, rhombic dodecahedral, or truncated octahedral box with the box length length .

SBDTypeUnitCell::SBDTypeUnitCell (
    const SBQuantity::length & length,
    SBDTypeUnitCell::ShapeType shapeType=SBDTypeUnitCell::ShapeType::Cubic
) 


function SBDTypeUnitCell [3/7]#

Constructs an orthorhombic unit cell with the box size lengths .

SBDTypeUnitCell::SBDTypeUnitCell (
    const SBLength3 & lengths
) 


function SBDTypeUnitCell [4/7]#

Constructs a triclinic unit cell with the box size length and anglesangles (in degrees)

SBDTypeUnitCell::SBDTypeUnitCell (
    const SBLength3 & lengths,
    const SBVector3 & angles
) 


function SBDTypeUnitCell [5/7]#

Constructs a triclinic unit cell with the box size and angles (in degrees)

SBDTypeUnitCell::SBDTypeUnitCell (
    const SBQuantity::length & a,
    const SBQuantity::length & b,
    const SBQuantity::length & c,
    const SBQuantity::degree & alpha,
    const SBQuantity::degree & beta,
    const SBQuantity::degree & gamma
) 


function SBDTypeUnitCell [6/7]#

Constructs a unit cell based on 3 vectors vectorA ,vectorB ,vectorC .

SBDTypeUnitCell::SBDTypeUnitCell (
    const SBLength3 & vectorA,
    const SBLength3 & vectorB,
    const SBLength3 & vectorC
) 


function SBDTypeUnitCell [7/7]#

Constructs a unit cell based on the matrix matrix (triclinic vectors)

SBDTypeUnitCell::SBDTypeUnitCell (
    const SBMatrix33 & matrix
) 


function checkTriclinicConditions [1/2]#

Returns true if the box described by the unit cell satisfies a set of triclinic box conditions.

bool SBDTypeUnitCell::checkTriclinicConditions (
    std::string & error
) const

This function returns whether the box satisfies the set of triclinic box conditions:

  • the matrix should be upper-diagonal
  • the diagonal elements should be positive
  • the box should not be too skewed: |b_x| > a_x/2 or |c_x| > a_x/2 or |c_y| > b_y/2

Fills in error with a message in case if the matrix does not satisfy the triclinic conditions.


function getAngles [1/2]#

Returns the angles of the unit cell.

const SBVector3 & SBDTypeUnitCell::getAngles () const


function getCenterOfTriclinicCell#

Returns the center of the triclinic unit cell.

SBPosition3 SBDTypeUnitCell::getCenterOfTriclinicCell () const


function getInverseLengths#

Returns the inverse lengths of the unit cell.

SBInverseLength3 SBDTypeUnitCell::getInverseLengths () const


function getLengths [1/2]#

Returns the lengths of the unit cell.

const SBLength3 & SBDTypeUnitCell::getLengths () const


function getMatrix [1/2]#

Returns the matrix of the unit cell.

const SBMatrix33 & SBDTypeUnitCell::getMatrix () const


function getOrigin#

Returns the origin of the unit cell.

const SBPosition3 & SBDTypeUnitCell::getOrigin () const


function getShapeType [1/2]#

Returns the unit cell's shape type.

SBDTypeUnitCell::ShapeType SBDTypeUnitCell::getShapeType () const


function getShapeTypeString [1/2]#

Returns the name of the unit cell's shape type.

std::string SBDTypeUnitCell::getShapeTypeString () const


function getVolume#

Returns the volume of the unit cell.

SBQuantity::cubicLength SBDTypeUnitCell::getVolume () const

Returns the volume of the unit cell. The volume is computed as the matrix trace product. Returns zero for infinite and undefined boxes.


function isSerializable#

Returns true.

virtual bool SBDTypeUnitCell::isSerializable () const


function operator!=#

Returns true if this unit cell is not equal to unit cell unitCell (component-wise)

bool SBDTypeUnitCell::operator!= (
    const SBDTypeUnitCell & unitCell
) 


function operator=#

Assignment operator.

SBDTypeUnitCell & SBDTypeUnitCell::operator= (
    const SBDTypeUnitCell & unitCell
) 


function operator==#

Returns true if this unit cell is equal to unit cell unitCell (component-wise)

bool SBDTypeUnitCell::operator== (
    const SBDTypeUnitCell & unitCell
) 


function print#

Prints the unit cell.

virtual void SBDTypeUnitCell::print () const


function serialize#

Serializes the color.

virtual void SBDTypeUnitCell::serialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const


function setOrigin#

Sets the origin of the unit cell.

void SBDTypeUnitCell::setOrigin (
    const SBPosition3 & origin
) 


function setShapeType#

Sets the unit cell's shape type to shapeType .

void SBDTypeUnitCell::setShapeType (
    SBDTypeUnitCell::ShapeType shapeType
) 


function unserialize#

Unserializes the color.

virtual void SBDTypeUnitCell::unserialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) 


function ~SBDTypeUnitCell#

SBDTypeUnitCell::~SBDTypeUnitCell () 

Public Static Functions Documentation#

function checkTriclinicConditions [2/2]#

Returns true if the box described by the matrix matrix satisfies a set of triclinic box conditions.

static bool SBDTypeUnitCell::checkTriclinicConditions (
    const SBMatrix33 & matrix,
    std::string & error
) 

This function returns whether the box described by the matrix satisfies the set of triclinic box conditions:

  • the matrix should be upper-diagonal
  • the diagonal elements should be positive
  • the box should not be too skewed: |b_x| > a_x/2 or |c_x| > a_x/2 or |c_y| > b_y/2

Fills in error with a message in case if the matrix does not satisfy the triclinic conditions.


function getAngles [2/2]#

Returns box angles based on the matrix matrix .

static SBVector3 SBDTypeUnitCell::getAngles (
    const SBMatrix33 & matrix
) 


function getLengths [2/2]#

Returns box length based on the matrix matrix .

static SBLength3 SBDTypeUnitCell::getLengths (
    const SBMatrix33 & matrix
) 


function getMatrix [2/2]#

Returns box matrix based on length lengths and anglesangles .

static SBMatrix33 SBDTypeUnitCell::getMatrix (
    const SBLength3 & lengths,
    const SBVector3 & angles
) 


function getShapeType [2/2]#

Returns the unit cell's shape type based on the box matrix matrix .

static SBDTypeUnitCell::ShapeType SBDTypeUnitCell::getShapeType (
    const SBMatrix33 & matrix
) 


function getShapeTypeString [2/2]#

Returns the name of the unit cell's shape type shapeType .

static std::string SBDTypeUnitCell::getShapeTypeString (
    SBDTypeUnitCell::ShapeType shapeType
) 


Protected Attributes Documentation#

variable angles#

The angles, in degrees, of the unit cell between the box vectors (bc, ac, ab)

SBVector3 angles;


variable lengths#

The lengths of the unit cell - the box vector lengths (a, b, c)

SBLength3 lengths;


variable matrix#

The unit cell matrix.

SBMatrix33 matrix;


variable origin#

The origin of the unit cell, by default it is (0, 0, 0)

SBPosition3 origin;


variable shapeType#

The type of the unit cell shape.

ShapeType shapeType;