DoFSetBasis#
- class libcasm.xtal.DoFSetBasis(
- self: DoFSetBasis,
- dofname: str,
- axis_names: collections.abc.Sequence[str] = [],
- basis: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, n]'] = array([], shape=(0, 0), dtype=float64),
Bases:
pybind11_objectThe basis for a set of degrees of freedom (DoF)
Degrees of freedom (DoF) are continuous-valued vectors having a standard basis that is related to the fixed reference frame of the crystal. CASM supports both site DoF, which are associated with a particular prim basis site, and global DoF, which are associated with the infinite crystal. Standard DoF types are implemented in CASM and a traits system allows developers to extend CASM to include additional types of DoF.
In many cases, the standard basis is the appropriate choice, but CASM also allows for a user-specified basis in terms of the standard basis. A user-specified basis may fully span the standard basis or only a subspace. This allows:
restricting strain to a subspace, such as only volumetric or only shear strains
restricting displacements to a subspace, such as only within a particular plane
reorienting DoF, such as to use symmetry-adapted strain order parameters
See the CASM Degrees of Freedom (DoF) and Properties documentation for the full list of supported DoF types and their definitions. Some examples:
“disp”: Atomic displacement
“EAstrain”: Euler-Almansi strain metric
“GLstrain”: Green-Lagrange strain metric
“Hstrain”: Hencky strain metric
“Cmagspin”: Collinear magnetic spin
“SOmagspin”: Non-collinear magnetic spin, with spin-orbit coupling
Special Methods
DoFSetBasis may be copied with
DoFSetBasis.copy, copy.copy, or copy.deepcopy.
Constructor
- Parameters:
dofname (str) – The type of DoF. Must be a CASM supported DoF type.
basis (array_like, shape (m, n), default=numpy.ndarray[numpy.float64[1, 0]]) – User-specified DoF basis vectors, as columns of a matrix. The DoF values in this basis, x_prim, are related to the DoF values in the CASM standard basis, x_standard, according to
x_standard = basis @ x_prim. The number of rows in the basis matrix must match the standard dimension of the CASM DoF type. The number of columns must be less than or equal to the number of rows. The default value indicates the standard basis should be used.axis_names (list[str], default=[]) –
Names for the DoF basis vectors (i.e. names for the basis matrix columns). Size must match number of columns in the basis matrix. The axis names should be appropriate for use in latex basis function formulas. Example, for
dofname="disp":axis_names=[“d_{1}”, “d_{2}”, “d_{3}”]
The default value indicates the standard basis should be used.
Methods