Mercurial > fem-fenics-eugenio
comparison src/interpolate.cc @ 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 | 958a0e0e8102 |
children | 61830a4f9ab9 |
comparison
equal
deleted
inserted
replaced
252:7f33554e439a | 253:5e9b5bbdc56b |
---|---|
17 | 17 |
18 #include "coefficient.h" | 18 #include "coefficient.h" |
19 #include "function.h" | 19 #include "function.h" |
20 #include "functionspace.h" | 20 #include "functionspace.h" |
21 #include <stdexcept> | 21 #include <stdexcept> |
22 #include "dolfin_compat.h" | |
22 | 23 |
23 DEFUN_DLD (interpolate, args, nargout, "-*- texinfo -*-\n\ | 24 DEFUN_DLD (interpolate, args, nargout, "-*- texinfo -*-\n\ |
24 @deftypefn {Function File} @var{interp} = \ | 25 @deftypefn {Function File} @var{interp} = \ |
25 interpolate (@var{name}, @var{u}, @var{v})\n\ | 26 interpolate (@var{name}, @var{u}, @var{v})\n\ |
26 Interpolate a function on a FunctionSpace.\n\ | 27 Interpolate a function on a FunctionSpace.\n\ |
75 const functionspace & u1 = | 76 const functionspace & u1 = |
76 static_cast<const functionspace&> (args(1+offset).get_rep ()); | 77 static_cast<const functionspace&> (args(1+offset).get_rep ()); |
77 | 78 |
78 if (! error_state) | 79 if (! error_state) |
79 { | 80 { |
80 boost::shared_ptr<dolfin::Function> | 81 SHARED_PTR <dolfin::Function> |
81 output (new dolfin::Function (u1.get_pfsp ())); | 82 output (new dolfin::Function (u1.get_pfsp ())); |
82 | 83 |
83 if (args(0+offset).type_id () == function::static_type_id ()) | 84 if (args(0+offset).type_id () == function::static_type_id ()) |
84 { | 85 { |
85 const function & u0 = | 86 const function & u0 = |
130 const function & u0 = | 131 const function & u0 = |
131 static_cast<const function&> (args(1+offset).get_rep ()); | 132 static_cast<const function&> (args(1+offset).get_rep ()); |
132 | 133 |
133 if (! error_state) | 134 if (! error_state) |
134 { | 135 { |
135 boost::shared_ptr<dolfin::Function> | 136 SHARED_PTR <dolfin::Function> |
136 output (new dolfin::Function (u0.get_fun ())); | 137 output (new dolfin::Function (u0.get_fun ())); |
137 | 138 |
138 if (args(0+offset).type_id () == function::static_type_id ()) | 139 if (args(0+offset).type_id () == function::static_type_id ()) |
139 { | 140 { |
140 const function & u1 = | 141 const function & u1 = |