Package org.jmol.util
Class SimpleUnitCell
- java.lang.Object
-
- org.jmol.util.SimpleUnitCell
-
- Direct Known Subclasses:
UnitCell
public class SimpleUnitCell extends java.lang.Objectgeneral-purpose simple unit cell for calculations and as a super-class of unitcell, which is only part of Symmetry allows one-dimensional (polymer) and two-dimensional (slab) periodicity
-
-
Field Summary
Fields Modifier and Type Field Description protected floataprotected doublea_protected floatalphaprotected floatbprotected doubleb_protected floatbetaprotected floatcprotected doublec_protected doublecA_protected doublecB_protected doublecosAlphaprotected doublecosBetaprotected doublecosGammaprotected intdimensionprivate javajs.util.P3fractionalOriginprotected floatgammastatic intINFO_Astatic intINFO_ALPHAstatic intINFO_Bstatic intINFO_BETAstatic intINFO_Cstatic intINFO_DIMENSIONSstatic intINFO_GAMMAjavajs.util.M4matrixCartesianToFractionalprotected javajs.util.M4matrixCtoFANoOffsetjavajs.util.M4matrixFractionalToCartesianprotected javajs.util.M4matrixFtoCNoOffsetprivate intnaprivate intnbprivate intncprotected doublesinAlphaprotected doublesinBetaprotected doublesinGammastatic floatSLOPprivate static floatSLOP1protected static floattoRadiansprotected float[]unitCellParamsdoublevolume
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleUnitCell()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static floatgetCellWeight(javajs.util.P3 pt)calculate weighting of 1 (interior), 0.5 (face), 0.25 (edge), or 0.125 (vertex)javajs.util.T3getFractionalOrigin()floatgetInfo(int infoType)static javajs.util.T3[]getReciprocal(javajs.util.T3[] abc, javajs.util.T3[] ret, float scale)float[]getUnitCellAsArray(boolean vectorsOnly)float[]getUnitCellParams()static voidijkToPoint3f(int nnn, javajs.util.P3 cell, int offset)Expanded cell notation: 111 - 1000 --> center 5,5,5; range 0 to 9 or -5 to +4 1000000 - 1999999 --> center 50,50,50; range 0 to 99 or -50 to +49 1000000000 - 1999999999 --> center 500, 500, 500; range 0 to 999 or -500 to +499protected voidinit(float[] params)booleanisPolymer()booleanisSlab()booleanisSupercell()static booleanisValid(float[] parameters)static SimpleUnitCellnewA(float[] params)private voidsetABC(javajs.util.V3 va, javajs.util.V3 vb, javajs.util.V3 vc)private voidsetCellParams()static javajs.util.T3[]setOabc(java.lang.String abcabg, float[] params, javajs.util.T3[] ucnew)set cell vectors by stringprivate voidsetParamsFromMatrix()voidtoCartesian(javajs.util.T3 pt, boolean ignoreOffset)voidtoFractional(javajs.util.T3 pt, boolean isAbsolute)voidtoFractionalM(javajs.util.M4 m)javajs.util.P3toSupercell(javajs.util.P3 fpt)convenience return only after changing fpt
-
-
-
Field Detail
-
unitCellParams
protected float[] unitCellParams
-
matrixCartesianToFractional
public javajs.util.M4 matrixCartesianToFractional
-
matrixFractionalToCartesian
public javajs.util.M4 matrixFractionalToCartesian
-
volume
public double volume
-
toRadians
protected static final float toRadians
- See Also:
- Constant Field Values
-
na
private int na
-
nb
private int nb
-
nc
private int nc
-
a
protected float a
-
b
protected float b
-
c
protected float c
-
alpha
protected float alpha
-
beta
protected float beta
-
gamma
protected float gamma
-
cosAlpha
protected double cosAlpha
-
sinAlpha
protected double sinAlpha
-
cosBeta
protected double cosBeta
-
sinBeta
protected double sinBeta
-
cosGamma
protected double cosGamma
-
sinGamma
protected double sinGamma
-
cA_
protected double cA_
-
cB_
protected double cB_
-
a_
protected double a_
-
b_
protected double b_
-
c_
protected double c_
-
dimension
protected int dimension
-
fractionalOrigin
private javajs.util.P3 fractionalOrigin
-
matrixCtoFANoOffset
protected javajs.util.M4 matrixCtoFANoOffset
-
matrixFtoCNoOffset
protected javajs.util.M4 matrixFtoCNoOffset
-
INFO_DIMENSIONS
public static final int INFO_DIMENSIONS
- See Also:
- Constant Field Values
-
INFO_GAMMA
public static final int INFO_GAMMA
- See Also:
- Constant Field Values
-
INFO_BETA
public static final int INFO_BETA
- See Also:
- Constant Field Values
-
INFO_ALPHA
public static final int INFO_ALPHA
- See Also:
- Constant Field Values
-
INFO_C
public static final int INFO_C
- See Also:
- Constant Field Values
-
INFO_B
public static final int INFO_B
- See Also:
- Constant Field Values
-
INFO_A
public static final int INFO_A
- See Also:
- Constant Field Values
-
SLOP
public static final float SLOP
- See Also:
- Constant Field Values
-
SLOP1
private static final float SLOP1
- See Also:
- Constant Field Values
-
-
Method Detail
-
isSupercell
public boolean isSupercell()
-
isValid
public static boolean isValid(float[] parameters)
-
newA
public static SimpleUnitCell newA(float[] params)
- Parameters:
params- len = 6 [a b c alpha beta gamma] or len = 15 [-1 0 0 0 0 0 va vb vc] or len = 22 [a b c alpha beta gamma m00 m01 .. m33] and/or len = 25 [...................... na nb nc]- Returns:
- a simple unit cell
-
init
protected void init(float[] params)
-
setParamsFromMatrix
private void setParamsFromMatrix()
-
setABC
private void setABC(javajs.util.V3 va, javajs.util.V3 vb, javajs.util.V3 vc)
-
setCellParams
private void setCellParams()
-
getFractionalOrigin
public javajs.util.T3 getFractionalOrigin()
-
toSupercell
public javajs.util.P3 toSupercell(javajs.util.P3 fpt)
convenience return only after changing fpt- Parameters:
fpt-- Returns:
- adjusted fpt
-
toCartesian
public final void toCartesian(javajs.util.T3 pt, boolean ignoreOffset)
-
toFractionalM
public void toFractionalM(javajs.util.M4 m)
-
toFractional
public final void toFractional(javajs.util.T3 pt, boolean isAbsolute)
-
isPolymer
public boolean isPolymer()
-
isSlab
public boolean isSlab()
-
getUnitCellParams
public final float[] getUnitCellParams()
-
getUnitCellAsArray
public final float[] getUnitCellAsArray(boolean vectorsOnly)
-
getInfo
public final float getInfo(int infoType)
-
ijkToPoint3f
public static void ijkToPoint3f(int nnn, javajs.util.P3 cell, int offset)Expanded cell notation: 111 - 1000 --> center 5,5,5; range 0 to 9 or -5 to +4 1000000 - 1999999 --> center 50,50,50; range 0 to 99 or -50 to +49 1000000000 - 1999999999 --> center 500, 500, 500; range 0 to 999 or -500 to +499- Parameters:
nnn-cell-offset- 0 or 1 typically; < 0 means "apply no offset"
-
getCellWeight
public static float getCellWeight(javajs.util.P3 pt)
calculate weighting of 1 (interior), 0.5 (face), 0.25 (edge), or 0.125 (vertex)- Parameters:
pt- // * @param tolerance fractional allowance to consider this on an edge- Returns:
- weighting
-
getReciprocal
public static javajs.util.T3[] getReciprocal(javajs.util.T3[] abc, javajs.util.T3[] ret, float scale)
-
setOabc
public static javajs.util.T3[] setOabc(java.lang.String abcabg, float[] params, javajs.util.T3[] ucnew)set cell vectors by string- Parameters:
abcabg- "a=...,b=...,c=...,alpha=...,beta=..., gamma=..." or nullparams- to use if not nullucnew- to create and return; null if only to set params- Returns:
- T3[4] origin, a, b c
-
-