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

Method add_source

python/source.py:1054–1067  ·  view source on GitHub ↗

Calls the add_source method for each equivalent source.

(self, sim)

Source from the content-addressed store, hash-verified

1052 return EH
1053
1054 def add_source(self, sim):
1055 """Calls the add_source method for each equivalent source."""
1056 fields = self.get_fields(sim)
1057
1058 # Get normal vector nHat
1059 size = mp.py_v3_to_vec(sim.dimensions, self.size, sim.is_cylindrical)
1060 if size.x():
1061 nHat = mp.Vector3(0, 1) * np.sign(self._beam_kdir.y)
1062 elif size.y():
1063 nHat = mp.Vector3(1, 0) * np.sign(self._beam_kdir.x)
1064 sources = get_equiv_sources(fields, nHat, self.src, self.center, self.size)
1065
1066 for source in sources:
1067 source.add_source(sim)
1068
1069
1070class GaussianBeamSource(GaussianBeam3DSource):

Callers

nothing calls this directly

Calls 5

get_fieldsMethod · 0.95
get_equiv_sourcesFunction · 0.85
xMethod · 0.45
yMethod · 0.45
add_sourceMethod · 0.45

Tested by

no test coverage detected