comparison src/femfenics_factory.h @ 247:8ca45824938e

Add factories hierarchy for matrices' and vectors' assembly
author Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
date Sat, 12 Jul 2014 12:30:13 +0200
parents
children 4522d8fd9cba
comparison
equal deleted inserted replaced
246:a2991e2a085b 247:8ca45824938e
1 /*
2 Copyright (C) 2014 Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
3
4 This program is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free Software
6 Foundation; either version 3 of the License, or (at your option) any later
7 version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12 details.
13
14 You should have received a copy of the GNU General Public License along with
15 this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef __FEMFENICS_FACTORY__
19 #define __FEMFENICS_FACTORY__
20
21 #include "femfenics_base_factory.h"
22
23 class femfenics_factory : public femfenics_base_factory
24 {
25 public:
26
27 femfenics_factory ()
28 { dolfin::parameters["linear_algebra_backend"] = linear_algebra_backend (); }
29 virtual ~femfenics_factory () {}
30
31 //FIXME: just one backend implemented
32 inline char const * linear_algebra_backend (void) const
33 { return "uBLAS"; }
34
35 virtual inline octave_value matrix (dolfin::Matrix const& A) const
36 { return factory ().matrix (A); }
37
38 virtual inline octave_value vector (dolfin::Vector const& b) const
39 { return factory ().vector (b); }
40
41 private:
42
43 femfenics_base_factory const& factory (void) const;
44 };
45
46 #endif