Open danielwboyce opened 4 years ago
As a quick check I added this test to utils/test-prism.c
(constructing the same prism defined in the above tests) to see if libctl
is having issues with this geometry for some reason.
/************************************************************************/
/* 8th unit test: quick test of hexagon test prism to see if the */
/* vertices are calculated correctly */
/************************************************************************/
int test_hex_prism() {
void *m = NULL;
vector3_list nodes;
nodes.num_items = 6;
nodes.items = (vector3 *) malloc(nodes.num_items * sizeof(vector3));
nodes.items[0] = make_vector3(-1.0, 0.0, 0.0);
nodes.items[1] = make_vector3(-0.5, sqrt(3.0) / 2.0, 0.0);
nodes.items[2] = make_vector3(0.5, sqrt(3.0) / 2.0, 0.0);
nodes.items[3] = make_vector3(1.0, 0.0, 0.0);
nodes.items[4] = make_vector3(0.5, -sqrt(3.0) / 2.0, 0.0);
nodes.items[5] = make_vector3(-0.5, -sqrt(3.0) / 2.0, 0.0);
double height = 1.5;
vector3 zhat = make_vector3(0, 0, 1);
double ten_degree_sidewall = 10.0 * K_PI / 180.0;
geometric_object hex_ten_degree_sidewall_geom_object = make_slanted_prism(m, nodes, nodes.num_items, height, zhat,
ten_degree_sidewall);
prism *hex_ten_degree_sidewall_prism = hex_ten_degree_sidewall_geom_object.subclass.prism_data;
prism2gnuplot(hex_ten_degree_sidewall_prism, "hex_ten_degree_sidewall_gnu_plot.dat");
return 0;
}
Plotting the calculated vertices with gnuplot
, we see that the vertices look as expected. So it seems that libctl
doesn't have an inherent problem with this geometry, but that the problem is the way meep
calls libctl
or just something in meep
internals.
See comments on NanoComp/meep#1129. Artifacts and fuzziness appear along the prism boundary with nonzero values of
sidewall_angle
. See these comments in particular (1)(2)(3).