From 4c4ebb87ead363d6d6e11a8b95b07a0f93af5c88 Mon Sep 17 00:00:00 2001 From: pants Date: Tue, 6 Sep 2016 15:05:27 -0400 Subject: finished implementing embedded systems, refactored a bunch --- src/get_current.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/get_current.c') diff --git a/src/get_current.c b/src/get_current.c index 5360054..bc786f9 100644 --- a/src/get_current.c +++ b/src/get_current.c @@ -1,7 +1,7 @@ #include "fracture.h" -double *get_voltage(const finst *instance, cholmod_common *c) { +double *get_voltage(const net_t *instance, cholmod_common *c) { cholmod_dense *b = instance->boundary_cond; cholmod_factor *factor = instance->factor; @@ -22,12 +22,12 @@ double *get_voltage(const finst *instance, cholmod_common *c) { return field; } -double *get_current(const finst *instance, cholmod_common *c) { - unsigned int num_edges = instance->network->num_edges; - unsigned int num_verts = instance->network->num_verts_break; - unsigned int num_gverts = instance->network->break_dim; - unsigned int num_bounds = instance->network->num_bounds; - cholmod_sparse *voltcurmat = instance->network->voltcurmat; +double *get_current(const net_t *instance, cholmod_common *c) { + unsigned int num_edges = instance->graph->ne; + unsigned int num_verts = instance->graph->nv_break; + unsigned int num_gverts = instance->graph->break_dim; + unsigned int num_bounds = instance->graph->num_bounds; + cholmod_sparse *voltcurmat = instance->graph->voltcurmat; double *voltages = get_voltage(instance, c); if (voltages == NULL) { @@ -63,12 +63,12 @@ double *get_current(const finst *instance, cholmod_common *c) { } -double *get_current_v(const finst *instance, double *voltages, cholmod_common *c) { - unsigned int num_edges = instance->network->num_edges; - unsigned int num_verts = instance->network->num_verts_break; - unsigned int num_gverts = instance->network->break_dim; - unsigned int num_bounds = instance->network->num_bounds; - cholmod_sparse *voltcurmat = instance->network->voltcurmat; +double *get_current_v(const net_t *instance, double *voltages, cholmod_common *c) { + unsigned int num_edges = instance->graph->ne; + unsigned int num_verts = instance->graph->nv_break; + unsigned int num_gverts = instance->graph->break_dim; + unsigned int num_bounds = instance->graph->num_bounds; + cholmod_sparse *voltcurmat = instance->graph->voltcurmat; cholmod_dense *x = CHOL_F(allocate_dense)( num_gverts, 1, num_gverts, CHOLMOD_REAL, c); -- cgit v1.2.3-70-g09d2