comparison src/boundarycondition.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 ab35a8b0deef
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 boundarycondition : public octave_base_value 27 class boundarycondition : public octave_base_value
27 { 28 {
28 29
29 public: 30 public:
42 43
43 bool 44 bool
44 is_defined (void) const 45 is_defined (void) const
45 { return true; } 46 { return true; }
46 47
47 const std::vector< boost::shared_ptr 48 const std::vector< SHARED_PTR
48 <const dolfin::DirichletBC> > & 49 <const dolfin::DirichletBC> > &
49 get_bc (void) const 50 get_bc (void) const
50 { return bcu; } 51 { return bcu; }
51 52
52 void 53 void
53 add_bc (const boost::shared_ptr<const dolfin::FunctionSpace> & V, 54 add_bc (const SHARED_PTR <const dolfin::FunctionSpace> & V,
54 boost::shared_ptr<const dolfin::GenericFunction> f, 55 SHARED_PTR <const dolfin::GenericFunction> f,
55 std::size_t n) 56 std::size_t n)
56 { 57 {
57 boost::shared_ptr<const dolfin::DirichletBC> 58 SHARED_PTR <const dolfin::DirichletBC>
58 p (new dolfin::DirichletBC (V, f, n)); 59 p (new dolfin::DirichletBC (V, f, n));
59 bcu.push_back(p); 60 bcu.push_back(p);
60 } 61 }
61 62
62 private: 63 private:
63 64
64 std::vector<boost::shared_ptr 65 std::vector<SHARED_PTR
65 <const dolfin::DirichletBC> > bcu; 66 <const dolfin::DirichletBC> > bcu;
66 67
67 DECLARE_OCTAVE_ALLOCATOR; 68 DECLARE_OCTAVE_ALLOCATOR;
68 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; 69 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
69 70