build_quasi_internal(r1, r2, dr, norm_dr)
Build the quasi-internal frame between a pair of sites In this frame, the z-axis is pointing from r2 to r1
Input
r1: N * 3, positions of the first vector r2: N * 3, positions of the second vector dr: N * 3, vector pointing from r1 to r2 norm_dr: (N,), distances between r1 and r2
Output
local_frames: N * 3 * 3: local frames, three axes arranged in rows
Source code in dmff/admp/spatial.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
|
generate_construct_local_frames(axis_types, axis_indices)
Generates the local frame constructor, common to the same physical system
inputs
axis_types: N, a len(N) integer array, labels the types of localframe transformation rules for each atom. axis_indices: N * 3, indices of z,x,y atoms of the localframe of each atom.
outputs
construct_local_frames: function type (positions, box) -> local_frames
Source code in dmff/admp/spatial.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
normalize(matrix, axis=1, ord=2)
Normalise a matrix along one dimension
Source code in dmff/admp/spatial.py
36 37 38 39 40 41 |
|
pbc_shift(drvecs, box, box_inv)
Dealing with the pbc shifts of vectors
Inputs
rvecs: N * 3, a list of real space vectors in Cartesian box: 3 * 3, box matrix, with axes arranged in rows box_inv: 3 * 3, inverse of box matrix
Outputs
rvecs: N * 3, vectors that have been shifted, in Cartesian
Source code in dmff/admp/spatial.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|