From cb1b2e6822bdd1d1644ff2dad2d6157858e105b0 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Wed, 24 Apr 2019 23:31:40 -0400 Subject: many changes to introduce two-component, elastic-like fracture --- lib/include/network.hpp | 50 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 10 deletions(-) (limited to 'lib/include/network.hpp') diff --git a/lib/include/network.hpp b/lib/include/network.hpp index f12c9c7..ba98086 100644 --- a/lib/include/network.hpp +++ b/lib/include/network.hpp @@ -26,25 +26,55 @@ #endif -class network { +class problem { private: - cholmod_dense *b; - cholmod_factor *factor; - cholmod_sparse *voltcurmat; - cholmod_common *c; + const graph& G; + cholmod_dense* b; + cholmod_factor* factor; + cholmod_sparse* voltcurmat; + cholmod_common* c; + unsigned axis; + public: + problem(const graph&, unsigned axis, cholmod_common*); + problem(const graph&, unsigned axis, cholmod_sparse*, cholmod_common*); + problem(const problem&); + ~problem(); + current_info solve(std::vector& fuses); + void break_edge(unsigned, bool unbreak = false); +}; + +class network { public: const graph& G; std::vector fuses; std::vector thresholds; - network(const graph&, cholmod_common*); - network(const network &other); - ~network(); + network(const graph&); + network(const network&); void set_thresholds(double, std::mt19937&); - void break_edge(unsigned, bool unbreak = false); - current_info get_current_info(); +}; + +class fuse_network : public network { + public: + problem ohm; + + fuse_network(const graph&, cholmod_common*); + void fracture(hooks&, double cutoff = 1e-13); + current_info get_current_info(); +}; + +class elastic_network : public network { + public: + problem hook_x; + problem hook_y; + + elastic_network(const graph&, cholmod_common*); + elastic_network(const elastic_network&); + + void fracture(hooks&, double weight = 0.5, double cutoff = 1e-13); + current_info get_current_info(); }; -- cgit v1.2.3-54-g00ecf