Mercurial > fem-fenics-eugenio
comparison inst/import_ufl_LinearForm.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_LinearForm (@var{myproblem}) | 18 ## @deftypefn {Function File} {} = import_ufl_LinearForm (@var{myproblem}) |
18 ## Import a LinearForm from a ufl file. | 19 ## Import a LinearForm from a ufl file. |
19 ## | 20 ## |
26 ## @end deftypefn | 27 ## @end deftypefn |
27 | 28 |
28 function import_ufl_LinearForm (var_prob) | 29 function import_ufl_LinearForm (var_prob) |
29 | 30 |
30 if (is_master_node ()) | 31 if (is_master_node ()) |
31 if nargin != 1 | 32 if (nargin != 1) |
32 error ("import_ufl_LinearForm: wrong number of input parameters."); | 33 error ("import_ufl_LinearForm: wrong number of input parameters."); |
33 elseif ! ischar (var_prob) | 34 elseif (! ischar (var_prob)) |
34 error ("import_ufl_LinearForm: first argument is not a valid string"); | 35 error ("import_ufl_LinearForm: first argument is not a valid string"); |
35 endif | 36 endif |
36 | 37 |
37 if (check_hash (var_prob) || ! check_oct_files (var_prob, "LinearForm")) | 38 if (check_hash (var_prob) || ! check_oct_files (var_prob, "LinearForm")) |
38 n = length (mfilename ("fullpath")) - length (mfilename()); | 39 n = length (mfilename ("fullpath")) - length (mfilename ()); |
39 path = strtrunc(mfilename ("fullpath"), n); | 40 path = strtrunc (mfilename ("fullpath"), n); |
40 | 41 |
41 private = fullfile (path, "include/"); | 42 private = fullfile (path, "include/"); |
42 | 43 |
43 output = generate_lhs (var_prob); | 44 output = generate_lhs (var_prob); |
44 output += generate_makefile (var_prob, private); | 45 output += generate_makefile (var_prob, private); |
45 if output != 0 | 46 if (output != 0) |
46 error ("Compilation failed"); | 47 error ("Compilation failed"); |
47 else | 48 else |
48 [output, textfile] = system (sprintf ("make -f Makefile_%s lhs", var_prob)); | 49 [output, textfile] = system (sprintf ("make -f Makefile_%s lhs", var_prob)); |
49 if output != 0 | 50 if (output != 0) |
50 display (text); | 51 display (text); |
51 error ("Compilation failed"); | 52 error ("Compilation failed"); |
52 endif | 53 endif |
53 [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob)); | 54 [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob)); |
54 if output != 0 | 55 if (output != 0) |
55 display (text); | 56 display (text); |
56 error ("Compilation failed"); | 57 error ("Compilation failed"); |
57 endif | 58 endif |
58 save_hash (var_prob); | 59 save_hash (var_prob); |
59 endif | 60 endif |