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

Function cross

src/fields.cpp:404–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404static inline direction cross(direction a, direction b) {
405 if (a == b) meep::abort("bug - cross expects different directions");
406 bool dcyl = a >= R || b >= R;
407 if (a >= R) a = direction(a - 3);
408 if (b >= R) b = direction(b - 3);
409 direction c = direction((3 + 2 * a - b) % 3);
410 if (dcyl && c < Z) return direction(c + 3);
411 return c;
412}
413
414/* Call this whenever we modify the structure_chunk (fields_chunk::s) to
415 implement copy-on-write semantics. See also structure::changing_chunks. */

Callers 1

FOR_COMPONENTSFunction · 0.85

Calls 2

abortFunction · 0.85
directionEnum · 0.85

Tested by

no test coverage detected