comparison inst/import_ufl_FunctionSpace.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_FunctionSpace (@var{myproblem}) 18 ## @deftypefn {Function File} {} = import_ufl_FunctionSpace (@var{myproblem})
18 ## Import a FunctionSpace from a ufl file. 19 ## Import a FunctionSpace from a ufl file.
19 ## 20 ##
26 ## @end deftypefn 27 ## @end deftypefn
27 28
28 function import_ufl_FunctionSpace (var_prob) 29 function import_ufl_FunctionSpace (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_FunctionSpace: wrong number of input parameters."); 33 error ("import_ufl_FunctionSpace: wrong number of input parameters.");
33 elseif ! ischar (var_prob) 34 elseif (! ischar (var_prob))
34 error ("import_ufl_FunctionSpace: first argument is not a valid string"); 35 error ("import_ufl_FunctionSpace: first argument is not a valid string");
35 endif 36 endif
36 37
37 if (check_hash (var_prob) || ! check_oct_files (var_prob, "FunctionSpace")) 38 if (check_hash (var_prob) || ! check_oct_files (var_prob, "FunctionSpace"))
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 output = generate_fs (var_prob); 43 output = generate_fs (var_prob);
43 output += generate_makefile (var_prob, private); 44 output += generate_makefile (var_prob, private);
44 if output != 0 45 if (output != 0)
45 error ("Compilation failed"); 46 error ("Compilation failed");
46 else 47 else
47 [output, textfile] = system (sprintf ("make -f Makefile_%s fs", var_prob)); 48 [output, textfile] = system (sprintf ("make -f Makefile_%s fs", var_prob));
48 if output != 0 49 if (output != 0)
49 display (text); 50 display (text);
50 error ("Compilation failed"); 51 error ("Compilation failed");
51 endif 52 endif
52 [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob)); 53 [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob));
53 if output != 0 54 if (output != 0)
54 display (text); 55 display (text);
55 error ("Compilation failed"); 56 error ("Compilation failed");
56 endif 57 endif
57 save_hash (var_prob); 58 save_hash (var_prob);
58 endif 59 endif