comparison src/save.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 66071811eef8
children
comparison
equal deleted inserted replaced
252:7f33554e439a 253:5e9b5bbdc56b
13 13
14 You should have received a copy of the GNU General Public License along with 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/>. 15 this program; if not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 #include "function.h" 17 #include "function.h"
18 #include "dolfin_compat.h"
18 19
19 DEFUN_DLD (save, args, , "-*- texinfo -*-\n\ 20 DEFUN_DLD (save, args, , "-*- texinfo -*-\n\
20 @deftypefn {Function File} \ 21 @deftypefn {Function File} \
21 fem_save (@var{Function}, @var{Name})\n\ 22 fem_save (@var{Function}, @var{Name})\n\
22 Save a function in vtu format.\n\ 23 Save a function in vtu format.\n\
49 static_cast<const function&> (args(0).get_rep ()); 50 static_cast<const function&> (args(0).get_rep ());
50 std::string str = args(1).string_value (); 51 std::string str = args(1).string_value ();
51 52
52 if (!error_state) 53 if (!error_state)
53 { 54 {
54 const boost::shared_ptr<const dolfin::Function> 55 const SHARED_PTR <const dolfin::Function>
55 & u = uo.get_pfun (); 56 & u = uo.get_pfun ();
56 str += ".pvd"; 57 str += ".pvd";
57 dolfin::File file (str); 58 dolfin::File file (str);
58 file << (*u); 59 file << (*u);
59 retval = 0; 60 retval = 0;