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

Method test_numpy_epsilon

python/tests/test_simulation.py:335–352  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

333 self.assertAlmostEqual(fp, -0.002989654055823199)
334
335 def test_numpy_epsilon(self):
336 sim = self.init_simple_simulation()
337 eps_input_fname = "cyl-ellipsoid-eps-ref.h5"
338 eps_input_dir = os.path.abspath(
339 os.path.join(
340 os.path.dirname(os.path.abspath(__file__)), "..", "..", "tests"
341 )
342 )
343 eps_input_path = os.path.join(eps_input_dir, eps_input_fname)
344
345 with h5py.File(eps_input_path, "r") as f:
346 sim.default_material = f["eps"][()]
347
348 sim.run(until=200)
349 fp = sim.get_field_point(mp.Ez, mp.Vector3(x=1))
350
351 places = 6 if mp.is_single_precision() else 7
352 self.assertAlmostEqual(fp, -0.002989654055823199, places=places)
353
354 def test_set_materials(self):
355 def change_geom(sim):

Callers

nothing calls this directly

Calls 3

runMethod · 0.45
get_field_pointMethod · 0.45

Tested by

no test coverage detected