comparison inst/private/generate_fun.m @ 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 22de20d78e27
children 61830a4f9ab9
comparison
equal deleted inserted replaced
252:7f33554e439a 253:5e9b5bbdc56b
23 #include ""@@UFL_NAME@@.h""\n\ 23 #include ""@@UFL_NAME@@.h""\n\
24 #include <fem-fenics/mesh.h>\n\ 24 #include <fem-fenics/mesh.h>\n\
25 #include <fem-fenics/form.h>\n\ 25 #include <fem-fenics/form.h>\n\
26 #include <fem-fenics/coefficient.h>\n\ 26 #include <fem-fenics/coefficient.h>\n\
27 #include <fem-fenics/function.h>\n\ 27 #include <fem-fenics/function.h>\n\
28 #include <fem-fenics/dolfin_compat.h>\n\
28 \n\ 29 \n\
29 DEFUN_DLD (@@UFL_NAME@@_Functional, args, , ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\ 30 DEFUN_DLD (@@UFL_NAME@@_Functional, args, , ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\
30 {\n\ 31 {\n\
31 \n\ 32 \n\
32 int nargin = args.length ();\n\ 33 int nargin = args.length ();\n\
80 {\n\ 81 {\n\
81 const coefficient & cf\n\ 82 const coefficient & cf\n\
82 = static_cast <const coefficient&> (args(i).get_rep ());\n\ 83 = static_cast <const coefficient&> (args(i).get_rep ());\n\
83 \n\ 84 \n\
84 std::size_t n = M.coefficient_number (cf.get_str ());\n\ 85 std::size_t n = M.coefficient_number (cf.get_str ());\n\
85 const boost::shared_ptr<const expression> & pexp = cf.get_expr ();\n\ 86 const SHARED_PTR <const expression> & pexp = cf.get_expr ();\n\
86 M.set_coefficient (n, pexp);\n\ 87 M.set_coefficient (n, pexp);\n\
87 ++nc;\n\ 88 ++nc;\n\
88 }\n\ 89 }\n\
89 \n\ 90 \n\
90 if (args(i).type_id () == function::static_type_id ())\n\ 91 if (args(i).type_id () == function::static_type_id ())\n\
91 {\n\ 92 {\n\
92 const function & fun\n\ 93 const function & fun\n\
93 = static_cast <const function&> (args(i).get_rep ());\n\ 94 = static_cast <const function&> (args(i).get_rep ());\n\
94 \n\ 95 \n\
95 std::size_t n = M.coefficient_number (fun.get_str ());\n\ 96 std::size_t n = M.coefficient_number (fun.get_str ());\n\
96 const boost::shared_ptr<const dolfin::Function> & pfun = fun.get_pfun ();\n\ 97 const SHARED_PTR <const dolfin::Function> & pfun = fun.get_pfun ();\n\
97 M.set_coefficient (n, pfun);\n\ 98 M.set_coefficient (n, pfun);\n\
98 ++nc;\n\ 99 ++nc;\n\
99 }\n\ 100 }\n\
100 }\n\ 101 }\n\
101 \n\ 102 \n\