comparison inst/private/generate_rhs.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 5f22232b9fcc
children a61fc34334ca
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/form.h>\n\ 24 #include <fem-fenics/form.h>\n\
25 #include <fem-fenics/coefficient.h>\n\ 25 #include <fem-fenics/coefficient.h>\n\
26 #include <fem-fenics/function.h>\n\ 26 #include <fem-fenics/function.h>\n\
27 #include <fem-fenics/functionspace.h>\n\ 27 #include <fem-fenics/functionspace.h>\n\
28 #include <fem-fenics/dolfin_compat.h>\n\
28 \n\ 29 \n\
29 DEFUN_DLD (@@UFL_NAME@@_BilinearForm, args, , ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\ 30 DEFUN_DLD (@@UFL_NAME@@_BilinearForm, 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\
84 {\n\ 85 {\n\
85 const coefficient & cf\n\ 86 const coefficient & cf\n\
86 = static_cast <const coefficient&> (args(i).get_rep ());\n\ 87 = static_cast <const coefficient&> (args(i).get_rep ());\n\
87 \n\ 88 \n\
88 std::size_t n = a.coefficient_number (cf.get_str ());\n\ 89 std::size_t n = a.coefficient_number (cf.get_str ());\n\
89 const boost::shared_ptr<const expression> & pexp = cf.get_expr ();\n\ 90 const SHARED_PTR <const expression> & pexp = cf.get_expr ();\n\
90 a.set_coefficient (n, pexp);\n\ 91 a.set_coefficient (n, pexp);\n\
91 ++nc;\n\ 92 ++nc;\n\
92 }\n\ 93 }\n\
93 \n\ 94 \n\
94 if (args(i).type_id () == function::static_type_id ())\n\ 95 if (args(i).type_id () == function::static_type_id ())\n\
95 {\n\ 96 {\n\
96 const function & fun\n\ 97 const function & fun\n\
97 = static_cast <const function&> (args(i).get_rep ());\n\ 98 = static_cast <const function&> (args(i).get_rep ());\n\
98 \n\ 99 \n\
99 std::size_t n = a.coefficient_number (fun.get_str ());\n\ 100 std::size_t n = a.coefficient_number (fun.get_str ());\n\
100 const boost::shared_ptr<const dolfin::Function> & pfun = fun.get_pfun ();\n\ 101 const SHARED_PTR <const dolfin::Function> & pfun = fun.get_pfun ();\n\
101 a.set_coefficient (n, pfun);\n\ 102 a.set_coefficient (n, pfun);\n\
102 ++nc;\n\ 103 ++nc;\n\
103 }\n\ 104 }\n\
104 }\n\ 105 }\n\
105 \n\ 106 \n\