Mercurial > fem-fenics-eugenio
comparison inst/import_ufl_BilinearForm.m @ 268:61830a4f9ab9
Improve formatting
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Thu, 14 Aug 2014 12:26:55 +0200 |
parents | 072aee55bb75 |
children | 897e312cb440 |
comparison
equal
deleted
inserted
replaced
267:53039ac90368 | 268:61830a4f9ab9 |
---|---|
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
11 ## details. | 11 ## details. |
12 ## | 12 ## |
13 ## You should have received a copy of the GNU General Public License along with | 13 ## You should have received a copy of the GNU General Public License along with |
14 ## this program; if not, see <http://www.gnu.org/licenses/>. | 14 ## this program; if not, see <http://www.gnu.org/licenses/>. |
15 | |
15 | 16 |
16 ## -*- texinfo -*- | 17 ## -*- texinfo -*- |
17 ## @deftypefn {Function File} {} = import_ufl_BilinearForm (@var{myproblem}) | 18 ## @deftypefn {Function File} {} = import_ufl_BilinearForm (@var{myproblem}) |
18 ## Import a BilinearForm from a ufl file. | 19 ## Import a BilinearForm from a ufl file. |
19 ## | 20 ## |
28 ## @end deftypefn | 29 ## @end deftypefn |
29 | 30 |
30 function import_ufl_BilinearForm (var_prob) | 31 function import_ufl_BilinearForm (var_prob) |
31 | 32 |
32 if (is_master_node ()) | 33 if (is_master_node ()) |
33 if nargin != 1 | 34 if (nargin != 1) |
34 error ("import_ufl_BilinearForm: wrong number of input parameters."); | 35 error ("import_ufl_BilinearForm: wrong number of input parameters."); |
35 elseif ! ischar (var_prob) | 36 elseif (! ischar (var_prob)) |
36 error ("import_ufl_BilinearForm: first argument is not a valid string"); | 37 error ("import_ufl_BilinearForm: first argument is not a valid string"); |
37 endif | 38 endif |
38 | 39 |
39 if (check_hash (var_prob) || ! check_oct_files (var_prob, "BilinearForm")) | 40 if (check_hash (var_prob) || ! check_oct_files (var_prob, "BilinearForm")) |
40 n = length (mfilename ("fullpath")) - length (mfilename()); | 41 n = length (mfilename ("fullpath")) - length (mfilename ()); |
41 path = strtrunc(mfilename ("fullpath"), n); | 42 path = strtrunc (mfilename ("fullpath"), n); |
42 | 43 |
43 private = fullfile (path, "include/"); | 44 private = fullfile (path, "include/"); |
44 output = generate_rhs (var_prob); | 45 output = generate_rhs (var_prob); |
45 output += generate_makefile (var_prob, private); | 46 output += generate_makefile (var_prob, private); |
46 if output != 0 | 47 if (output != 0) |
47 error ("Compilation failed"); | 48 error ("Compilation failed"); |
48 else | 49 else |
49 [output, textfile] = system (sprintf ("make -f Makefile_%s rhs", var_prob)); | 50 [output, textfile] = system (sprintf ("make -f Makefile_%s rhs", var_prob)); |
50 if output != 0 | 51 if (output != 0) |
51 display (text); | 52 display (text); |
52 error ("Compilation failed"); | 53 error ("Compilation failed"); |
53 endif | 54 endif |
54 [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob)); | 55 [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob)); |
55 if output != 0 | 56 if (output != 0) |
56 display (text); | 57 display (text); |
57 error ("Compilation failed"); | 58 error ("Compilation failed"); |
58 endif | 59 endif |
59 save_hash (var_prob); | 60 save_hash (var_prob); |
60 endif | 61 endif |