Mercurial > fem-fenics-eugenio
comparison src/functionspace.h @ 253:5e9b5bbdc56b
Support both DOLFIN 1.3.0 and 1.4.0
* src/dolfin_compat.h: use a macro to set the correct shared_ptr (std or boost)
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Tue, 29 Jul 2014 18:05:56 +0200 |
parents | 9e944b0d0fc8 |
children |
comparison
equal
deleted
inserted
replaced
252:7f33554e439a | 253:5e9b5bbdc56b |
---|---|
20 | 20 |
21 #include <memory> | 21 #include <memory> |
22 #include <vector> | 22 #include <vector> |
23 #include <dolfin.h> | 23 #include <dolfin.h> |
24 #include <octave/oct.h> | 24 #include <octave/oct.h> |
25 #include "dolfin_compat.h" | |
25 | 26 |
26 class functionspace : public octave_base_value | 27 class functionspace : public octave_base_value |
27 { | 28 { |
28 | 29 |
29 public: | 30 public: |
30 | 31 |
31 functionspace () | 32 functionspace () |
32 : octave_base_value (), fsp () {} | 33 : octave_base_value (), fsp () {} |
33 | 34 |
34 functionspace (boost::shared_ptr <const dolfin::FunctionSpace> _fsp) | 35 functionspace (SHARED_PTR <const dolfin::FunctionSpace> _fsp) |
35 : octave_base_value (), fsp (_fsp) {} | 36 : octave_base_value (), fsp (_fsp) {} |
36 | 37 |
37 void | 38 void |
38 print (std::ostream& os, bool pr_as_read_syntax = false) const | 39 print (std::ostream& os, bool pr_as_read_syntax = false) const |
39 { os << "Functional Space : " << (*fsp).str(true) << std::endl; } | 40 { os << "Functional Space : " << (*fsp).str(true) << std::endl; } |
46 | 47 |
47 const dolfin::FunctionSpace & | 48 const dolfin::FunctionSpace & |
48 get_fsp (void) const | 49 get_fsp (void) const |
49 { return (*fsp); } | 50 { return (*fsp); } |
50 | 51 |
51 const boost::shared_ptr <const dolfin::FunctionSpace> & | 52 const SHARED_PTR <const dolfin::FunctionSpace> & |
52 get_pfsp (void) const | 53 get_pfsp (void) const |
53 { return fsp; } | 54 { return fsp; } |
54 | 55 |
55 void | 56 void |
56 set_fsp (dolfin::FunctionSpace & _fsp) | 57 set_fsp (dolfin::FunctionSpace & _fsp) |
57 { | 58 { |
58 dolfin::FunctionSpace * p = new dolfin::FunctionSpace (_fsp); | 59 dolfin::FunctionSpace * p = new dolfin::FunctionSpace (_fsp); |
59 fsp = boost::shared_ptr<const dolfin::FunctionSpace> (p); | 60 fsp = SHARED_PTR <const dolfin::FunctionSpace> (p); |
60 } | 61 } |
61 | 62 |
62 private: | 63 private: |
63 | 64 |
64 boost::shared_ptr <const dolfin::FunctionSpace> fsp; | 65 SHARED_PTR <const dolfin::FunctionSpace> fsp; |
65 | 66 |
66 DECLARE_OCTAVE_ALLOCATOR; | 67 DECLARE_OCTAVE_ALLOCATOR; |
67 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; | 68 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; |
68 | 69 |
69 }; | 70 }; |