Skip to content

Commit

Permalink
fix add_dft_near2far function header
Browse files Browse the repository at this point in the history
  • Loading branch information
oskooi committed Aug 6, 2021
1 parent 57d1464 commit cbbfdc2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions python/tests/test_n2f_periodic.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_nea2far_periodic(self):
res = [20,25,30]
norm = np.empty(3)

for j in range(3):
for j in range(3):
sim = mp.Simulation(resolution=res[j],
cell_size=mp.Vector3(sx,sy),
boundary_layers=pml_layers,
Expand All @@ -59,10 +59,10 @@ def test_nea2far_periodic(self):

norm[j] = LA.norm(n2f_Ez['Ez']-dft_Ez[1:-1])
print("norm:, {}, {:.5f}".format(res[j],norm[j]))
sim.reset_meep()
sim.reset_meep()

self.assertGreater(norm[0],norm[1])
self.assertGreater(norm[1],norm[2])

if __name__ == '__main__':
unittest.main()
unittest.main()
8 changes: 4 additions & 4 deletions src/meep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2093,13 +2093,13 @@ class fields {
// near2far.cpp
dft_near2far add_dft_near2far(const volume_list *where, double freq_min, double freq_max,
int Nfreq, int decimation_factor = 1, int Nperiods = 1) {
return add_dft_near2far(where, linspace(freq_min, freq_max, Nfreq), Nperiods,
decimation_factor);
return add_dft_near2far(where, linspace(freq_min, freq_max, Nfreq), decimation_factor,
Nperiods);
}
dft_near2far add_dft_near2far(const volume_list *where, const std::vector<double> &freq,
int decimation_factor = 1, int Nperiods = 1) {
return add_dft_near2far(where, freq.data(), freq.size(), Nperiods,
decimation_factor);
return add_dft_near2far(where, freq.data(), freq.size(), decimation_factor,
Nperiods);
}
dft_near2far add_dft_near2far(const volume_list *where, const double *freq, size_t Nfreq,
int decimation_factor = 1, int Nperiods = 1);
Expand Down
2 changes: 1 addition & 1 deletion src/near2far.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ double *dft_near2far::flux(direction df, const volume &where, double resolution)
static double approxeq(double a, double b) { return fabs(a - b) < 0.5e-11 * (fabs(a) + fabs(b)); }

dft_near2far fields::add_dft_near2far(const volume_list *where, const double *freq, size_t Nfreq,
int Nperiods, int decimation_factor) {
int decimation_factor, int Nperiods) {

dft_chunk *F = 0; /* E and H chunks*/
double eps = 0, mu = 0;
Expand Down

0 comments on commit cbbfdc2

Please sign in to comment.