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

Method get_bfield

python/simulation.py:4694–4703  ·  view source on GitHub ↗
(self, snap=False)

Source from the content-addressed store, hash-verified

4692 return self.get_array(mp.Hp, cmplx=not self.fields.is_real, snap=snap)
4693
4694 def get_bfield(self, snap=False):
4695 if self.is_cylindrical:
4696 r = self.get_array(mp.Br, cmplx=not self.fields.is_real, snap=snap)
4697 p = self.get_array(mp.Bp, cmplx=not self.fields.is_real, snap=snap)
4698 return np.stack([r, p], axis=-1)
4699 else:
4700 x = self.get_array(mp.Bx, cmplx=not self.fields.is_real, snap=snap)
4701 y = self.get_array(mp.By, cmplx=not self.fields.is_real, snap=snap)
4702 z = self.get_array(mp.Bz, cmplx=not self.fields.is_real, snap=snap)
4703 return np.stack([x, y, z], axis=-1)
4704
4705 def get_bfield_x(self, snap=False):
4706 return self.get_array(mp.Bx, cmplx=not self.fields.is_real, snap=snap)

Callers

nothing calls this directly

Calls 1

get_arrayMethod · 0.95

Tested by

no test coverage detected