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 Periodicity
Available unit-cell periodicity masks.
enum ShapeType
Available unit cell shape types.

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 whose coefficients are expressed in internallength units.
bool canUseMinimumImageConvention (const SBQuantity::length & cutoff) const
Returns true if and only if the minimum-image convention is valid for the cutoffcutoff .
bool checkTriclinicConditions (std::string & error) const
Returns true if the box described by the unit cell satisfies a set of triclinic box conditions.
bool contains (const SBPosition3 & position) const
Returns true if and only ifposition belongs to the primary unit cell.
const SBVector3 & getAngles () const
Returns the angles of the unit cell.
SBPosition3 getCartesianCoordinates (const SBVector3 & fractionalCoordinates) const
Returns the Cartesian coordinates associated with fractionalCoordinates .
SBPosition3 getCenter () const
Returns the center of the primary unit cell.
SBPosition3 getCenterOfTriclinicCell () const
Returns the center of the triclinic unit cell.
SBVector3 getFractionalCoordinates (const SBPosition3 & position) const
Returns the fractional coordinates associated with position .
SBInverseLength3 getInverseLengths () const
Returns the inverse lengths of the unit cell.
SBMatrix33 getInverseMatrix () const
Returns the inverse lattice matrix whose coefficients are expressed in inverse internal length units.
const SBLength3 & getLengths () const
Returns the lengths of the unit cell.
const SBMatrix33 & getMatrix () const
Returns the matrix of the unit cell whose coefficients are expressed in internal length units.
SBLength3 getMinimumImageDisplacement (const SBPosition3 & position1, const SBPosition3 & position2) const
Returns the minimum-image displacement from position1 toposition2 .
SBQuantity::length getMinimumImageDistance (const SBPosition3 & position1, const SBPosition3 & position2) const
Returns the minimum-image distance between position1 andposition2 .
SBQuantity::squareLength getMinimumImageSquaredDistance (const SBPosition3 & position1, const SBPosition3 & position2) const
Returns the minimum-image squared distance between position1 andposition2 .
SBPosition3 getNearestPeriodicImage (const SBPosition3 & position, const SBPosition3 & referencePosition) const
Returns the periodic image of position that is nearest toreferencePosition .
const SBPosition3 & getOrigin () const
Returns the origin of the unit cell.
SBDTypeUnitCell::Periodicity getPeriodicity () const
Returns the unit cell periodicity mask.
SBMatrix33 getReciprocalMatrix (bool include2Pi=false) const
Returns the reciprocal lattice matrix whose coefficients are expressed in inverse internal length units.
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.
SBLength3 getVectorA () const
Returns the first lattice vector.
SBLength3 getVectorB () const
Returns the second lattice vector.
SBLength3 getVectorC () const
Returns the third lattice vector.
SBQuantity::cubicLength getVolume () const
Returns the volume of the unit cell.
SBVector3 getWrappedFractionalCoordinates (const SBVector3 & fractionalCoordinates) const
Returns wrapped fractional coordinates for the periodic axes.
SBPosition3 getWrappedPosition (const SBPosition3 & position) const
Returns the wrapped position associated with position .
bool isFinite () const
Returns true if and only if the unit cell is finite.
bool isPeriodic () const
Returns true if and only if the unit cell is periodic along at least one axis.
bool isPeriodicX () const
Returns true if and only if the unit cell is periodic along the a / x axis.
bool isPeriodicY () const
Returns true if and only if the unit cell is periodic along the b / y axis.
bool isPeriodicZ () const
Returns true if and only if the unit cell is periodic along the c / z axis.
virtual bool isSerializable () const
Returns true __
bool operator!= (const SBDTypeUnitCell & unitCell) const
Returns true if this unit cell is not equal to unit cellunitCell (component-wise)
SBDTypeUnitCell & operator= (const SBDTypeUnitCell & unitCell)
Assignment operator.
bool operator== (const SBDTypeUnitCell & unitCell) const
Returns true if this unit cell is equal to unit cellunitCell (component-wise)
virtual void print (std::ostream & os) const
Prints the unit cell.
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 setPeriodicity (SBDTypeUnitCell::Periodicity periodicity)
Sets the unit cell periodicity mask.
void setShapeType (SBDTypeUnitCell::ShapeType shapeType)
Sets the unit cell's shape type to shapeType .
virtual std::string toPythonCode () const
Returns the string representation of the object that can be used to reconstruct it in Python.
virtual void unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER)
Unserializes the color.
~SBDTypeUnitCell ()
Destructor.

Public Static Functions#

Type Name
bool checkTriclinicConditions (const SBMatrix33 & matrix, std::string & error)
Returns true if the box described by the matrixmatrix whose coefficients are expressed in internallength units satisfies a set of triclinic box conditions.
SBVector3 getAngles (const SBMatrix33 & matrix)
Returns box angles based on the matrix matrix whose coefficients are expressed in internallength units.
SBLength3 getLengths (const SBMatrix33 & matrix)
Returns box length based on the matrix matrix whose coefficients are expressed in internallength units.
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 whose coefficients are expressed in internallength units.
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)
Periodicity periodicity
The unit-cell periodicity mask.
ShapeType shapeType
The type of the unit cell shape.

Detailed Description#

Short name: SBUnitCell

See also: SAMSON's unit system

Public Types Documentation#

enum Periodicity#

Available unit-cell periodicity masks.

enum SBDTypeUnitCell::Periodicity {
    None = 0,
    X = 1,
    Y = 2,
    Z = 4,
    XY = 3,
    XZ = 5,
    YZ = 6,
    XYZ = 7
};


enum ShapeType#

Available unit cell shape types.

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
) 

Constructs a unit cell with the given box length and shape type.

Parameters:

  • length The box length (absolute value is used).
  • shapeType The shape type of the unit cell.

function SBDTypeUnitCell [3/7]#

Constructs an orthorhombic unit cell with the box size lengths .

SBDTypeUnitCell::SBDTypeUnitCell (
    const SBLength3 & lengths
) 

Constructs an orthorhombic unit cell with the given box lengths.

Parameters:

  • lengths The vector of three box lengths (a, b, c). Negative values are made positive.

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
) 

Constructs a unit cell with the given box lengths and angles.

Parameters:

  • lengths The vector of three box lengths (a, b, c). Negative values are made positive.
  • angles The vector of three angles (in degrees) between box vectors. Angles are clamped to [0,180] degrees.

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
) 

Constructs a unit cell with the given box lengths and angles.

Parameters:

  • a Length of box vector a.
  • b Length of box vector b.
  • c Length of box vector c.
  • alpha Angle alpha (in degrees) between box vectors b and c.
  • beta Angle beta (in degrees) between box vectors c and a.
  • gamma Angle gamma (in degrees) between box vectors a and b.

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
) 

Constructs a unit cell based on three vectors.

Parameters:

  • vectorA The first box vector.
  • vectorB The second box vector.
  • vectorC The third box vector.

function SBDTypeUnitCell [7/7]#

Constructs a unit cell based on the matrix matrix whose coefficients are expressed in internallength units.

SBDTypeUnitCell::SBDTypeUnitCell (
    const SBMatrix33 & matrix
) 

Constructs a unit cell based on a matrix.

Parameters:

  • matrix The 3x3 matrix defining the unit cell vectors. If the matrix has a negative determinant, it is reset to a zero matrix.

function canUseMinimumImageConvention#

Returns true if and only if the minimum-image convention is valid for the cutoffcutoff .

bool SBDTypeUnitCell::canUseMinimumImageConvention (
    const SBQuantity::length & cutoff
) const

Returns whether the minimum-image convention is valid for the cutoff cutoff.

Parameters:

  • cutoff The interaction cutoff.

Returns:

true if and only if the minimum-image convention is valid for cutoff.


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

Checks whether the unit cell satisfies the triclinic box conditions.

Parameters:

  • error Reference to a string that receives an error message if the check fails.

Returns:

true if the unit cell satisfies the conditions; otherwise false.


function contains#

Returns true if and only ifposition belongs to the primary unit cell.

bool SBDTypeUnitCell::contains (
    const SBPosition3 & position
) const

Returns whether position belongs to the primary unit cell.

Parameters:

  • position The position to test.

Returns:

true if and only if position belongs to the primary unit cell.


function getAngles [1/2]#

Returns the angles of the unit cell.

const SBVector3 & SBDTypeUnitCell::getAngles () const

Returns:

Reference to the vector of angles (alpha, beta, gamma) in degrees.


function getCartesianCoordinates#

Returns the Cartesian coordinates associated with fractionalCoordinates .

SBPosition3 SBDTypeUnitCell::getCartesianCoordinates (
    const SBVector3 & fractionalCoordinates
) const

Parameters:

  • fractionalCoordinates The fractional coordinates.

Returns:

The associated Cartesian coordinates.


function getCenter#

Returns the center of the primary unit cell.

SBPosition3 SBDTypeUnitCell::getCenter () const

Returns:

The center of the primary unit cell.


function getCenterOfTriclinicCell#

Returns the center of the triclinic unit cell.

SBPosition3 SBDTypeUnitCell::getCenterOfTriclinicCell () const

Returns:

The position of the cell's center.


function getFractionalCoordinates#

Returns the fractional coordinates associated with position .

SBVector3 SBDTypeUnitCell::getFractionalCoordinates (
    const SBPosition3 & position
) const

Parameters:

  • position The Cartesian position.

Returns:

The associated fractional coordinates.


function getInverseLengths#

Returns the inverse lengths of the unit cell.

SBInverseLength3 SBDTypeUnitCell::getInverseLengths () const

Returns:

An SBInverseLength3 object containing the reciprocal of each length component.


function getInverseMatrix#

Returns the inverse lattice matrix whose coefficients are expressed in inverse internal length units.

SBMatrix33 SBDTypeUnitCell::getInverseMatrix () const

Returns the inverse lattice matrix of the unit cell.

Returns:

The inverse lattice matrix.


function getLengths [1/2]#

Returns the lengths of the unit cell.

const SBLength3 & SBDTypeUnitCell::getLengths () const

Returns:

Reference to the vector of lengths (a, b, c).


function getMatrix [1/2]#

Returns the matrix of the unit cell whose coefficients are expressed in internal length units.

const SBMatrix33 & SBDTypeUnitCell::getMatrix () const

Returns the matrix representing the unit cell.

Returns:

Reference to the 3×3 matrix of the unit cell.


function getMinimumImageDisplacement#

Returns the minimum-image displacement from position1 toposition2 .

SBLength3 SBDTypeUnitCell::getMinimumImageDisplacement (
    const SBPosition3 & position1,
    const SBPosition3 & position2
) const

Parameters:

  • position1 The start position.
  • position2 The end position.

Returns:

The minimum-image displacement.


function getMinimumImageDistance#

Returns the minimum-image distance between position1 andposition2 .

SBQuantity::length SBDTypeUnitCell::getMinimumImageDistance (
    const SBPosition3 & position1,
    const SBPosition3 & position2
) const

Parameters:

  • position1 The first position.
  • position2 The second position.

Returns:

The minimum-image distance.


function getMinimumImageSquaredDistance#

Returns the minimum-image squared distance between position1 andposition2 .

SBQuantity::squareLength SBDTypeUnitCell::getMinimumImageSquaredDistance (
    const SBPosition3 & position1,
    const SBPosition3 & position2
) const

Parameters:

  • position1 The first position.
  • position2 The second position.

Returns:

The minimum-image squared distance.


function getNearestPeriodicImage#

Returns the periodic image of position that is nearest toreferencePosition .

SBPosition3 SBDTypeUnitCell::getNearestPeriodicImage (
    const SBPosition3 & position,
    const SBPosition3 & referencePosition
) const

Parameters:

  • position The position to image.
  • referencePosition The reference position.

Returns:

The nearest periodic image of position.


function getOrigin#

Returns the origin of the unit cell.

const SBPosition3 & SBDTypeUnitCell::getOrigin () const

Returns:

Reference to the origin position.


function getPeriodicity#

Returns the unit cell periodicity mask.

SBDTypeUnitCell::Periodicity SBDTypeUnitCell::getPeriodicity () const

Returns the periodicity mask of this unit cell.

Returns:

The periodicity mask.


function getReciprocalMatrix#

Returns the reciprocal lattice matrix whose coefficients are expressed in inverse internal length units.

SBMatrix33 SBDTypeUnitCell::getReciprocalMatrix (
    bool include2Pi=false
) const

Returns the reciprocal lattice matrix of the unit cell.

Parameters:

  • include2Pi Whether to multiply the reciprocal lattice vectors by 2*pi.

Returns:

The reciprocal lattice matrix.


function getShapeType [1/2]#

Returns the unit cell's shape type.

SBDTypeUnitCell::ShapeType SBDTypeUnitCell::getShapeType () const

Returns the shape type of this unit cell.

Returns:

The shape type.


function getShapeTypeString [1/2]#

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

std::string SBDTypeUnitCell::getShapeTypeString () const

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

Returns:

The string representation of the shape type.


function getVectorA#

Returns the first lattice vector.

SBLength3 SBDTypeUnitCell::getVectorA () const

Returns the first lattice vector of the unit cell.

Returns:

The first lattice vector.


function getVectorB#

Returns the second lattice vector.

SBLength3 SBDTypeUnitCell::getVectorB () const

Returns the second lattice vector of the unit cell.

Returns:

The second lattice vector.


function getVectorC#

Returns the third lattice vector.

SBLength3 SBDTypeUnitCell::getVectorC () const

Returns the third lattice vector of the unit cell.

Returns:

The third lattice vector.


function getVolume#

Returns the volume of the unit cell.

SBQuantity::cubicLength SBDTypeUnitCell::getVolume () const

Computes the volume of the unit cell.

Returns:

The volume as a cubic length quantity. Returns zero for infinite or undefined boxes.


function getWrappedFractionalCoordinates#

Returns wrapped fractional coordinates for the periodic axes.

SBVector3 SBDTypeUnitCell::getWrappedFractionalCoordinates (
    const SBVector3 & fractionalCoordinates
) const

Parameters:

  • fractionalCoordinates The fractional coordinates to wrap.

Returns:

The wrapped fractional coordinates.


function getWrappedPosition#

Returns the wrapped position associated with position .

SBPosition3 SBDTypeUnitCell::getWrappedPosition (
    const SBPosition3 & position
) const

Parameters:

  • position The position to wrap.

Returns:

The wrapped position.


function isFinite#

Returns true if and only if the unit cell is finite.

bool SBDTypeUnitCell::isFinite () const

Returns whether this unit cell is finite.

Returns:

true if and only if the unit cell is finite.


function isPeriodic#

Returns true if and only if the unit cell is periodic along at least one axis.

bool SBDTypeUnitCell::isPeriodic () const

Returns whether this unit cell is periodic.

Returns:

true if and only if the unit cell is periodic along at least one axis.


function isPeriodicX#

Returns true if and only if the unit cell is periodic along the a / x axis.

bool SBDTypeUnitCell::isPeriodicX () const

Returns whether this unit cell is periodic along the a / x axis.

Returns:

true if and only if the unit cell is periodic along the a / x axis.


function isPeriodicY#

Returns true if and only if the unit cell is periodic along the b / y axis.

bool SBDTypeUnitCell::isPeriodicY () const

Returns whether this unit cell is periodic along the b / y axis.

Returns:

true if and only if the unit cell is periodic along the b / y axis.


function isPeriodicZ#

Returns true if and only if the unit cell is periodic along the c / z axis.

bool SBDTypeUnitCell::isPeriodicZ () const

Returns whether this unit cell is periodic along the c / z axis.

Returns:

true if and only if the unit cell is periodic along the c / z axis.


function isSerializable#

Returns true __

virtual bool SBDTypeUnitCell::isSerializable () const

Indicates that the unit cell can be serialized.

Returns:

true.


function operator!=#

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

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

Inequality comparison operator.

Parameters:

  • unitCell The unit cell to compare with.

Returns:

true if any of shape type, matrix, or origin differ; otherwise false.


function operator=#

Assignment operator.

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

Parameters:

  • unitCell The source unit cell to copy from.

Returns:

Reference to this unit cell.


function operator==#

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

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

Equality comparison operator.

Parameters:

  • unitCell The unit cell to compare with.

Returns:

true if the unit cells have the same shape type, matrix, and origin; otherwise false.


function print [1/2]#

Prints the unit cell.

virtual void SBDTypeUnitCell::print (
    std::ostream & os
) const

Prints the unit cell to the given output stream.

Writes the lengths, angles, and matrix of the unit cell to the provided output stream.

Parameters:

  • os The output stream to which the unit cell data will be printed.

function print [2/2]#

Prints the unit cell.

virtual void SBDTypeUnitCell::print () const

Prints the unit cell to the standard output.

Calls the overload of print that writes to a stream, using std::cout.


function serialize#

Serializes the color.

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

Serializes the unit cell.

Parameters:

  • serializer The serializer to write the unit cell data to.
  • sdkVersionNumber The SDK version number; defaults to SB_SDK_VERSION_NUMBER.

function setOrigin#

Sets the origin of the unit cell.

void SBDTypeUnitCell::setOrigin (
    const SBPosition3 & origin
) 

Parameters:

  • origin The new origin position.

function setPeriodicity#

Sets the unit cell periodicity mask.

void SBDTypeUnitCell::setPeriodicity (
    SBDTypeUnitCell::Periodicity periodicity
) 

Sets the periodicity mask of this unit cell.

Parameters:

  • periodicity The periodicity mask to set.

function setShapeType#

Sets the unit cell's shape type to shapeType .

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

Sets the shape type of this unit cell.

Parameters:

  • shapeType The shape type to set.

function toPythonCode#

Returns the string representation of the object that can be used to reconstruct it in Python.

virtual std::string SBDTypeUnitCell::toPythonCode () const

Generates a Python code snippet that reconstructs the unit cell.

Returns:

A string containing the Python code representation of this unit cell.


function unserialize#

Unserializes the color.

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

Unserializes the unit cell.

Parameters:

  • serializer The serializer to read the unit cell data from.
  • sdkVersionNumber The SDK version number; defaults to SB_SDK_VERSION_NUMBER.

function ~SBDTypeUnitCell#

Destructor.

SBDTypeUnitCell::~SBDTypeUnitCell () 


Public Static Functions Documentation#

function checkTriclinicConditions [2/2]#

Returns true if the box described by the matrixmatrix whose coefficients are expressed in internallength units satisfies a set of triclinic box conditions.

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

Checks whether a given matrix satisfies the triclinic box conditions.

Parameters:

  • matrix The unit cell matrix to check.
  • error Reference to a string that receives an error message if the check fails.

Returns:

true if the matrix satisfies the conditions; otherwise false.


function getAngles [2/2]#

Returns box angles based on the matrix matrix whose coefficients are expressed in internallength units.

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

Extracts the unit cell angles from a matrix.

Parameters:

  • matrix The unit cell matrix.

Returns:

The angles (alpha, beta, gamma) in degrees as an SBVector3.


function getLengths [2/2]#

Returns box length based on the matrix matrix whose coefficients are expressed in internallength units.

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

Extracts the unit cell lengths from a matrix.

Parameters:

  • matrix The unit cell matrix.

Returns:

The lengths (a, b, c) as an SBLength3.


function getMatrix [2/2]#

Returns box matrix based on length lengths and anglesangles .

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

Computes a unit cell matrix from the given lengths and angles.

Parameters:

  • lengths The lengths of the unit cell (a, b, c).
  • angles The angles of the unit cell (alpha, beta, gamma) in degrees.

Returns:

The computed SBMatrix33 representing the unit cell.


function getShapeType [2/2]#

Returns the unit cell's shape type based on the box matrix matrix whose coefficients are expressed in internallength units.

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

Determines the shape type of a unit cell from its matrix.

Parameters:

  • matrix The unit cell matrix.

Returns:

The ShapeType enumeration value representing the unit cell shape.


function getShapeTypeString [2/2]#

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

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

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

Parameters:

  • shapeType The shape type to get the name for.

Returns:

The string representation of the shape type.


Protected Attributes Documentation#

variable angles#

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

SBVector3 SBDTypeUnitCell::angles;


variable lengths#

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

SBLength3 SBDTypeUnitCell::lengths;


variable matrix#

The unit cell matrix.

SBMatrix33 SBDTypeUnitCell::matrix;


variable origin#

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

SBPosition3 SBDTypeUnitCell::origin;


variable periodicity#

The unit-cell periodicity mask.

Periodicity SBDTypeUnitCell::periodicity;


variable shapeType#

The type of the unit cell shape.

ShapeType SBDTypeUnitCell::shapeType;