Type¶

This library contains classes related to basic types used in SAMSON, in particular for mathematical operations.

SAMSON API: The SBDType Library

This module is already imported in the Python Scripting Element as follows

from samson.DataModel import Type

Physical constants¶

SAMSON API: SBDTypeConstant

You can access the physical constants in the following way:

Type.constant.Pi
Type.constant.Pi * Type.constant.RadToDeg
Type.constant.kB

Three-dimensional physical vectors¶

SAMSON API: SBDTypePhysicalVector3

Examples:

Type.vector3()                          # creates a dimensionless zero vector
Type.vector3(1, 2, 3)                   # creates a dimensionless vector
Type.vector3([1, 2, 3])                 # creates a dimensionless vector
Type.vector3(Quantity.position(1))      # creates a vector with the same components
Type.vector3(Quantity.squareTime(1))
Type.vector3(Quantity.position(1.14), Quantity.position(3.14), Quantity.position(2.7))

Convenience constructors:

These convenience constructors can be used to create the commonly used physical vectors as follows, without specifying the Quantity unit:

Type.force3(0.0)                # creates a vector with the same components in force units
Type.position3(0.0, 1.0, 2.0)   # creates a position vector in length units

These convenience constructors internaly call vector3 with proper Quantity unit:

Type.dimensionless3(1, 2, 3) == Type.vector3(1, 2, 3)    # True
Type.position3(0.0, 1.0, 2.0) == Type.vector3(Quantity.position(0), Quantity.position(1), Quantity.position(2))   # True

Spatial vectors¶

SAMSON API: SBDTypePhysicalVector6

Convenience constructors:

Spatial matrices¶

SAMSON API: SBDTypePhysicalMatrix66

Convenience constructors:

Spatial transforms¶

SAMSON API: SBDTypeSpatialTransform