summaryrefslogtreecommitdiff
path: root/src/bound_set.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bound_set.c')
-rw-r--r--src/bound_set.c14
1 files changed, 8 insertions, 6 deletions
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) {