summaryrefslogtreecommitdiff
path: root/src/get_conductivity.c
diff options
context:
space:
mode:
authorpants <jaron@kent-dobias.com>2016-09-09 14:33:56 -0400
committerpants <jaron@kent-dobias.com>2016-09-09 14:33:56 -0400
commit03de79b8c5ebcc206e3450dfbc701211d9c254b0 (patch)
treeea1882e66605bbfcf257692c53f45bf1c4d0d2db /src/get_conductivity.c
parentbf525955316995a56b9fd1e66b9345cdf4ba3561 (diff)
downloadfuse_networks-03de79b8c5ebcc206e3450dfbc701211d9c254b0.tar.gz
fuse_networks-03de79b8c5ebcc206e3450dfbc701211d9c254b0.tar.bz2
fuse_networks-03de79b8c5ebcc206e3450dfbc701211d9c254b0.zip
more refactoring
Diffstat (limited to 'src/get_conductivity.c')
-rw-r--r--src/get_conductivity.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/get_conductivity.c b/src/get_conductivity.c
deleted file mode 100644
index 23b7056..0000000
--- a/src/get_conductivity.c
+++ /dev/null
@@ -1,35 +0,0 @@
-
-#include "fracture.h"
-
-double get_conductivity(net_t *net, double *voltages, cholmod_common *c) {
- if (net->voltage_bound) {
- // the voltage drop across the network is fixed to one with voltage
- // boundary conditions, so the conductivity is the total current flowing
- double tot_cur = 0;
- for (uint_t i = 0; i < net->graph->num_spanning_edges; i++) {
- uint_t e = net->graph->spanning_edges[i];
-
- if (!net->fuses[e]) {
- uint_t v1, v2, s1, s2;
- double v1y, v2y;
-
- v1 = net->graph->ev[2 * e];
- v2 = net->graph->ev[2 * e + 1];
-
- v1y = net->graph->vx[2 * v1 + 1];
- v2y = net->graph->vx[2 * v2 + 1];
-
- s1 = v1y < v2y ? v1 : v2;
- s2 = v1y < v2y ? v2 : v1;
-
- tot_cur += voltages[s1] - voltages[s2];
- }
- }
-
- return fabs(tot_cur);
- } else {
- // the current across the network is fixed to one with current boundary
- // conditions, so the conductivity is the inverse of the total voltage drop
- return 1 / fabs(voltages[net->graph->nv] - voltages[net->graph->nv + 1]);
- }
-}