MCPcopy Create free account
hub / github.com/NanoComp/meep / transform

Method transform

src/vec.cpp:1251–1285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1249}
1250
1251signed_direction symmetry::transform(direction d, int n) const {
1252 // Returns transformed direction + phase/flip; -n indicates inverse transform
1253 if (n == 0 || d == NO_DIRECTION) return signed_direction(d);
1254 int nme, nrest;
1255 if (n < 0) {
1256 nme = (g - (-n) % g) % g;
1257 nrest = -((-n) / g);
1258 }
1259 else {
1260 nme = n % g;
1261 nrest = n / g;
1262 }
1263 if (nme == 0) {
1264 if (nrest == 0)
1265 return signed_direction(d);
1266 else
1267 return next->transform(d, nrest);
1268 }
1269 else {
1270 signed_direction sd;
1271 if (nme == 1) sd = S[d];
1272 if (S[d].flipped)
1273 sd = flip(transform(S[d].d, nme - 1));
1274 else
1275 sd = transform(S[d].d, nme - 1);
1276
1277 if (next && nrest) {
1278 if (sd.flipped)
1279 return flip(next->transform(sd.d, nrest)) * ph;
1280 else
1281 return next->transform(sd.d, nrest) * ph;
1282 }
1283 else { return sd * ph; }
1284 }
1285}
1286
1287ivec symmetry::transform(const ivec &ov, int n) const {
1288 if (n == 0) return ov;

Callers 15

total_volumeMethod · 0.45
choose_chunkdivisionFunction · 0.45
get_fieldMethod · 0.45
get_chi1invMethod · 0.45
add_dft_chunkloopFunction · 0.45
process_dft_componentMethod · 0.45
fourier_sourcedataMethod · 0.45
integrate_chunkloopFunction · 0.45
h5_findsize_chunkloopFunction · 0.45
h5_output_chunkloopFunction · 0.45

Calls 13

signed_directionClass · 0.85
flipFunction · 0.85
volumeClass · 0.85
direction_componentFunction · 0.85
component_directionFunction · 0.85
is_derivedFunction · 0.85
derived_componentEnum · 0.85
componentEnum · 0.85
get_min_cornerMethod · 0.80
get_max_cornerMethod · 0.80
LOOP_OVER_DIRECTIONSFunction · 0.70
in_directionMethod · 0.45

Tested by 2

check_2dFunction · 0.36
check_3dFunction · 0.36