Skip to content

Commit

Permalink
bug fix for get_epsilon_point and cell boundary in parallel simulation (
Browse files Browse the repository at this point in the history
NanoComp#1849)

* bug fix for get_epsilon_point and cell boundary in parallel simulation

* check for six digits in test_material_grid.py because of single precision
  • Loading branch information
oskooi authored and Mo Chen committed Feb 16, 2022
1 parent 7b65ab4 commit e35a0c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/tests/test_material_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def test_subpixel_smoothing(self):
def test_symmetry(self):
tran_nosym = compute_transmittance(False)
tran_sym = compute_transmittance(True)
self.assertAlmostEqual(tran_nosym, tran_sym)
self.assertAlmostEqual(tran_nosym, tran_sym, places=6)

if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion src/monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ complex<double> fields::get_chi1inv(component c, direction d, const ivec &origlo
0);
return parallel ? sum_to_all(val) : val;
}
return d == component_direction(c) ? 1.0 : 0; // default to vacuum outside computational cell
return d == component_direction(c) && (parallel || am_master()) ? 1.0 : 0; // default to vacuum outside computational cell
}

complex<double> fields_chunk::get_chi1inv(component c, direction d, const ivec &iloc,
Expand Down

0 comments on commit e35a0c7

Please sign in to comment.