Mercurial > fem-fenics-eugenio
comparison src/femfenics_factory.cc @ 250:8f309b85bb7e
Add function to set linear algebra back-end
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Sun, 13 Jul 2014 19:25:03 +0200 |
parents | 8ca45824938e |
children | b1dc98050634 |
comparison
equal
deleted
inserted
replaced
249:f56525533e54 | 250:8f309b85bb7e |
---|---|
15 this program; if not, see <http://www.gnu.org/licenses/>. | 15 this program; if not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 #include "femfenics_factory.h" | 18 #include "femfenics_factory.h" |
19 #include "uBLAS_factory.h" | 19 #include "uBLAS_factory.h" |
20 #include <octave/parse.h> | |
20 | 21 |
21 femfenics_base_factory const& | 22 femfenics_base_factory const& |
22 femfenics_factory::factory (void) const | 23 femfenics_factory::factory (void) const |
23 { | 24 { |
24 //FIXME: Since just one backend has its interface implemented, this method | 25 std::string backend = linear_algebra_backend (); |
25 // doesn't check which one to provide, yet | 26 /* Here go the returns for other back-ends |
27 if (backend == "PETSc") | |
28 return PETSc_factory::instance (); ... | |
29 */ | |
30 | |
31 // Default back-end | |
26 return uBLAS_factory::instance (); | 32 return uBLAS_factory::instance (); |
27 } | 33 } |
34 | |
35 std::string | |
36 femfenics_factory::linear_algebra_backend (void) const | |
37 { | |
38 octave_value_list ovl = feval ("linear_algebra_backend"); | |
39 std::string retval = ovl(0).string_value (); | |
40 return retval; | |
41 } |