Skip to content

Commit

Permalink
add missing fixed field phase to MPB unit test (#1860)
Browse files Browse the repository at this point in the history
  • Loading branch information
oskooi authored Dec 21, 2021
1 parent 5f51d1c commit 1e43687
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions python/tests/test_mpb.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ def test_output_field_to_file(self):
def test_compute_field_energy(self):
ms = self.init_solver()
ms.run_te()
mpb.fix_hfield_phase(ms, 8)
ms.get_dfield(8)
field_pt = ms.get_field_point(mp.Vector3(0.5, 0.5))
bloch_field_pt = ms.get_bloch_field_point(mp.Vector3(0.5, 0.5))
Expand Down Expand Up @@ -701,8 +702,10 @@ def test_diamond(self):
def get_dpwr(ms, band):
dpwr.append(ms.get_dpwr(band))

ms.run(mpb.output_at_kpoint(mp.Vector3(0, 0.625, 0.375), mpb.fix_dfield_phase,
mpb.output_dpwr, get_dpwr))
ms.run(mpb.output_at_kpoint(mp.Vector3(0, 0.625, 0.375),
mpb.fix_dfield_phase,
mpb.output_dpwr,
get_dpwr))

expected_brd = [
((0.0, mp.Vector3(0.0, 0.0, 0.0)),
Expand Down Expand Up @@ -812,7 +815,8 @@ def test_line_defect(self):
ms.tolerance = 1e-12

ms.run_tm(mpb.output_at_kpoint(k_points[len(k_points) // 2]),
mpb.fix_efield_phase, mpb.output_efield_z)
mpb.fix_efield_phase,
mpb.output_efield_z)

ref_fn = 'line-defect-e.k04.b12.z.tm.h5'
ref_path = os.path.join(self.data_dir, ref_fn)
Expand Down Expand Up @@ -973,8 +977,9 @@ def test_tri_rods(self):
ms.tolerance = 1e-12
ms.filename_prefix = self.filename_prefix

ms.run_tm(mpb.output_at_kpoint(mp.Vector3(1 / -3, 1 / 3), mpb.fix_efield_phase,
mpb.output_efield_z))
ms.run_tm(mpb.output_at_kpoint(mp.Vector3(1 / -3, 1 / 3),
mpb.fix_efield_phase,
mpb.output_efield_z))

ref_fn = 'tri-rods-e.k11.b08.z.tm.h5'
ref_path = os.path.join(self.data_dir, ref_fn)
Expand Down

0 comments on commit 1e43687

Please sign in to comment.