From 3c5671310bdada56f5e087b951ac2e4d6086dfbf Mon Sep 17 00:00:00 2001 From: pants Date: Wed, 7 Sep 2016 20:14:05 -0400 Subject: got square network embedded working, torus still broken --- src/bound_set.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/bound_set.c') diff --git a/src/bound_set.c b/src/bound_set.c index 9c67f82..f513aa1 100644 --- a/src/bound_set.c +++ b/src/bound_set.c @@ -16,7 +16,9 @@ double u_y(double x, double y) { return sqrt(r) * sin(th / 2); } -void bound_set_embedded(double *bound, uint_t L, double notch_len) { +void bound_set_embedded(double *bound, const graph_t *g, double notch_len) { + uint_t L = g->L; + for (uint_t i = 0; i < L / 2; i++) { double x1, y1, x2, y2, x3, y3, x4, y4; x1 = (2. * i + 1.) / L - notch_len; y1 = 0.5 - 1.; @@ -24,10 +26,10 @@ void bound_set_embedded(double *bound, uint_t L, double notch_len) { y3 = (2. * i + 1.) / L - 0.5; x3 = 0.5 - 1.; y4 = (2. * i + 1.) / L - 0.5; x4 = 0.5 - 0.; - bound[i] = u_y(x1, y1); - bound[L / 2 + i] = u_y(x2, y2); - bound[L + i] = u_y(x3, y3); - bound[3 * L / 2 + i] = u_y(x4, y4); + bound[g->bound_verts[g->bound_inds[0] + i]] = u_y(x1, y1); + bound[g->bound_verts[g->bound_inds[1] + i]] = u_y(x2, y2); + bound[g->bound_verts[g->bound_inds[2] + i]] = u_y(x3, y3); + bound[g->bound_verts[g->bound_inds[3] + i]] = u_y(x4, y4); } } @@ -44,7 +46,7 @@ cholmod_dense *bound_set(const graph_t *g, bool vb, double notch_len, cholmod_co bound[g->bound_verts[0]] = 1; break; case EMBEDDED_BOUND: - bound_set_embedded(bound, g->L, notch_len); + bound_set_embedded(bound, g, notch_len); break; default: if (vb) { -- cgit v1.2.3-70-g09d2