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

Function freq_at_resolution

tests/2D_convergence.cpp:42–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42double freq_at_resolution(double e(const vec &), double a, component c, double beta) {
43 const grid_volume gv = vol2d(2.0, 1.0, a);
44 structure s(gv, e);
45 s.set_epsilon(e);
46
47 fields f(&s, 0, beta);
48 f.use_real_fields();
49 f.use_bloch(vec(0, 0));
50 f.add_point_source(c, 0.18, 2.5, 0.0, 6.0, vec(0.5, 0.5), 1.0);
51 f.add_point_source(c, 0.18, 2.5, 0.0, 6.0, vec(1.5, 0.5), -1.0);
52
53 while (f.time() <= f.last_source_time() + 10.0)
54 f.step();
55 const double fourier_timesteps = 3000.0;
56 const double ttot = fourier_timesteps / a + f.time();
57 monitor_point *p = NULL;
58 while (f.time() <= ttot) {
59 f.step();
60 p = f.get_new_point(vec(0.52, 0.97), p);
61 }
62 const double freq = get_the_freq(p, c);
63 delete p;
64 return freq;
65}
66
67void check_convergence(component c, double best_guess, double beta) {
68 const double amin = 5.0, amax = 30.0, adelta = 5.0;

Callers 1

check_convergenceFunction · 0.85

Calls 11

vol2dFunction · 0.85
get_the_freqFunction · 0.85
use_real_fieldsMethod · 0.80
add_point_sourceMethod · 0.80
timeMethod · 0.80
last_source_timeMethod · 0.80
stepMethod · 0.80
get_new_pointMethod · 0.80
vecClass · 0.50
set_epsilonMethod · 0.45
use_blochMethod · 0.45

Tested by

no test coverage detected