SBUnitCell#
This class represent a unit cell.
See also
SAMSON SDK: SBDTypeUnitCell
- class samson.SBUnitCell(*args, **kwargs)#
Bases:
pybind11_objectThis class is used to represent a unit cell.
SAMSON API: SBDTypeUnitCell
Overloaded function.
__init__(self: samson.SBUnitCell) -> None
Constructs a unit cell with lengths and angles set to zero.
__init__(self: samson.SBUnitCell, length: samson.SBQuantity.unitsSI, shapeType: samson.SBUnitCell.ShapeType = <ShapeType.Cubic: 1>) -> None
Constructs a cubic, rhombic dodecahedral, or truncated octahedral box with the box length length.
- Parameters:
length (samson.SBQuantity.unitsSI) – The side length
shapeType (samson.SBUnitCell.ShapeType, default=SBUnitCell.ShapeType.Cubic) – The shapet ype
__init__(self: samson.SBUnitCell, lengths: samson.SBPhysicalVector3) -> None
Constructs an orthorhombic unit cell with the box size lengths.
- Parameters:
lengths (samson.SBPosition3) – The lengths vector
__init__(self: samson.SBUnitCell, lengths: samson.SBPhysicalVector3, angles: samson.SBPhysicalVector3) -> None
Constructs a triclinic unit cell with the box size length and angles angles (in degrees).
- Parameters:
lengths (samson.SBPosition3) – The lengths vector
angles (samson.SBVector3) – The angles vector
__init__(self: samson.SBUnitCell, a: samson.SBQuantity.unitsSI, b: samson.SBQuantity.unitsSI, c: samson.SBQuantity.unitsSI, alpha: samson.SBQuantity.unitsSI, beta: samson.SBQuantity.unitsSI, gamma: samson.SBQuantity.unitsSI) -> None
Constructs a triclinic unit cell with the box size and angles (in degrees).
- Parameters:
a (samson.SBQuantity.unitsSI) – The length a
b (samson.SBQuantity.unitsSI) – The length b
c (samson.SBQuantity.unitsSI) – The length c
alpha (samson.SBQuantity.unitsSI) – The angle alpha
beta (samson.SBQuantity.unitsSI) – The angle beta
gamma (samson.SBQuantity.unitsSI) – The angle gamma
__init__(self: samson.SBUnitCell, vectorA: samson.SBPhysicalVector3, vectorB: samson.SBPhysicalVector3, vectorC: samson.SBPhysicalVector3) -> None
Constructs a unit cell based on 3 vectors vectorA, vectorB, vectorC.
- Parameters:
vectorA (samson.SBPosition3) – The first length vector
vectorB (samson.SBPosition3) – The second length vector
vectorC (samson.SBPosition3) – The third length vector
__init__(self: samson.SBUnitCell, matrix: samson.SBPhysicalMatrix33) -> None
Constructs a unit cell based on the matrix matrix (triclinic vectors).
- Parameters:
matrix (samson.SBMatrix33) – The unit cell matrix
- class ShapeType(self: samson.SBUnitCell.ShapeType, value: int)#
Bases:
pybind11_objectMembers:
Undefined : Undefined or infinite unit cell
Infinite : Undefined or infinite unit cell
Cubic : A cubic unit cell
Orthorhombic : An orthorhombic unit cell
Triclinic : A triclinic unit cell
Dodecahedron : A rhombic dodecahedron unit cell
RhombicDodecahedron : A rhombic dodecahedron unit cell
Octahedron : A truncated octahedron unit cell
TruncatedOctahedron : A truncated octahedron unit cell
- Cubic = <ShapeType.Cubic: 1>#
- Dodecahedron = <ShapeType.Dodecahedron: 4>#
- Infinite = <ShapeType.Undefined: 0>#
- Octahedron = <ShapeType.Octahedron: 5>#
- Orthorhombic = <ShapeType.Orthorhombic: 2>#
- RhombicDodecahedron = <ShapeType.Dodecahedron: 4>#
- Triclinic = <ShapeType.Triclinic: 3>#
- TruncatedOctahedron = <ShapeType.Octahedron: 5>#
- Undefined = <ShapeType.Undefined: 0>#
- property name#
- property value#
- checkTriclinicConditions(self: samson.SBUnitCell) tuple#
Returns True if the box described by the unit cell satisfies a set of triclinic box conditions.
- Returns:
A tuple with a boolean result and an error string, in case there is an error
- Return type:
Tuple(bool, str)
- static checkTriclinicConditionsForMatrix(matrix: samson.SBPhysicalMatrix33) tuple#
Returns true if the box described by the matrix matrix satisfies a set of triclinic box conditions).
- Parameters:
matrix (samson.SBMatrix33) – The matrix
- Returns:
A tuple with a boolean result and an error string, in case there is an error
- Return type:
Tuple(bool, str)
- static createMatrix(lengths: samson.SBPhysicalVector3, angles: samson.SBPhysicalVector3) samson.SBPhysicalMatrix33#
Returns box matrix based on lengths lengths and angles angles.
- Parameters:
lengths (samson.SBPosition3) – The lengths
angles (samson.SBVector3) – The angles
- getAngles(self: samson.SBUnitCell) samson.SBPhysicalVector3#
Returns the angles of the unit cell
- static getAnglesFromMatrix(matrix: samson.SBPhysicalMatrix33) samson.SBPhysicalVector3#
Returns box angles based on the matrix matrix.
- Parameters:
matrix (samson.SBMatrix33) – The matrix
- getCenterOfTriclinicCell(self: samson.SBUnitCell) samson.SBPhysicalVector3#
Returns the center of the triclinic unit cell.
- Returns:
The center of the triclinic unit cell
- Return type:
- getInverseLengths(self: samson.SBUnitCell) samson.SBPhysicalVector3#
Returns the inverse lengths of the unit cell
- getLengths(self: samson.SBUnitCell) samson.SBPhysicalVector3#
Returns the lengths of the unit cell
- static getLengthsFromMatrix(matrix: samson.SBPhysicalMatrix33) samson.SBPhysicalVector3#
Returns box length based on the matrix matrix.
- Parameters:
matrix (samson.SBMatrix33) – The matrix
- getMatrix(self: samson.SBUnitCell) samson.SBPhysicalMatrix33#
Returns the matrix of the unit cell
- getOrigin(self: samson.SBUnitCell) samson.SBPhysicalVector3#
Returns the origin of the unit cell
- static getShapeType(matrix: samson.SBPhysicalMatrix33) samson.SBUnitCell.ShapeType#
Returns the unit cell’s shape type based on the box matrix matrix.
- Parameters:
matrix (samson.SBMatrix33) – The matrix
- static getShapeTypeString(shapeType: samson.SBUnitCell.ShapeType) str#
Returns the name of the unit cell’s shape type shapeType
- Parameters:
shapeType (samson.SBUnitCell.ShapeType) – The shape type
- getVolume(self: samson.SBUnitCell) samson.SBQuantity.unitsSI#
Returns the volume of the unit cell
- Returns:
The volume of the unit cell
- Return type:
samson.SBQuantity.unitSI
- setOrigin(self: samson.SBUnitCell, origin: samson.SBPhysicalVector3) None#
Sets the origin of the unit cell
- Parameters:
origin (samson.SBPosition3) – The length vector
- Cubic = <ShapeType.Cubic: 1>#
- Dodecahedron = <ShapeType.Dodecahedron: 4>#
- Infinite = <ShapeType.Undefined: 0>#
- Octahedron = <ShapeType.Octahedron: 5>#
- Orthorhombic = <ShapeType.Orthorhombic: 2>#
- RhombicDodecahedron = <ShapeType.Dodecahedron: 4>#
- Triclinic = <ShapeType.Triclinic: 3>#
- TruncatedOctahedron = <ShapeType.Octahedron: 5>#
- Undefined = <ShapeType.Undefined: 0>#
- property shapeType#
The unit cell’s shape type
- property shapeTypeString#
Returns the name of the unit cell’s shape type