Mercurial > fem-fenics-eugenio
comparison inst/private/generate_rhs.m @ 268:61830a4f9ab9
Improve formatting
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Thu, 14 Aug 2014 12:26:55 +0200 |
parents | a61fc34334ca |
children |
comparison
equal
deleted
inserted
replaced
267:53039ac90368 | 268:61830a4f9ab9 |
---|---|
15 | 15 |
16 | 16 |
17 ## -*- texinfo -*- | 17 ## -*- texinfo -*- |
18 ## function for internal usage only | 18 ## function for internal usage only |
19 ## @end deftypefn | 19 ## @end deftypefn |
20 | |
20 function output = generate_rhs (ufl_name) | 21 function output = generate_rhs (ufl_name) |
21 | 22 |
22 STRING ="\n\ | 23 STRING ="\n\ |
23 #include ""@@UFL_NAME@@.h""\n\ | 24 #include ""@@UFL_NAME@@.h""\n\ |
24 #include <fem-fenics/form.h>\n\ | 25 #include <fem-fenics/form.h>\n\ |
26 #include <fem-fenics/function.h>\n\ | 27 #include <fem-fenics/function.h>\n\ |
27 #include <fem-fenics/functionspace.h>\n\ | 28 #include <fem-fenics/functionspace.h>\n\ |
28 #include <fem-fenics/meshfunction.h>\n\ | 29 #include <fem-fenics/meshfunction.h>\n\ |
29 #include <fem-fenics/dolfin_compat.h>\n\ | 30 #include <fem-fenics/dolfin_compat.h>\n\ |
30 \n\ | 31 \n\ |
31 DEFUN_DLD (@@UFL_NAME@@_BilinearForm, args, , ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\ | 32 DEFUN_DLD (@@UFL_NAME@@_BilinearForm, args, ,\ |
33 ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\ | |
32 {\n\ | 34 {\n\ |
33 \n\ | 35 \n\ |
34 int nargin = args.length ();\n\ | 36 int nargin = args.length ();\n\ |
35 octave_value retval;\n\ | 37 octave_value retval;\n\ |
36 \n\ | 38 \n\ |
138 }\n\ | 140 }\n\ |
139 }\n\ | 141 }\n\ |
140 return retval;\n\ | 142 return retval;\n\ |
141 }"; | 143 }"; |
142 | 144 |
143 STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name); | 145 STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name); |
144 | 146 |
145 fid = fopen (sprintf ("%s_BilinearForm.cc", ufl_name), 'w'); | 147 fid = fopen (sprintf ("%s_BilinearForm.cc", ufl_name), "w"); |
146 if (fid >= 0) | 148 if (fid >= 0) |
147 fputs (fid, STRING); | 149 fputs (fid, STRING); |
148 output = fclose (fid); | 150 output = fclose (fid); |
149 else | 151 else |
150 error ("cannot open file"); | 152 error ("cannot open file"); |