| 95 | const double inf = 1.0e20; |
| 96 | |
| 97 | static void epsmu_function(symmetric_matrix *eps, symmetric_matrix *eps_inv, const mpb_real r[3], |
| 98 | void *epsilon_data, bool epsflag) { |
| 99 | |
| 100 | mode_solver *ms = static_cast<mode_solver *>(epsilon_data); |
| 101 | meep_geom::material_type mat; |
| 102 | vector3 p; |
| 103 | |
| 104 | // p needs to be in the lattice *unit* vector basis, while r is in the lattice |
| 105 | // vector basis. Also, shift origin to the center of the grid. |
| 106 | p.x = (r[0] - 0.5) * geometry_lattice.size.x; |
| 107 | p.y = (r[1] - 0.5) * geometry_lattice.size.y; |
| 108 | p.z = (r[2] - 0.5) * geometry_lattice.size.z; |
| 109 | |
| 110 | // p = shift_to_unit_cell(p); |
| 111 | |
| 112 | ms->get_material_pt(mat, p); |
| 113 | ms->material_epsmu(mat, eps, eps_inv, epsflag); |
| 114 | } |
| 115 | |
| 116 | // This is the function passed to `set_maxwell_dielectric` |
| 117 | void dielectric_function(symmetric_matrix *eps, symmetric_matrix *eps_inv, const mpb_real r[3], |
no test coverage detected