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

Method _create_symmetries

python/simulation.py:1697–1716  ·  view source on GitHub ↗
(self, gv)

Source from the content-addressed store, hash-verified

1695 return gv
1696
1697 def _create_symmetries(self, gv) -> Symmetry:
1698 sym = mp.symmetry()
1699
1700 # Initialize swig objects for each symmetry and combine them into one
1701 for s in self.symmetries:
1702 if isinstance(s, Identity):
1703 s.swigobj = mp.identity()
1704 elif isinstance(s, Rotate2):
1705 s.swigobj = mp.rotate2(s.direction, gv)
1706 sym += s.swigobj * complex(s.phase.real, s.phase.imag)
1707 elif isinstance(s, Rotate4):
1708 s.swigobj = mp.rotate4(s.direction, gv)
1709 sym += s.swigobj * complex(s.phase.real, s.phase.imag)
1710 elif isinstance(s, Mirror):
1711 s.swigobj = mp.mirror(s.direction, gv)
1712 sym += s.swigobj * complex(s.phase.real, s.phase.imag)
1713 else:
1714 s.swigobj = mp.symmetry()
1715
1716 return sym
1717
1718 def _get_dft_volumes(self) -> List[Volume]:
1719 volumes = [

Callers 1

_init_structureMethod · 0.95

Calls 1

symmetryMethod · 0.80

Tested by

no test coverage detected