changeset 268:61830a4f9ab9

Improve formatting
author Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
date Thu, 14 Aug 2014 12:26:55 +0200
parents 53039ac90368
children 897e312cb440
files inst/import_meshfunction_type.m inst/import_ufl_BilinearForm.m inst/import_ufl_FunctionSpace.m inst/import_ufl_Functional.m inst/import_ufl_LinearForm.m inst/import_ufl_Problem.m inst/linear_algebra_backend.m inst/private/generate_fs.m inst/private/generate_fun.m inst/private/generate_lhs.m inst/private/generate_makefile.m inst/private/generate_mf_constructor.m inst/private/generate_mf_header.m inst/private/generate_rhs.m inst/ufl.m src/DirichletBC.cc src/Function.cc src/Mesh.cc src/MeshFunction.cc src/PETSc_factory.cc src/PETSc_factory.h src/SubDomain.cc src/assemble.cc src/assemble_system.cc src/barrier.cc src/boundarycondition.h src/femfenics_base_factory.h src/femfenics_factory.cc src/femfenics_factory.h src/feval.cc src/function.h src/interpolate.cc src/is_master_node.cc src/mark.cc src/meshfunction.h src/save_func.cc src/save_mesh.cc src/save_mf.cc src/subdomain.h src/subdomain_rep.h src/uBLAS_factory.cc src/uBLAS_factory.h
diffstat 42 files changed, 735 insertions(+), 717 deletions(-) [+]
line wrap: on
line diff
--- a/inst/import_meshfunction_type.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/import_meshfunction_type.m	Thu Aug 14 12:26:55 2014 +0200
@@ -34,8 +34,8 @@
     label = genvarname (strjoin (strsplit (typename), ""));
 
     if (! check_mf_files (typename))
-      n = length (mfilename ("fullpath")) - length (mfilename());
-      path = strtrunc(mfilename ("fullpath"), n);
+      n = length (mfilename ("fullpath")) - length (mfilename ());
+      path = strtrunc (mfilename ("fullpath"), n);
 
       private = fullfile (path, "include/");
       output = generate_mf_header (typename, label);
--- a/inst/import_ufl_BilinearForm.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/import_ufl_BilinearForm.m	Thu Aug 14 12:26:55 2014 +0200
@@ -13,6 +13,7 @@
 ## You should have received a copy of the GNU General Public License along with
 ## this program; if not, see <http://www.gnu.org/licenses/>.
 
+
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} = import_ufl_BilinearForm (@var{myproblem})
 ## Import a BilinearForm from a ufl file.
@@ -30,29 +31,29 @@
 function import_ufl_BilinearForm (var_prob)
 
   if (is_master_node ())
-    if nargin != 1
+    if (nargin != 1)
       error ("import_ufl_BilinearForm: wrong number of input parameters.");
-    elseif ! ischar (var_prob)
+    elseif (! ischar (var_prob))
       error ("import_ufl_BilinearForm: first argument is not a valid string");
     endif
 
     if (check_hash (var_prob) || ! check_oct_files (var_prob, "BilinearForm"))
-      n = length (mfilename ("fullpath")) - length (mfilename());
-      path = strtrunc(mfilename ("fullpath"), n);
+      n = length (mfilename ("fullpath")) - length (mfilename ());
+      path = strtrunc (mfilename ("fullpath"), n);
 
       private = fullfile (path, "include/");
       output = generate_rhs (var_prob);
       output += generate_makefile (var_prob, private);
-      if output != 0
+      if (output != 0)
         error ("Compilation failed");
       else
         [output, textfile] = system (sprintf ("make -f Makefile_%s rhs", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
         [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
--- a/inst/import_ufl_FunctionSpace.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/import_ufl_FunctionSpace.m	Thu Aug 14 12:26:55 2014 +0200
@@ -13,6 +13,7 @@
 ## You should have received a copy of the GNU General Public License along with
 ## this program; if not, see <http://www.gnu.org/licenses/>.
 
+
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} = import_ufl_FunctionSpace (@var{myproblem})
 ## Import a FunctionSpace from a ufl file.
@@ -28,29 +29,29 @@
 function import_ufl_FunctionSpace (var_prob)
 
   if (is_master_node ())
-    if nargin != 1
+    if (nargin != 1)
       error ("import_ufl_FunctionSpace: wrong number of input parameters.");
-    elseif ! ischar (var_prob)
+    elseif (! ischar (var_prob))
       error ("import_ufl_FunctionSpace: first argument is not a valid string");
     endif
 
     if (check_hash (var_prob) || ! check_oct_files (var_prob, "FunctionSpace"))
-      n = length (mfilename ("fullpath")) - length (mfilename());
-      path = strtrunc(mfilename ("fullpath"), n);
+      n = length (mfilename ("fullpath")) - length (mfilename ());
+      path = strtrunc (mfilename ("fullpath"), n);
 
       private = fullfile (path, "include/");
       output = generate_fs (var_prob);
       output += generate_makefile (var_prob, private);
-      if output != 0
+      if (output != 0)
         error ("Compilation failed");
       else
         [output, textfile] = system (sprintf ("make -f Makefile_%s fs", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
         [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
--- a/inst/import_ufl_Functional.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/import_ufl_Functional.m	Thu Aug 14 12:26:55 2014 +0200
@@ -13,6 +13,7 @@
 ## You should have received a copy of the GNU General Public License along with
 ## this program; if not, see <http://www.gnu.org/licenses/>.
 
+
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} = import_ufl_Functional (@var{myproblem})
 ## Import a Functional from a ufl file.
@@ -24,32 +25,33 @@
 ## @seealso{import_ufl_Problem, FunctionSpace, BilinearForm, LinearForm,
 ## Functional} 
 ## @end deftypefn
+
 function import_ufl_Functional (var_prob)
 
   if (is_master_node ())
-    if nargin != 1
+    if (nargin != 1)
       error ("import_ufl_Functional: wrong number of input parameters.");
-    elseif ! ischar (var_prob)
+    elseif (! ischar (var_prob))
       error ("import_ufl_Functional: first argument is not a valid string");
     endif
 
     if (check_hash (var_prob) || ! check_oct_files (var_prob, "Functional"))
-      n = length (mfilename ("fullpath")) - length (mfilename());
-      path = strtrunc(mfilename ("fullpath"), n);
+      n = length (mfilename ("fullpath")) - length (mfilename ());
+      path = strtrunc (mfilename ("fullpath"), n);
 
       private = fullfile (path, "include/");
       output = generate_fun (var_prob);
       output += generate_makefile (var_prob, private);
-      if output != 0
+      if (output != 0)
         error ("Compilation failed");
       else
         [output, textfile] = system (sprintf ("make -f Makefile_%s fun", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
         [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
--- a/inst/import_ufl_LinearForm.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/import_ufl_LinearForm.m	Thu Aug 14 12:26:55 2014 +0200
@@ -13,6 +13,7 @@
 ## You should have received a copy of the GNU General Public License along with
 ## this program; if not, see <http://www.gnu.org/licenses/>.
 
+
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} = import_ufl_LinearForm (@var{myproblem})
 ## Import a LinearForm from a ufl file.
@@ -28,30 +29,30 @@
 function import_ufl_LinearForm (var_prob)
 
   if (is_master_node ())
-    if nargin != 1
+    if (nargin != 1)
       error ("import_ufl_LinearForm: wrong number of input parameters.");
-    elseif ! ischar (var_prob)
+    elseif (! ischar (var_prob))
       error ("import_ufl_LinearForm: first argument is not a valid string");
     endif
 
     if (check_hash (var_prob) || ! check_oct_files (var_prob, "LinearForm"))
-      n = length (mfilename ("fullpath")) - length (mfilename());
-      path = strtrunc(mfilename ("fullpath"), n);
+      n = length (mfilename ("fullpath")) - length (mfilename ());
+      path = strtrunc (mfilename ("fullpath"), n);
 
       private = fullfile (path, "include/");
 
       output = generate_lhs (var_prob);
       output += generate_makefile (var_prob, private);
-      if output != 0
+      if (output != 0)
         error ("Compilation failed");
       else
         [output, textfile] = system (sprintf ("make -f Makefile_%s lhs", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
         [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
--- a/inst/import_ufl_Problem.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/import_ufl_Problem.m	Thu Aug 14 12:26:55 2014 +0200
@@ -13,6 +13,7 @@
 ## You should have received a copy of the GNU General Public License along with
 ## this program; if not, see <http://www.gnu.org/licenses/>.
 
+
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} = import_ufl_Problem (@var{myproblem})
 ## Import a Variational Problem from a ufl file.
@@ -27,31 +28,31 @@
 function import_ufl_Problem (var_prob)
 
   if (is_master_node ())
-    if nargin != 1
+    if (nargin != 1)
       error ("import_ufl_Problem: wrong number of input parameters.");
-    elseif ! ischar (var_prob)
+    elseif (! ischar (var_prob))
       error ("import_ufl_Problem: first argument is not a valid string");
     endif
 
     if (check_hash (var_prob) || ! check_oct_files (var_prob, "Problem"))
-      n = length (mfilename ("fullpath")) - length (mfilename());
-      path = strtrunc(mfilename ("fullpath"), n);
+      n = length (mfilename ("fullpath")) - length (mfilename ());
+      path = strtrunc (mfilename ("fullpath"), n);
 
       private = fullfile (path, "include/");
       output = generate_fs (var_prob);
       output += generate_rhs (var_prob);
       output += generate_lhs (var_prob);
       output += generate_makefile (var_prob, private);
-      if output != 0
+      if (output != 0)
         error ("Compilation failed");
       else
         [output, textfile] = system (sprintf ("make -f Makefile_%s all", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
         [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob));
-        if output != 0
+        if (output != 0)
           display (text);
           error ("Compilation failed");
         endif
--- a/inst/linear_algebra_backend.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/linear_algebra_backend.m	Thu Aug 14 12:26:55 2014 +0200
@@ -13,6 +13,7 @@
 ## You should have received a copy of the GNU General Public License along with
 ## this program; if not, see <http://www.gnu.org/licenses/>.
 
+
 ## -*- texinfo -*-
 ## @deftypefn {Function File} @var{val} = linear_algebra_backend ()
 ## @deftypefnx {Function File} @var{old_val} = linear_algebra_backend (@var{new_val})
--- a/inst/private/generate_fs.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/private/generate_fs.m	Thu Aug 14 12:26:55 2014 +0200
@@ -17,6 +17,7 @@
 ## -*- texinfo -*-
 ## function for internal usage only
 ## @end deftypefn
+
 function output = generate_fs (ufl_name)
 
 STRING ="\n\
@@ -25,7 +26,8 @@
 #include ""@@UFL_NAME@@.h""\n\
 #include <fem-fenics/dolfin_compat.h>\n\
 \n\
-DEFUN_DLD (@@UFL_NAME@@_FunctionSpace, args, , ""initialize a fs from a mesh declared with fem_init_mesh"")\n\
+DEFUN_DLD (@@UFL_NAME@@_FunctionSpace, args, ,\
+           ""initialize a fs from a mesh declared with fem_init_mesh"")\n\
 {\n\
   int nargin = args.length ();\n\
   octave_value retval;\n\
@@ -46,7 +48,8 @@
         {\n\
           const mesh & msho = static_cast<const mesh&> (args(0).get_rep ());\n\
           const dolfin::Mesh & mshd = msho.get_msh ();\n\
-          SHARED_PTR <const dolfin::FunctionSpace> g (new @@UFL_NAME@@::FunctionSpace (mshd));\n\
+          SHARED_PTR <const dolfin::FunctionSpace>\
+            g (new @@UFL_NAME@@::FunctionSpace (mshd));\n\
 \n\
           if (! functionspace_type_loaded)\n\
             {\n\
@@ -61,9 +64,9 @@
   return retval;\n\
 }";
 
-STRING =  strrep (STRING, "@@UFL_NAME@@", ufl_name);
+STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name);
 
-fid = fopen (sprintf ("%s_FunctionSpace.cc", ufl_name), 'w');
+fid = fopen (sprintf ("%s_FunctionSpace.cc", ufl_name), "w");
 if (fid >= 0)
   fputs (fid, STRING);
   output = fclose (fid);
--- a/inst/private/generate_fun.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/private/generate_fun.m	Thu Aug 14 12:26:55 2014 +0200
@@ -17,6 +17,7 @@
 ## -*- texinfo -*-
 ## function for internal usage only
 ## @end deftypefn
+
 function output = generate_fun (ufl_name)
 
 STRING ="\n\
@@ -27,7 +28,8 @@
 #include <fem-fenics/function.h>\n\
 #include <fem-fenics/dolfin_compat.h>\n\
 \n\
-DEFUN_DLD (@@UFL_NAME@@_Functional, args, , ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\
+DEFUN_DLD (@@UFL_NAME@@_Functional, args, ,\
+           ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\
 {\n\
 \n\
   int nargin = args.length ();\n\
@@ -94,7 +96,8 @@
                         = static_cast <const function&> (args(i).get_rep ());\n\
 \n\
                       std::size_t n = M.coefficient_number (fun.get_str ());\n\
-                      const SHARED_PTR <const dolfin::Function> & pfun = fun.get_pfun ();\n\
+                      const SHARED_PTR <const dolfin::Function> & pfun =\
+                        fun.get_pfun ();\n\
                       M.set_coefficient (n, pfun);\n\
                       ++nc;\n\
                     }\n\
@@ -112,9 +115,9 @@
   return retval;\n\
 }";
 
-STRING =  strrep (STRING, "@@UFL_NAME@@", ufl_name);
+STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name);
 
-fid = fopen (sprintf ("%s_Functional.cc", ufl_name), 'w');
+fid = fopen (sprintf ("%s_Functional.cc", ufl_name), "w");
 if (fid >= 0)
   fputs (fid, STRING);
   output = fclose (fid);
--- a/inst/private/generate_lhs.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/private/generate_lhs.m	Thu Aug 14 12:26:55 2014 +0200
@@ -17,6 +17,7 @@
 ## -*- texinfo -*-
 ## function for internal usage only
 ## @end deftypefn
+
 function output = generate_lhs (ufl_name)
 
 STRING ="\n\
@@ -28,7 +29,8 @@
 #include <fem-fenics/meshfunction.h>\n\
 #include <fem-fenics/dolfin_compat.h>\n\
 \n\
-DEFUN_DLD (@@UFL_NAME@@_LinearForm, args, , "" b = fem_lhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\
+DEFUN_DLD (@@UFL_NAME@@_LinearForm, args, ,\
+           "" b = fem_lhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\
 {\n\
   int nargin = args.length ();\n\
   octave_value retval;\n\
@@ -102,15 +104,16 @@
                         = static_cast <const function&> (args(i).get_rep ());\n\
 \n\
                       std::size_t n = L.coefficient_number (fun.get_str ());\n\
-                      const SHARED_PTR <const dolfin::Function> & pfun = fun.get_pfun ();\n\
+                      const SHARED_PTR <const dolfin::Function> & pfun =\
+                        fun.get_pfun ();\n\
                       L.set_coefficient (n, pfun);\n\
                       ++nc;\n\
                     }\n\
 \n\
                   if (args(i).type_id () == meshfunction::static_type_id ())\n\
                     {\n\
-                      meshfunction const & mf_arg\n\
-                        = static_cast <meshfunction const &> (args(i).get_rep ());\n\
+                      meshfunction const & mf_arg =\n\
+                        static_cast <meshfunction const &> (args(i).get_rep ());\n\
 \n\
                       std::string type = mf_arg.get_str ();\n\
                       dolfin::MeshFunction <std::size_t> const &\n\
@@ -136,9 +139,9 @@
   return retval;\n\
 }";
 
-STRING =  strrep (STRING, "@@UFL_NAME@@", ufl_name);
+STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name);
 
-fid = fopen (sprintf ("%s_LinearForm.cc", ufl_name), 'w');
+fid = fopen (sprintf ("%s_LinearForm.cc", ufl_name), "w");
 if (fid >= 0)
   fputs (fid, STRING);
   output = fclose (fid);
--- a/inst/private/generate_makefile.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/private/generate_makefile.m	Thu Aug 14 12:26:55 2014 +0200
@@ -17,6 +17,7 @@
 ## -*- texinfo -*-
 ## function for internal usage only
 ## @end deftypefn
+
 function output = generate_makefile (ufl_name, path)
 
 STRING ="\n\
@@ -52,19 +53,19 @@
 .PHONY: clean\n\
 \n\
 clean:\n\
-	 rm -f @@UFL_NAME@@_FunctionSpace.o @@UFL_NAME@@_FunctionSpace.cc @@UFL_NAME@@.h\n\
-	 rm -f @@UFL_NAME@@_BilinearForm.o @@UFL_NAME@@_BilinearForm.cc\n\
-	 rm -f @@UFL_NAME@@_LinearForm.o @@UFL_NAME@@_LinearForm.cc\n\
-	 rm -f @@UFL_NAME@@_Functional.o @@UFL_NAME@@_Functional.cc\n\
-	 rm -f Makefile_@@UFL_NAME@@\n\
+	$(RM) @@UFL_NAME@@_FunctionSpace.o @@UFL_NAME@@_FunctionSpace.cc @@UFL_NAME@@.h\n\
+	$(RM) @@UFL_NAME@@_BilinearForm.o @@UFL_NAME@@_BilinearForm.cc\n\
+	$(RM) @@UFL_NAME@@_LinearForm.o @@UFL_NAME@@_LinearForm.cc\n\
+	$(RM) @@UFL_NAME@@_Functional.o @@UFL_NAME@@_Functional.cc\n\
+	$(RM) Makefile_@@UFL_NAME@@\n\
 ";
 
-STRING =  strrep (STRING, "@@UFL_NAME@@", ufl_name);
-STRING =  strrep (STRING, "@@PATH@@", path);
+STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name);
+STRING = strrep (STRING, "@@PATH@@", path);
 STRING = strrep (STRING, "@@FF_CPPFLAGS@@", get_vars ("CPPFLAGS"));
 STRING = strrep (STRING, "@@FF_LIBS@@", get_vars ("LIBS"));
 
-fid = fopen (sprintf ("Makefile_%s", ufl_name), 'w');
+fid = fopen (sprintf ("Makefile_%s", ufl_name), "w");
 if (fid >= 0)
   fputs (fid, STRING);
   output = fclose (fid);
--- a/inst/private/generate_mf_constructor.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/private/generate_mf_constructor.m	Thu Aug 14 12:26:55 2014 +0200
@@ -26,7 +26,8 @@
 #include ""meshfunction_@@LABEL@@.h""\n\
 #include <fem-fenics/dolfin_compat.h>\n\
 \n\
-DEFUN_DLD (MeshFunction_@@LABEL@@, args, nargout, ""MF = MeshFunction_@@LABEL@@ (TYPE, MESH, FILENAME)"")\n\
+DEFUN_DLD (MeshFunction_@@LABEL@@, args, nargout,\
+           ""MF = MeshFunction_@@LABEL@@ (TYPE, MESH, FILENAME)"")\n\
 {\n\
 \n\
   int nargin = args.length ();\n\
--- a/inst/private/generate_mf_header.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/private/generate_mf_header.m	Thu Aug 14 12:26:55 2014 +0200
@@ -30,7 +30,7 @@
 \n\
 class meshfunction_@@LABEL@@ : public octave_base_value\n\
 {\n\
-  public:\n\
+public:\n\
 \n\
   meshfunction_@@LABEL@@ (void)\n\
     : octave_base_value () {}\n\
@@ -39,28 +39,28 @@
     : octave_base_value (), pmf (new dolfin::MeshFunction <@@TYPENAME@@ > (_mf)) {}\n\
 \n\
   meshfunction_@@LABEL@@ (SHARED_PTR <dolfin::Mesh const> mesh,\n\
-                             std::string const & filename)\n\
+                          std::string const & filename)\n\
     : octave_base_value (),\n\
       pmf (new dolfin::MeshFunction <@@TYPENAME@@ > (mesh, filename)) {}\n\
 \n\
   bool\n\
   is_defined (void) const\n\
-    { return true; }\n\
+  { return true; }\n\
 \n\
   void\n\
   print (std::ostream& os, bool pr_as_read_syntax = false) const\n\
-    { os << ""MeshFunction <@@TYPENAME@@ >: ""\n\
-         << get_pmf ()->str (@@VERBOSE@@) << std::endl; }\n\
+  { os << ""MeshFunction <@@TYPENAME@@ >: ""\n\
+       << get_pmf ()->str (@@VERBOSE@@) << std::endl; }\n\
 \n\
   dolfin::MeshFunction <@@TYPENAME@@ > const &\n\
   get_mf (void) const\n\
-    { return *pmf; }\n\
+  { return *pmf; }\n\
 \n\
   SHARED_PTR <dolfin::MeshFunction <@@TYPENAME@@ > const> const &\n\
   get_pmf (void) const\n\
-    { return pmf; }\n\
+  { return pmf; }\n\
 \n\
-  private:\n\
+private:\n\
 \n\
   SHARED_PTR <dolfin::MeshFunction <@@TYPENAME@@ > const> pmf;\n\
 \n\
--- a/inst/private/generate_rhs.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/private/generate_rhs.m	Thu Aug 14 12:26:55 2014 +0200
@@ -17,6 +17,7 @@
 ## -*- texinfo -*-
 ## function for internal usage only
 ## @end deftypefn
+
 function output = generate_rhs (ufl_name)
 
 STRING ="\n\
@@ -28,7 +29,8 @@
 #include <fem-fenics/meshfunction.h>\n\
 #include <fem-fenics/dolfin_compat.h>\n\
 \n\
-DEFUN_DLD (@@UFL_NAME@@_BilinearForm, args, , ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\
+DEFUN_DLD (@@UFL_NAME@@_BilinearForm, args, ,\
+           ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\
 {\n\
 \n\
   int nargin = args.length ();\n\
@@ -140,9 +142,9 @@
   return retval;\n\
 }";
 
-STRING =  strrep (STRING, "@@UFL_NAME@@", ufl_name);
+STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name);
 
-fid = fopen (sprintf ("%s_BilinearForm.cc", ufl_name), 'w');
+fid = fopen (sprintf ("%s_BilinearForm.cc", ufl_name), "w");
 if (fid >= 0)
   fputs (fid, STRING);
   output = fclose (fid);
--- a/inst/ufl.m	Tue Aug 12 15:42:50 2014 +0200
+++ b/inst/ufl.m	Thu Aug 14 12:26:55 2014 +0200
@@ -13,6 +13,7 @@
 ## You should have received a copy of the GNU General Public License along with
 ## this program; if not, see <http://www.gnu.org/licenses/>.
 
+
 ## -*- texinfo -*-
 ## @deftypefn {Function File} ufl [command] line
 ##
--- a/src/DirichletBC.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/DirichletBC.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -48,7 +48,7 @@
   octave_value retval;
 
   if (nargin < 3 || nargin > 4)
-    print_usage ();
+    { print_usage (); }
   else
     {
 
@@ -75,8 +75,8 @@
 
       if (args(0).type_id () == functionspace::static_type_id ())
         {
-          const functionspace & fspo = 
-            static_cast<const functionspace&> (args(0).get_rep ());
+          const functionspace & fspo =
+            static_cast<const functionspace &> (args(0).get_rep ());
           octave_fcn_handle * fh = args(1).fcn_handle_value ();
 
           if (nargin == 3)
@@ -95,16 +95,16 @@
 
                   expression * pf;
                   if (l > 1)
-                    pf = new expression (*fh, l);
+                    { pf = new expression (*fh, l); }
                   else
-                    pf = new expression (*fh);
+                    { pf = new expression (*fh); }
 
                   SHARED_PTR <const expression> f (pf);
                   boundarycondition * pbc = new boundarycondition ();
 
                   for (octave_idx_type i = 0;
                        i < side.length (); ++i)
-                      pbc->add_bc (V, f, side(i));
+                    { pbc->add_bc (V, f, side(i)); }
                   retval = octave_value (pbc);
                 }
             }
@@ -126,9 +126,9 @@
 
                   expression * pf;
                   if (l > 1)
-                    pf = new expression (*fh, l);
+                    { pf = new expression (*fh, l); }
                   else
-                    pf = new expression (*fh);
+                    { pf = new expression (*fh); }
 
                   SHARED_PTR <const expression> f (pf);
                   boundarycondition * pbc = new boundarycondition ();
@@ -138,7 +138,7 @@
 
                   for (octave_idx_type i = 0;
                        i < side.length (); ++i)
-                      pbc->add_bc (V, f, subdomains, side(i));
+                    { pbc->add_bc (V, f, subdomains, side (i)); }
                   retval = octave_value (pbc);
                 }
             }
--- a/src/Function.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/Function.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -25,7 +25,7 @@
 #include <boost/serialization/utility.hpp>
 #endif
 
-void copy_vector (Array <double> const&, SHARED_PTR <dolfin::GenericVector>);
+void copy_vector (Array <double> const &, SHARED_PTR <dolfin::GenericVector>);
 
 DEFUN_DLD (Function, args, , "-*- texinfo -*-\n\
 @deftypefn {Function File} {[@var{func}]} = \
@@ -61,9 +61,9 @@
 
   int nargin = args.length ();
   octave_value retval;
-  
+
   if (nargin < 3 || nargin > 3)
-    print_usage ();
+    { print_usage (); }
   else
     {
       if (! functionspace_type_loaded)
@@ -84,7 +84,7 @@
         {
           std::string str = args(0).string_value ();
           const functionspace & fspo =
-            static_cast<const functionspace&> (args(1).get_rep ());
+            static_cast<const functionspace &> (args(1).get_rep ());
           Array <double> myu = args(2).array_value ();
 
           if (!error_state)
@@ -93,8 +93,10 @@
                 & V = fspo.get_pfsp ();
 
               if (V->dim () != myu.length ())
-                error("The size of the functional space \
-                       and of the vector must agree");
+                {
+                  error ("The size of the functional space \
+                         and of the vector must agree");
+                }
               else
                 {
                   dolfin::Function aux (V);
@@ -103,14 +105,14 @@
                   SHARED_PTR <dolfin::Function const>
                     u (new dolfin::Function (aux));
                   retval = new function (str, u);
-               }
+                }
             }
         }
       else if (args(1).type_id () == function::static_type_id ())
         {
           std::string str = args(0).string_value ();
           const function & fspo =
-            static_cast<const function&> (args(1).get_rep ());
+            static_cast<const function &> (args(1).get_rep ());
           int idx = args(2).int_value ();
 
           if (!error_state)
@@ -124,14 +126,14 @@
               else
                 {
                   if (idx < 1 || idx > f->value_dimension (0))
-                    error ("Function: index out of bounds");
-                 else
-                   {
+                    { error ("Function: index out of bounds"); }
+                  else
+                    {
                       SHARED_PTR <const dolfin::Function>
-                        u (new dolfin::Function((*f)[idx - 1]));
+                        u (new dolfin::Function ((*f)[idx - 1]));
 
                       retval = new function (str, u);
-                   }
+                    }
                 }
             }
         }
@@ -140,7 +142,7 @@
 }
 
 void
-copy_vector (Array <double> const& arr, SHARED_PTR <dolfin::GenericVector> vec)
+copy_vector (Array <double> const & arr, SHARED_PTR <dolfin::GenericVector> vec)
 {
   unsigned const size =
 #ifdef LATEST_DOLFIN
@@ -160,7 +162,7 @@
 
       for (unsigned p = 1; p < size; ++p)
         if (rank == p)
-          world.send (0, p, loc_range);
+          { world.send (0, p, loc_range); }
 
       if (rank == 0)
         {
@@ -168,32 +170,32 @@
             {
               std::pair <std::size_t, std::size_t> range;
               if (p == 0)
-                range = loc_range;
+                { range = loc_range; }
               else
-                world.recv (p, p, range);
+                { world.recv (p, p, range); }
 
               std::vector <double> entries;
               for (std::size_t i = range.first; i < range.second; ++i)
-                entries.push_back (arr(i));
+                { entries.push_back (arr(i)); }
 
               if (p == 0)
-                locvals = entries;
+                { locvals = entries; }
               else
-                world.send (p, p, entries);
+                { world.send (p, p, entries); }
             }
         }
 
       for (unsigned p = 1; p < size; ++p)
         {
           if (rank == p)
-            world.recv (0, p, locvals);
+            { world.recv (0, p, locvals); }
         }
 
       vec->set_local (locvals);
     }
   else
     for (std::size_t i = 0; i < arr.length (); ++i)
-      vec->setitem (i, arr(i));
+      { vec->setitem (i, arr (i)); }
 
   vec->apply ("insert");
 
--- a/src/Mesh.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/Mesh.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -29,7 +29,7 @@
 compute_cell_markers (dolfin::Mesh const &, Array <octave_idx_type> const &,
                       std::size_t const);
 
-DEFUN_DLD (Mesh, args, nargout,"-*- texinfo -*-\n\
+DEFUN_DLD (Mesh, args, nargout, "-*- texinfo -*-\n\
 @deftypefn {Function File} {[@var{mesh_out}, \
 @var{facet_markers}, @var{cell_markers}]} = \
 Mesh (@var{mesh_in}) \n\
@@ -55,7 +55,7 @@
   octave_value_list retval;
 
   if (nargin < 1 || nargin > 1 || nargout > 3)
-    print_usage ();
+    { print_usage (); }
   else
     {
       if (!error_state)
@@ -102,26 +102,26 @@
 
                       retval(1) = compute_facet_markers (msh, e, D);
                       if (nargout == 3)
-                        retval(2) = compute_cell_markers (msh, t, D);
+                        { retval(2) = compute_cell_markers (msh, t, D); }
                     }
                 }
             }
 
           else
-             error ("Mesh: the argument you provide is invalid");
+            { error ("Mesh: the argument you provide is invalid"); }
 
         }
     }
   return retval;
 }
 
-mesh::mesh (Array<double>& p,
-            Array<octave_idx_type>& e,
-            Array<octave_idx_type>& t)
+mesh::mesh (Array<double> & p,
+            Array<octave_idx_type> & e,
+            Array<octave_idx_type> & t)
 {
   std::size_t D = p.rows ();
   if (D < 2 || D > 3)
-    error ("Mesh constructor: only 2D or 3D meshes are supported");
+    { error ("Mesh constructor: only 2D or 3D meshes are supported"); }
   else
     {
       dolfin::MeshEditor editor;
@@ -164,7 +164,7 @@
 
       // store information associated with e
       msh->init (D - 1);
-      dolfin::MeshValueCollection<std::size_t> facet(*msh, D - 1);
+      dolfin::MeshValueCollection<std::size_t> facet (*msh, D - 1);
       std::size_t num_side_edges = e.cols ();
 
       unsigned const size =
@@ -223,7 +223,7 @@
                           && (*f).entities(0)[1] == e.xelem (1, i) - 1
                           && (*f).entities(0)[2] == e.xelem (0, i) - 1)
                         {
-                          std::pair <std::size_t, std::size_t> 
+                          std::pair <std::size_t, std::size_t>
                             idxvl ((*f).index (), e.xelem (9, i));
                           msh->domains ().set_marker (idxvl, D - 1);
                           break;
@@ -400,14 +400,14 @@
                        Array <octave_idx_type> const & e,
                        std::size_t const D)
 {
-  dolfin::MeshFunction <std::size_t> facet (_msh, D-1,
+  dolfin::MeshFunction <std::size_t> facet (_msh, D - 1,
                                             std::numeric_limits <std::size_t>
                                             ::max ());
   std::size_t const num_side_edges = e.cols ();
   std::vector <std::size_t> const & global_vertices =
     _msh.topology ().global_indices (0);
   std::vector <std::size_t> const & global_facets =
-    _msh.topology ().global_indices (D-1);
+    _msh.topology ().global_indices (D - 1);
 
   if (D == 2)
     {
@@ -417,7 +417,7 @@
           std::size_t const e_index = e.xelem (0, i) - 1;
           while (local_vertex < global_vertices.size () &&
                  e_index != global_vertices[local_vertex])
-            ++local_vertex;
+            { ++local_vertex; }
 
           if (local_vertex < global_vertices.size ())
             {
@@ -450,7 +450,7 @@
           std::size_t const e_index = e.xelem (0, i) - 1;
           while (local_vertex < global_vertices.size () &&
                  e_index != global_vertices[local_vertex])
-            ++local_vertex;
+            { ++local_vertex; }
 
           if (local_vertex < global_vertices.size ())
             {
@@ -464,7 +464,7 @@
                   std::size_t const & vertex2 =
                     global_vertices[f->entities(0)[2]];
 
-                  if (vertex0 == e(0, i) - 1
+                  if (vertex0 == e.xelem (0, i) - 1
                       && vertex1 == e.xelem (1, i) - 1
                       && vertex2 == e.xelem (2, i) - 1
                       || vertex0 == e.xelem (0, i) - 1
@@ -517,7 +517,7 @@
           std::size_t const t_index = t.xelem (0, i) - 1;
           while (local_vertex < global_vertices.size () &&
                  t_index != global_vertices[local_vertex])
-            ++local_vertex;
+            { ++local_vertex; }
 
           if (local_vertex < global_vertices.size ())
             {
@@ -566,7 +566,7 @@
           std::size_t const t_index = t.xelem (0, i) - 1;
           while (local_vertex < global_vertices.size () &&
                  t_index != global_vertices[local_vertex])
-            ++local_vertex;
+            { ++local_vertex; }
 
           if (local_vertex < global_vertices.size ())
             {
@@ -583,104 +583,104 @@
                     global_vertices[f->entities(0)[3]];
 
                   if (vertex0 == t.xelem (0, i) - 1
-                       && vertex1 == t.xelem (1, i) - 1
-                       && vertex2 == t.xelem (2, i) - 1
-                       && vertex3 == t.xelem (3, i) - 1
-                       || vertex0 == t.xelem (0, i) - 1
-                       && vertex1 == t.xelem (1, i) - 1
-                       && vertex2 == t.xelem (3, i) - 1
-                       && vertex3 == t.xelem (2, i) - 1
-                       || vertex0 == t.xelem (0, i) - 1
-                       && vertex1 == t.xelem (2, i) - 1
-                       && vertex2 == t.xelem (1, i) - 1
-                       && vertex3 == t.xelem (3, i) - 1
-                       || vertex0 == t.xelem (0, i) - 1
-                       && vertex1 == t.xelem (2, i) - 1
-                       && vertex2 == t.xelem (3, i) - 1
-                       && vertex3 == t.xelem (1, i) - 1
-                       || vertex0 == t.xelem (0, i) - 1
-                       && vertex1 == t.xelem (3, i) - 1
-                       && vertex2 == t.xelem (1, i) - 1
-                       && vertex3 == t.xelem (2, i) - 1
-                       || vertex0 == t.xelem (0, i) - 1
-                       && vertex1 == t.xelem (3, i) - 1
-                       && vertex2 == t.xelem (2, i) - 1
-                       && vertex3 == t.xelem (1, i) - 1
+                      && vertex1 == t.xelem (1, i) - 1
+                      && vertex2 == t.xelem (2, i) - 1
+                      && vertex3 == t.xelem (3, i) - 1
+                      || vertex0 == t.xelem (0, i) - 1
+                      && vertex1 == t.xelem (1, i) - 1
+                      && vertex2 == t.xelem (3, i) - 1
+                      && vertex3 == t.xelem (2, i) - 1
+                      || vertex0 == t.xelem (0, i) - 1
+                      && vertex1 == t.xelem (2, i) - 1
+                      && vertex2 == t.xelem (1, i) - 1
+                      && vertex3 == t.xelem (3, i) - 1
+                      || vertex0 == t.xelem (0, i) - 1
+                      && vertex1 == t.xelem (2, i) - 1
+                      && vertex2 == t.xelem (3, i) - 1
+                      && vertex3 == t.xelem (1, i) - 1
+                      || vertex0 == t.xelem (0, i) - 1
+                      && vertex1 == t.xelem (3, i) - 1
+                      && vertex2 == t.xelem (1, i) - 1
+                      && vertex3 == t.xelem (2, i) - 1
+                      || vertex0 == t.xelem (0, i) - 1
+                      && vertex1 == t.xelem (3, i) - 1
+                      && vertex2 == t.xelem (2, i) - 1
+                      && vertex3 == t.xelem (1, i) - 1
 
-                       || vertex0 == t.xelem (1, i) - 1
-                       && vertex1 == t.xelem (0, i) - 1
-                       && vertex2 == t.xelem (2, i) - 1
-                       && vertex3 == t.xelem (3, i) - 1
-                       || vertex0 == t.xelem (1, i) - 1
-                       && vertex1 == t.xelem (0, i) - 1
-                       && vertex2 == t.xelem (3, i) - 1
-                       && vertex3 == t.xelem (2, i) - 1
-                       || vertex0 == t.xelem (1, i) - 1
-                       && vertex1 == t.xelem (2, i) - 1
-                       && vertex2 == t.xelem (0, i) - 1
-                       && vertex3 == t.xelem (3, i) - 1
-                       || vertex0 == t.xelem (1, i) - 1
-                       && vertex1 == t.xelem (2, i) - 1
-                       && vertex2 == t.xelem (3, i) - 1
-                       && vertex3 == t.xelem (0, i) - 1
-                       || vertex0 == t.xelem (1, i) - 1
-                       && vertex1 == t.xelem (3, i) - 1
-                       && vertex2 == t.xelem (0, i) - 1
-                       && vertex3 == t.xelem (2, i) - 1
-                       || vertex0 == t.xelem (1, i) - 1
-                       && vertex1 == t.xelem (3, i) - 1
-                       && vertex2 == t.xelem (2, i) - 1
-                       && vertex3 == t.xelem (0, i) - 1
+                      || vertex0 == t.xelem (1, i) - 1
+                      && vertex1 == t.xelem (0, i) - 1
+                      && vertex2 == t.xelem (2, i) - 1
+                      && vertex3 == t.xelem (3, i) - 1
+                      || vertex0 == t.xelem (1, i) - 1
+                      && vertex1 == t.xelem (0, i) - 1
+                      && vertex2 == t.xelem (3, i) - 1
+                      && vertex3 == t.xelem (2, i) - 1
+                      || vertex0 == t.xelem (1, i) - 1
+                      && vertex1 == t.xelem (2, i) - 1
+                      && vertex2 == t.xelem (0, i) - 1
+                      && vertex3 == t.xelem (3, i) - 1
+                      || vertex0 == t.xelem (1, i) - 1
+                      && vertex1 == t.xelem (2, i) - 1
+                      && vertex2 == t.xelem (3, i) - 1
+                      && vertex3 == t.xelem (0, i) - 1
+                      || vertex0 == t.xelem (1, i) - 1
+                      && vertex1 == t.xelem (3, i) - 1
+                      && vertex2 == t.xelem (0, i) - 1
+                      && vertex3 == t.xelem (2, i) - 1
+                      || vertex0 == t.xelem (1, i) - 1
+                      && vertex1 == t.xelem (3, i) - 1
+                      && vertex2 == t.xelem (2, i) - 1
+                      && vertex3 == t.xelem (0, i) - 1
 
-                       || vertex0 == t.xelem (2, i) - 1
-                       && vertex1 == t.xelem (0, i) - 1
-                       && vertex2 == t.xelem (1, i) - 1
-                       && vertex3 == t.xelem (3, i) - 1
-                       || vertex0 == t.xelem (2, i) - 1
-                       && vertex1 == t.xelem (0, i) - 1
-                       && vertex2 == t.xelem (3, i) - 1
-                       && vertex3 == t.xelem (1, i) - 1
-                       || vertex0 == t.xelem (2, i) - 1
-                       && vertex1 == t.xelem (1, i) - 1
-                       && vertex2 == t.xelem (0, i) - 1
-                       && vertex3 == t.xelem (3, i) - 1
-                       || vertex0 == t.xelem (2, i) - 1
-                       && vertex1 == t.xelem (1, i) - 1
-                       && vertex2 == t.xelem (3, i) - 1
-                       && vertex3 == t.xelem (0, i) - 1
-                       || vertex0 == t.xelem (2, i) - 1
-                       && vertex1 == t.xelem (3, i) - 1
-                       && vertex2 == t.xelem (0, i) - 1
-                       && vertex3 == t.xelem (1, i) - 1
-                       || vertex0 == t.xelem (2, i) - 1
-                       && vertex1 == t.xelem (3, i) - 1
-                       && vertex2 == t.xelem (1, i) - 1
-                       && vertex3 == t.xelem (0, i) - 1
+                      || vertex0 == t.xelem (2, i) - 1
+                      && vertex1 == t.xelem (0, i) - 1
+                      && vertex2 == t.xelem (1, i) - 1
+                      && vertex3 == t.xelem (3, i) - 1
+                      || vertex0 == t.xelem (2, i) - 1
+                      && vertex1 == t.xelem (0, i) - 1
+                      && vertex2 == t.xelem (3, i) - 1
+                      && vertex3 == t.xelem (1, i) - 1
+                      || vertex0 == t.xelem (2, i) - 1
+                      && vertex1 == t.xelem (1, i) - 1
+                      && vertex2 == t.xelem (0, i) - 1
+                      && vertex3 == t.xelem (3, i) - 1
+                      || vertex0 == t.xelem (2, i) - 1
+                      && vertex1 == t.xelem (1, i) - 1
+                      && vertex2 == t.xelem (3, i) - 1
+                      && vertex3 == t.xelem (0, i) - 1
+                      || vertex0 == t.xelem (2, i) - 1
+                      && vertex1 == t.xelem (3, i) - 1
+                      && vertex2 == t.xelem (0, i) - 1
+                      && vertex3 == t.xelem (1, i) - 1
+                      || vertex0 == t.xelem (2, i) - 1
+                      && vertex1 == t.xelem (3, i) - 1
+                      && vertex2 == t.xelem (1, i) - 1
+                      && vertex3 == t.xelem (0, i) - 1
 
-                       || vertex0 == t.xelem (3, i) - 1
-                       && vertex1 == t.xelem (0, i) - 1
-                       && vertex2 == t.xelem (1, i) - 1
-                       && vertex3 == t.xelem (2, i) - 1
-                       || vertex0 == t.xelem (3, i) - 1
-                       && vertex1 == t.xelem (0, i) - 1
-                       && vertex2 == t.xelem (2, i) - 1
-                       && vertex3 == t.xelem (1, i) - 1
-                       || vertex0 == t.xelem (3, i) - 1
-                       && vertex1 == t.xelem (1, i) - 1
-                       && vertex2 == t.xelem (0, i) - 1
-                       && vertex3 == t.xelem (2, i) - 1
-                       || vertex0 == t.xelem (3, i) - 1
-                       && vertex1 == t.xelem (1, i) - 1
-                       && vertex2 == t.xelem (2, i) - 1
-                       && vertex3 == t.xelem (0, i) - 1
-                       || vertex0 == t.xelem (3, i) - 1
-                       && vertex1 == t.xelem (2, i) - 1
-                       && vertex2 == t.xelem (0, i) - 1
-                       && vertex3 == t.xelem (1, i) - 1
-                       || vertex0 == t.xelem (3, i) - 1
-                       && vertex1 == t.xelem (2, i) - 1
-                       && vertex2 == t.xelem (1, i) - 1
-                       && vertex3 == t.xelem (0, i) - 1)
+                      || vertex0 == t.xelem (3, i) - 1
+                      && vertex1 == t.xelem (0, i) - 1
+                      && vertex2 == t.xelem (1, i) - 1
+                      && vertex3 == t.xelem (2, i) - 1
+                      || vertex0 == t.xelem (3, i) - 1
+                      && vertex1 == t.xelem (0, i) - 1
+                      && vertex2 == t.xelem (2, i) - 1
+                      && vertex3 == t.xelem (1, i) - 1
+                      || vertex0 == t.xelem (3, i) - 1
+                      && vertex1 == t.xelem (1, i) - 1
+                      && vertex2 == t.xelem (0, i) - 1
+                      && vertex3 == t.xelem (2, i) - 1
+                      || vertex0 == t.xelem (3, i) - 1
+                      && vertex1 == t.xelem (1, i) - 1
+                      && vertex2 == t.xelem (2, i) - 1
+                      && vertex3 == t.xelem (0, i) - 1
+                      || vertex0 == t.xelem (3, i) - 1
+                      && vertex1 == t.xelem (2, i) - 1
+                      && vertex2 == t.xelem (0, i) - 1
+                      && vertex3 == t.xelem (1, i) - 1
+                      || vertex0 == t.xelem (3, i) - 1
+                      && vertex1 == t.xelem (2, i) - 1
+                      && vertex2 == t.xelem (1, i) - 1
+                      && vertex3 == t.xelem (0, i) - 1)
                     {
                       cell[*f] = t.xelem (4, i);
                       break;
--- a/src/MeshFunction.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/MeshFunction.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -44,9 +44,9 @@
 
   int nargin = args.length ();
   octave_value retval;
-  
+
   if (nargin < 2 || nargin > 4 || nargout > 1)
-    print_usage ();
+    { print_usage (); }
   else
     {
       if (! mesh_type_loaded)
@@ -106,10 +106,10 @@
                 }
             }
           else
-            error ("invalid input arguments");
+            { error ("invalid input arguments"); }
         }
       else
-        error ("invalid input arguments");
+        { error ("invalid input arguments"); }
     }
 
   return retval;
--- a/src/PETSc_factory.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/PETSc_factory.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -21,240 +21,238 @@
 #include <boost/serialization/vector.hpp>
 #endif
 
-femfenics_base_factory const&
+femfenics_base_factory const &
 PETSc_factory::instance (void)
-  {
-    static PETSc_factory const theinstance;
-    return theinstance;
-  }
+{
+  static PETSc_factory const theinstance;
+  return theinstance;
+}
 
 octave_value
-PETSc_factory::matrix (dolfin::Matrix const& A) const
-  {
-    octave_value retval;
+PETSc_factory::matrix (dolfin::Matrix const & A) const
+{
+  octave_value retval;
 
-    unsigned const size =
+  unsigned const size =
 #ifdef LATEST_DOLFIN
-      dolfin::MPI::size (MPI_COMM_WORLD);
+    dolfin::MPI::size (MPI_COMM_WORLD);
 #else
-      dolfin::MPI::num_processes ();
+    dolfin::MPI::num_processes ();
 #endif
 
-    if (size > 1)
-      retval = do_matrix_parallel (A);
-    else
-      retval = do_matrix_serial (A);
+  if (size > 1)
+    { retval = do_matrix_parallel (A); }
+  else
+    { retval = do_matrix_serial (A); }
 
-    return retval;
-  }
+  return retval;
+}
 
 octave_value
-PETSc_factory::vector (dolfin::Vector const& b) const
-  {
-    octave_value retval;
+PETSc_factory::vector (dolfin::Vector const & b) const
+{
+  octave_value retval;
 
-    unsigned const size =
+  unsigned const size =
 #ifdef LATEST_DOLFIN
-      dolfin::MPI::size (MPI_COMM_WORLD);
+    dolfin::MPI::size (MPI_COMM_WORLD);
 #else
-      dolfin::MPI::num_processes ();
+    dolfin::MPI::num_processes ();
 #endif
 
-    if (size > 1)
-      retval = do_vector_parallel (b);
-    else
-      retval = do_vector_serial (b);
+  if (size > 1)
+    { retval = do_vector_parallel (b); }
+  else
+    { retval = do_vector_serial (b); }
 
-    return retval;
-  }
+  return retval;
+}
 
 void
 PETSc_factory::add_to_arrays (Array <octave_idx_type> & ridx,
                               Array <octave_idx_type> & cidx,
                               Array <double> & values,
-                              std::vector <std::size_t> const& row,
-                              std::vector <std::size_t> const& col,
-                              std::vector <double> const& val)
-  {
-    octave_idx_type pos = cidx.numel ();
+                              std::vector <std::size_t> const & row,
+                              std::vector <std::size_t> const & col,
+                              std::vector <double> const & val)
+{
+  octave_idx_type pos = cidx.numel ();
 
-    dim_vector dims = cidx.dims ();
-    if (dims(1) == 1)
-      dims(0) += col.size ();
-    else
-      dims(1) += col.size ();
-    ridx.resize (dims, 0);
-    cidx.resize (dims, 0);
-    values.resize (dims, 0);
+  dim_vector dims = cidx.dims ();
+  if (dims(1) == 1)
+    { dims(0) += col.size (); }
+  else
+    { dims(1) += col.size (); }
+  ridx.resize (dims, 0);
+  cidx.resize (dims, 0);
+  values.resize (dims, 0);
 
-    std::vector <std::size_t>::const_iterator rit = row.begin (),
-                                                    cit = col.begin ();
-    std::vector <double>::const_iterator vit = val.begin ();
+  std::vector <std::size_t>::const_iterator rit = row.begin (),
+                                            cit = col.begin ();
+  std::vector <double>::const_iterator vit = val.begin ();
 
-    while (cit != col.end ())
-      {
-        ridx(pos) = *rit;
-        cidx(pos) = *cit;
-        values(pos) = *vit;
+  while (cit != col.end ())
+    {
+      ridx(pos) = *rit;
+      cidx(pos) = *cit;
+      values(pos) = *vit;
 
-        ++rit;
-        ++cit;
-        ++vit;
-        ++pos;
-      }
+      ++rit;
+      ++cit;
+      ++vit;
+      ++pos;
+    }
 
-    return;
-  }
+  return;
+}
 
 octave_value
-PETSc_factory::do_matrix_serial (dolfin::Matrix const& A) const
-  {
-    octave_value retval;
-
-    std::size_t nr = A.size (0), nc = A.size (1);
+PETSc_factory::do_matrix_serial (dolfin::Matrix const & A) const
+{
+  octave_value retval;
 
-    dim_vector dims (0, 1);
-    Array <octave_idx_type> 
-      ridx (dims, 0), 
-      cidx (dims, 0);
-    Array<double> data (dims, 0);
+  std::size_t nr = A.size (0), nc = A.size (1);
+
+  dim_vector dims (0, 1);
+  Array <octave_idx_type> ridx (dims, 0), cidx (dims, 0);
+  Array<double> data (dims, 0);
 
-    for (std::size_t i = 0; i < nr; ++i)
-      {
-        std::vector <double> data_tmp;
-        std::vector <std::size_t> cidx_tmp;
-        A.getrow (i, cidx_tmp, data_tmp);
-        std::vector <std::size_t> ridx_tmp (cidx_tmp.size (), i);
-        add_to_arrays (ridx, cidx, data, ridx_tmp, cidx_tmp, data_tmp);
-      }
+  for (std::size_t i = 0; i < nr; ++i)
+    {
+      std::vector <double> data_tmp;
+      std::vector <std::size_t> cidx_tmp;
+      A.getrow (i, cidx_tmp, data_tmp);
+      std::vector <std::size_t> ridx_tmp (cidx_tmp.size (), i);
+      add_to_arrays (ridx, cidx, data, ridx_tmp, cidx_tmp, data_tmp);
+    }
 
-    SparseMatrix sm (data, ridx, cidx, nr, nc);
-    retval = sm;
+  SparseMatrix sm (data, ridx, cidx, nr, nc);
+  retval = sm;
 
-    return retval;
-  }
+  return retval;
+}
 
 octave_value
-PETSc_factory::do_matrix_parallel (dolfin::Matrix const& A) const
-  {
-    octave_value retval;
+PETSc_factory::do_matrix_parallel (dolfin::Matrix const & A) const
+{
+  octave_value retval;
 
-    std::vector <std::size_t> rows, cols;
-    std::vector <double> vals;
-    std::size_t const nrows = A.size (0), ncols = A.size (1);
+  std::vector <std::size_t> rows, cols;
+  std::vector <double> vals;
+  std::size_t const nrows = A.size (0), ncols = A.size (1);
 
-    std::pair <std::size_t, std::size_t> const range = A.local_range (0);
-    for (std::size_t i = range.first; i < range.second; ++i)
-      {
-        std::vector <std::size_t> cols_tmp;
-        std::vector <double> vals_tmp;
-        A.getrow (i, cols_tmp, vals_tmp);
-        cols.insert (cols.end (), cols_tmp.begin (), cols_tmp.end ());
-        vals.insert (vals.end (), vals_tmp.begin (), vals_tmp.end ());
-        for (std::size_t j = 0; j < cols_tmp.size (); ++j)
-          rows.push_back (i);
-      }
+  std::pair <std::size_t, std::size_t> const range = A.local_range (0);
+  for (std::size_t i = range.first; i < range.second; ++i)
+    {
+      std::vector <std::size_t> cols_tmp;
+      std::vector <double> vals_tmp;
+      A.getrow (i, cols_tmp, vals_tmp);
+      cols.insert (cols.end (), cols_tmp.begin (), cols_tmp.end ());
+      vals.insert (vals.end (), vals_tmp.begin (), vals_tmp.end ());
+      for (std::size_t j = 0; j < cols_tmp.size (); ++j)
+        { rows.push_back (i); }
+    }
 
-    boost::mpi::communicator world;
+  boost::mpi::communicator world;
 
-    unsigned const size = world.size ();
-    unsigned const rank = world.rank ();
+  unsigned const size = world.size ();
+  unsigned const rank = world.rank ();
 
-    for (unsigned p = 1; p < size; ++p)
-      {
-        if (rank == p)
-          {
-            unsigned const tag = 3*(p-1);
-            world.send (0, tag, rows);
-            world.send (0, tag+1, cols);
-            world.send (0, tag+2, vals);
-          }
-      }
+  for (unsigned p = 1; p < size; ++p)
+    {
+      if (rank == p)
+        {
+          unsigned const tag = 3 * (p - 1);
+          world.send (0, tag, rows);
+          world.send (0, tag + 1, cols);
+          world.send (0, tag + 2, vals);
+        }
+    }
 
-    if (rank == 0)
-      {
-        dim_vector dims (0, 1);
-        Array <octave_idx_type> ridx (dims, 0), cidx (dims, 0);
-        Array <double> data (dims, 0);
-        add_to_arrays (ridx, cidx, data, rows, cols, vals);
+  if (rank == 0)
+    {
+      dim_vector dims (0, 1);
+      Array <octave_idx_type> ridx (dims, 0), cidx (dims, 0);
+      Array <double> data (dims, 0);
+      add_to_arrays (ridx, cidx, data, rows, cols, vals);
 
-        for (unsigned p = 1; p < size; ++p)
-          {
-            std::vector <double> new_vals;
-            std::vector <std::size_t> new_rows, new_cols;
-            unsigned const tag = 3*(p-1);
+      for (unsigned p = 1; p < size; ++p)
+        {
+          std::vector <double> new_vals;
+          std::vector <std::size_t> new_rows, new_cols;
+          unsigned const tag = 3 * (p - 1);
 
-            world.recv (p, tag, new_rows);
-            world.recv (p, tag+1, new_cols);
-            world.recv (p, tag+2, new_vals);
+          world.recv (p, tag, new_rows);
+          world.recv (p, tag + 1, new_cols);
+          world.recv (p, tag + 2, new_vals);
 
-            add_to_arrays (ridx, cidx, data, new_rows, new_cols, new_vals);
-          }
+          add_to_arrays (ridx, cidx, data, new_rows, new_cols, new_vals);
+        }
 
-        SparseMatrix sm (data, ridx, cidx, nrows, ncols);
-        retval = sm;
-      }
-    else
-      // Return an identity matrix just to avoid warnings or errors
-      {
-        dim_vector dims (nrows, 1);
-        Array <octave_idx_type> ridx (dims), cidx (dims);
-        Array <double> data (dims, 1);
+      SparseMatrix sm (data, ridx, cidx, nrows, ncols);
+      retval = sm;
+    }
+  else
+    // Return an identity matrix just to avoid warnings or errors
+    {
+      dim_vector dims (nrows, 1);
+      Array <octave_idx_type> ridx (dims), cidx (dims);
+      Array <double> data (dims, 1);
 
-        for (std::size_t i = 0; i < nrows; ++i)
-          {
-            ridx.xelem (i) = i;
-            cidx.xelem (i) = i;
-          }
+      for (std::size_t i = 0; i < nrows; ++i)
+        {
+          ridx.xelem (i) = i;
+          cidx.xelem (i) = i;
+        }
 
-        SparseMatrix sm (data, ridx, cidx, nrows, ncols);
-        retval = sm;
-      }
+      SparseMatrix sm (data, ridx, cidx, nrows, ncols);
+      retval = sm;
+    }
 
-    return retval;
-  }
+  return retval;
+}
 
 octave_value
-PETSc_factory::do_vector_serial (dolfin::Vector const& b) const
-  {
-    octave_value retval;
+PETSc_factory::do_vector_serial (dolfin::Vector const & b) const
+{
+  octave_value retval;
 
-    dim_vector dims;
-    dims.resize (2);
-    dims(0) = b.size ();
-    dims(1) = 1;
-    Array <double> myb (dims);
+  dim_vector dims;
+  dims.resize (2);
+  dims(0) = b.size ();
+  dims(1) = 1;
+  Array <double> myb (dims);
 
-    for (std::size_t i = 0; i < b.size (); ++i)
-      myb.xelem (i) = b[i];
+  for (std::size_t i = 0; i < b.size (); ++i)
+    { myb.xelem (i) = b[i]; }
 
-    retval = myb;
+  retval = myb;
 
-    return retval;
-  }
+  return retval;
+}
 
 octave_value
-PETSc_factory::do_vector_parallel (dolfin::Vector const& b) const
-  {
-    octave_value retval;
+PETSc_factory::do_vector_parallel (dolfin::Vector const & b) const
+{
+  octave_value retval;
 
-    std::size_t const length = b.size ();
-    dim_vector dims (length, 1);
-    Array <double> vec (dims, 0);
+  std::size_t const length = b.size ();
+  dim_vector dims (length, 1);
+  Array <double> vec (dims, 0);
 
-    std::vector <double> entries;
-    b.gather_on_zero (entries);
+  std::vector <double> entries;
+  b.gather_on_zero (entries);
 
 #ifdef LATEST_DOLFIN
-    if (dolfin::MPI::rank (MPI_COMM_WORLD) == 0)
+  if (dolfin::MPI::rank (MPI_COMM_WORLD) == 0)
 #else
-    if (dolfin::MPI::process_number () == 0)
+  if (dolfin::MPI::process_number () == 0)
 #endif
-      for (std::size_t i = 0; i < length; ++i)
-        vec.xelem (i) = entries[i];
+    for (std::size_t i = 0; i < length; ++i)
+      { vec.xelem (i) = entries[i]; }
 
-    // On nodes other than zero, return an all zero vector of the right length
-    retval = vec;
+  // On nodes other than zero, return an all zero vector of the right length
+  retval = vec;
 
-    return retval;
-  }
+  return retval;
+}
--- a/src/PETSc_factory.h	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/PETSc_factory.h	Thu Aug 14 12:26:55 2014 +0200
@@ -22,32 +22,32 @@
 
 class PETSc_factory : public femfenics_base_factory
 {
-  public:
+public:
 
   virtual ~PETSc_factory () {}
 
-  octave_value matrix (dolfin::Matrix const&) const;
-  octave_value vector (dolfin::Vector const&) const;
+  octave_value matrix (dolfin::Matrix const &) const;
+  octave_value vector (dolfin::Vector const &) const;
 
-  static femfenics_base_factory const& instance (void);
+  static femfenics_base_factory const & instance (void);
 
-  private:
+private:
 
   PETSc_factory () {}
-  PETSc_factory (PETSc_factory const&);
-  PETSc_factory & operator = (PETSc_factory const&);
+  PETSc_factory (PETSc_factory const &);
+  PETSc_factory & operator = (PETSc_factory const &);
 
   static void add_to_arrays (Array <octave_idx_type> &,
                              Array <octave_idx_type> &,
                              Array <double> &,
-                             std::vector <std::size_t> const&,
-                             std::vector <std::size_t> const&,
-                             std::vector <double> const&);
+                             std::vector <std::size_t> const &,
+                             std::vector <std::size_t> const &,
+                             std::vector <double> const &);
 
-  octave_value do_matrix_serial (dolfin::Matrix const&) const;
-  octave_value do_matrix_parallel (dolfin::Matrix const&) const;
-  octave_value do_vector_serial (dolfin::Vector const&) const;
-  octave_value do_vector_parallel (dolfin::Vector const&) const;
+  octave_value do_matrix_serial (dolfin::Matrix const &) const;
+  octave_value do_matrix_parallel (dolfin::Matrix const &) const;
+  octave_value do_vector_serial (dolfin::Vector const &) const;
+  octave_value do_vector_parallel (dolfin::Vector const &) const;
 };
 
 #endif
--- a/src/SubDomain.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/SubDomain.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -32,7 +32,7 @@
   octave_value retval;
 
   if (nargin < 2 || nargin > 2 || nargout > 1)
-    print_usage ();
+    { print_usage (); }
   else
     {
       if (args(0).is_function_handle () && args(1).is_bool_scalar ())
@@ -49,7 +49,7 @@
           retval = new subdomain (*pfh, on_boundary);
         }
       else
-        error ("invalid input arguments");
+        { error ("invalid input arguments"); }
     }
 
   return retval;
--- a/src/assemble.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/assemble.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -20,7 +20,7 @@
 #include "femfenics_factory.h"
 #include "dolfin_compat.h"
 
-DEFUN_DLD (assemble, args, nargout, 
+DEFUN_DLD (assemble, args, nargout,
 "-*- texinfo -*-\n\
 @deftypefn {Function File} {[@var{A}], [@var{x}(Optional)]} = \
 assemble (@var{form_a}, @var{DirichletBC}) \n\
@@ -67,12 +67,12 @@
   if (nargout == 1)
     {
       if (nargin < 1)
-        print_usage ();
+        { print_usage (); }
       else
         {
           if (args(0).type_id () == form::static_type_id ())
             {
-              const form & frm = static_cast<const form&> (args(0).get_rep ());
+              const form & frm = static_cast<const form &> (args(0).get_rep ());
 
               if (! error_state)
                 {
@@ -88,23 +88,22 @@
 
                       for (std::size_t i = 1; i < nargin; ++i)
                         {
-                          if (args(i).type_id () == 
+                          if (args(i).type_id () ==
                               boundarycondition::static_type_id ())
                             {
                               const boundarycondition & bc
-                                = static_cast<const boundarycondition&> 
-                                (args(i).get_rep ());
+                                = static_cast<const boundarycondition &>
+                                  (args(i).get_rep ());
 
-                              const 
-                                std::vector<SHARED_PTR
-                                            <const dolfin::DirichletBC> > 
+                              const std::vector<SHARED_PTR
+                                <const dolfin::DirichletBC> >
                                 & pbc = bc.get_bc ();
-                              
+
                               for (std::size_t j = 0; j < pbc.size (); ++j)
-                                pbc[j]->apply(A);
+                                { pbc[j]->apply (A); }
                             }
                           else
-                            error ("assemble: unknown argument type");
+                            { error ("assemble: unknown argument type"); }
                         }
 
                       retval(0) = factory.matrix (A);
@@ -119,22 +118,22 @@
 
                       for (std::size_t i = 1; i < nargin; ++i)
                         {
-                          if (args(i).type_id () == 
+                          if (args(i).type_id () ==
                               boundarycondition::static_type_id ())
                             {
                               const boundarycondition & bc
-                                = static_cast<const boundarycondition&> 
-                                (args(i).get_rep ());
+                                = static_cast<const boundarycondition &>
+                                  (args(i).get_rep ());
 
-                              const std::vector<SHARED_PTR 
-                                                <const dolfin::DirichletBC> >
+                              const std::vector<SHARED_PTR
+                                <const dolfin::DirichletBC> >
                                 & pbc = bc.get_bc ();
 
                               for (std::size_t j = 0; j < pbc.size (); ++j)
-                                pbc[j]->apply(A);
+                                { pbc[j]->apply (A); }
                             }
                           else
-                            error ("assemble: unknown argument type");
+                            { error ("assemble: unknown argument type"); }
                         }
 
                       retval(0) = factory.vector (A);
@@ -147,7 +146,7 @@
                     }
 
                   else
-                    error ("assemble: unknown form size");
+                    { error ("assemble: unknown form size"); }
                 }
             }
         }
@@ -155,12 +154,12 @@
   else if (nargout == 2)
     {
       if (nargin < 2)
-        print_usage ();
+        { print_usage (); }
       else
         {
           if (args(0).type_id () == form::static_type_id ())
             {
-              const form & frm = 
+              const form & frm =
                 static_cast<const form &> (args(0).get_rep ());
               const Array<double> myx = args(1).array_value ();
 
@@ -182,27 +181,27 @@
                       dolfin::Vector x (myx.length ());
 #endif
                       for (std::size_t i = 0; i < myx.length (); ++i)
-                        x.setitem (i, myx.xelem (i));
+                        { x.setitem (i, myx.xelem (i)); }
 
                       for (std::size_t i = 2; i < nargin; ++i)
                         {
-                          if (args(i).type_id () == 
+                          if (args(i).type_id () ==
                               boundarycondition::static_type_id ())
                             {
                               const boundarycondition & bc
-                                = static_cast<const boundarycondition&> 
-                                (args(i).get_rep ());
+                                = static_cast<const boundarycondition &>
+                                  (args(i).get_rep ());
 
-                              const std::vector<SHARED_PTR 
-                                                <const dolfin::DirichletBC> > 
+                              const std::vector<SHARED_PTR
+                                <const dolfin::DirichletBC> >
                                 & pbc = bc.get_bc ();
 
-                              for (std::size_t j = 0; 
+                              for (std::size_t j = 0;
                                    j < pbc.size (); ++j)
-                                pbc[j]->apply(A, x);
+                                { pbc[j]->apply (A, x); }
                             }
                           else
-                            error ("assemble: unknown argument type");
+                            { error ("assemble: unknown argument type"); }
                         }
 
                       retval(0) = factory.vector (A);
@@ -210,7 +209,7 @@
                     }
 
                   else
-                    error ("assemble: unknown size");
+                    { error ("assemble: unknown size"); }
                 }
             }
         }
--- a/src/assemble_system.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/assemble_system.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -1,5 +1,5 @@
 /*
- Copyright (C) 2013 Marco Vassallo  <gedeone-octave@users.sourceforge.net> 
+ Copyright (C) 2013 Marco Vassallo  <gedeone-octave@users.sourceforge.net>
 
  This program is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free Software
@@ -60,7 +60,7 @@
   if (nargout == 2)
     {
       if (nargin < 2)
-        print_usage ();
+        { print_usage (); }
       else
         {
 
@@ -68,9 +68,9 @@
               && args(1).type_id () == form::static_type_id ())
             {
               const form & frm1 =
-                static_cast<const form&> (args(0).get_rep ());
+                static_cast<const form &> (args(0).get_rep ());
               const form & frm2 =
-                static_cast<const form&> (args(1).get_rep ());
+                static_cast<const form &> (args(1).get_rep ());
 
               if (! error_state)
                 {
@@ -94,18 +94,18 @@
                               boundarycondition::static_type_id ())
                             {
                               const boundarycondition & bc
-                                = static_cast<const boundarycondition&> 
-                                (args(i).get_rep ());
+                                = static_cast<const boundarycondition &>
+                                  (args(i).get_rep ());
 
-                              const std::vector<SHARED_PTR 
-                                                <const dolfin::DirichletBC> > 
-                              & pbc = bc.get_bc ();
+                              const std::vector<SHARED_PTR
+                                <const dolfin::DirichletBC> >
+                                & pbc = bc.get_bc ();
 
                               for (std::size_t j = 0; j < pbc.size (); ++j)
-                                pbc[j]->apply(A, B);
+                                { pbc[j]->apply (A, B); }
                             }
                           else
-                            error ("assemble_system: unknown argument type");
+                            { error ("assemble_system: unknown argument type"); }
                         }
 
                       retval(0) = factory.matrix (A);
@@ -113,23 +113,23 @@
                     }
                 }
               else
-                error ("assemble_system: unknown size");
+                { error ("assemble_system: unknown size"); }
             }
         }
     }
   else if (nargout == 3)
     {
       if (nargin < 3)
-        print_usage ();
+        { print_usage (); }
       else
         {
           if (args(0).type_id () == form::static_type_id ()
               && args(1).type_id () == form::static_type_id ())
             {
               const form & frm1 =
-                static_cast<const form&> (args(0).get_rep ());
+                static_cast<const form &> (args(0).get_rep ());
               const form & frm2 =
-                static_cast<const form&> (args(1).get_rep ());
+                static_cast<const form &> (args(1).get_rep ());
               const Array<double> myx = args(2).array_value ();
 
               if (! error_state)
@@ -154,28 +154,28 @@
 #endif
 
                       for (std::size_t i = 0; i < myx.length (); ++i)
-                        x.setitem (i, myx.xelem (i));
+                        { x.setitem (i, myx.xelem (i)); }
 
                       for (std::size_t i = 3; i < nargin; ++i)
                         {
-                          if (args(i).type_id () == 
+                          if (args(i).type_id () ==
                               boundarycondition::static_type_id ())
                             {
                               const boundarycondition & bc
-                                = static_cast<const boundarycondition&> 
+                                = static_cast<const boundarycondition &>
                                   (args(i).get_rep ());
 
-                              const std::vector<SHARED_PTR 
-                                               <const dolfin::DirichletBC> >
-                              & pbc = bc.get_bc ();
+                              const std::vector<SHARED_PTR
+                                <const dolfin::DirichletBC> >
+                                & pbc = bc.get_bc ();
 
                               for (std::size_t j = 0;
                                    j < pbc.size (); ++j)
-                                pbc[j]->apply(A, B, x);
+                                { pbc[j]->apply (A, B, x); }
 
                             }
                           else
-                            error ("assemble_system: unknown argument type");
+                            { error ("assemble_system: unknown argument type"); }
                         }
 
                       retval(0) = factory.matrix (A);
@@ -184,7 +184,7 @@
                     }
                 }
               else
-                error ("assemble_system: unknown size");
+                { error ("assemble_system: unknown size"); }
             }
         }
     }
--- a/src/barrier.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/barrier.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -30,7 +30,7 @@
   int nargin = args.length ();
 
   if (nargin > 0 || nargout > 0)
-    print_usage ();
+    { print_usage (); }
   else
     {
       dolfin::MPI::barrier (
--- a/src/boundarycondition.h	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/boundarycondition.h	Thu Aug 14 12:26:55 2014 +0200
@@ -27,54 +27,54 @@
 class boundarycondition : public octave_base_value
 {
 
- public:
+public:
 
-  boundarycondition () 
+  boundarycondition ()
     : octave_base_value () {}
 
   void
-  print (std::ostream& os, bool pr_as_read_syntax = false) const
+  print (std::ostream & os, bool pr_as_read_syntax = false) const
   {
-     for (std::size_t i = 0; i < bcu.size (); ++i)
-       os << "Boundary condition : " << bcu[i]->str (true) << std::endl;
+    for (std::size_t i = 0; i < bcu.size (); ++i)
+      { os << "Boundary condition : " << bcu[i]->str (true) << std::endl; }
   }
 
   ~boundarycondition (void) {}
 
   bool
   is_defined (void) const
-    { return true; }
+  { return true; }
 
-  const std::vector< SHARED_PTR 
-                   <const dolfin::DirichletBC> > &
-  get_bc (void) const 
-    { return bcu; }
+  const std::vector< SHARED_PTR
+    <const dolfin::DirichletBC> > &
+  get_bc (void) const
+  { return bcu; }
 
   void
   add_bc (const SHARED_PTR <const dolfin::FunctionSpace> & V,
           SHARED_PTR <const dolfin::GenericFunction> f,
           std::size_t n)
-    {
-      SHARED_PTR <const dolfin::DirichletBC> 
-        p (new dolfin::DirichletBC (V, f, n));
-      bcu.push_back(p);
-    }
+  {
+    SHARED_PTR <const dolfin::DirichletBC>
+      p (new dolfin::DirichletBC (V, f, n));
+    bcu.push_back (p);
+  }
 
   void
   add_bc (SHARED_PTR <dolfin::FunctionSpace const> const & V,
           SHARED_PTR <dolfin::GenericFunction const> f,
           SHARED_PTR <dolfin::MeshFunction <std::size_t> const> const & sd,
           std::size_t n)
-    {
-      SHARED_PTR <dolfin::DirichletBC const> 
-        p (new dolfin::DirichletBC (V, f, sd, n));
-      bcu.push_back(p);
-    }
+  {
+    SHARED_PTR <dolfin::DirichletBC const>
+      p (new dolfin::DirichletBC (V, f, sd, n));
+    bcu.push_back (p);
+  }
 
- private:
+private:
 
-  std::vector<SHARED_PTR 
-             <const dolfin::DirichletBC> > bcu;
+  std::vector<SHARED_PTR
+    <const dolfin::DirichletBC> > bcu;
 
   DECLARE_OCTAVE_ALLOCATOR;
   DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
@@ -85,6 +85,6 @@
 
 DEFINE_OCTAVE_ALLOCATOR (boundarycondition);
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (boundarycondition,
-                                   "boundarycondition",
-                                   "boundarycondition");
+                                     "boundarycondition",
+                                     "boundarycondition");
 #endif
--- a/src/femfenics_base_factory.h	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/femfenics_base_factory.h	Thu Aug 14 12:26:55 2014 +0200
@@ -23,13 +23,13 @@
 
 class femfenics_base_factory
 {
-  public:
+public:
 
   femfenics_base_factory () {}
   virtual ~femfenics_base_factory () {}
 
-  virtual octave_value matrix (dolfin::Matrix const&) const =0;
-  virtual octave_value vector (dolfin::Vector const&) const =0;
+  virtual octave_value matrix (dolfin::Matrix const &) const = 0;
+  virtual octave_value vector (dolfin::Vector const &) const = 0;
 };
 
 #endif
\ No newline at end of file
--- a/src/femfenics_factory.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/femfenics_factory.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -20,22 +20,22 @@
 #include "PETSc_factory.h"
 #include <octave/parse.h>
 
-femfenics_base_factory const&
+femfenics_base_factory const &
 femfenics_factory::factory (void) const
-  {
-    std::string backend = linear_algebra_backend ();
+{
+  std::string backend = linear_algebra_backend ();
 
-    if (backend == "uBLAS")
-      return uBLAS_factory::instance ();
+  if (backend == "uBLAS")
+    { return uBLAS_factory::instance (); }
 
-    // Default back-end
-    return PETSc_factory::instance ();
-  }
+  // Default back-end
+  return PETSc_factory::instance ();
+}
 
 std::string
 femfenics_factory::linear_algebra_backend (void) const
-  {
-    octave_value_list ovl = feval ("linear_algebra_backend");
-    std::string retval = ovl(0).string_value ();
-    return retval;
-  }
\ No newline at end of file
+{
+  octave_value_list ovl = feval ("linear_algebra_backend");
+  std::string retval = ovl (0).string_value ();
+  return retval;
+}
\ No newline at end of file
--- a/src/femfenics_factory.h	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/femfenics_factory.h	Thu Aug 14 12:26:55 2014 +0200
@@ -23,25 +23,26 @@
 
 class femfenics_factory : public femfenics_base_factory
 {
-  public:
+public:
 
   femfenics_factory ()
-    { dolfin::parameters["linear_algebra_backend"] = linear_algebra_backend (); }
+  { dolfin::parameters["linear_algebra_backend"] = linear_algebra_backend (); }
+
   virtual ~femfenics_factory () {}
 
-  virtual inline octave_value matrix (dolfin::Matrix const& A) const
-    { return factory ().matrix (A); }
+  virtual inline octave_value matrix (dolfin::Matrix const & A) const
+  { return factory ().matrix (A); }
 
-  virtual inline octave_value vector (dolfin::Vector const& b) const
-    { return factory ().vector (b); }
+  virtual inline octave_value vector (dolfin::Vector const & b) const
+  { return factory ().vector (b); }
 
-  private:
+private:
 
-  femfenics_factory (femfenics_factory const&);
-  femfenics_factory operator = (femfenics_factory const&);
+  femfenics_factory (femfenics_factory const &);
+  femfenics_factory operator = (femfenics_factory const &);
 
   std::string linear_algebra_backend (void) const;
-  femfenics_base_factory const& factory (void) const;
+  femfenics_base_factory const & factory (void) const;
 };
 
 #endif
\ No newline at end of file
--- a/src/feval.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/feval.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -39,7 +39,7 @@
 
   int nargin = args.length ();
   octave_value_list retval;
-  
+
   if (! function_type_loaded)
     {
       function::register_type ();
@@ -50,16 +50,16 @@
   if (args(0).type_id () == function::static_type_id ())
     {
       const function & fspo =
-        static_cast<const function&> (args(0).get_rep ());
+        static_cast<const function &> (args(0).get_rep ());
 
       if (!error_state)
         {
-          const SHARED_PTR <const dolfin::Function> 
+          const SHARED_PTR <const dolfin::Function>
             & f = fspo.get_pfun ();
 
           octave_idx_type pdim = f->geometric_dimension ();
           if (nargin != pdim + 1)
-            print_usage ();
+            { print_usage (); }
           else
             {
               std::vector <Matrix> coordinates;
@@ -68,12 +68,12 @@
               for (octave_idx_type in = 1; in <= pdim; ++in)
                 {
                   if (! args(in).is_real_type ())
-                    error ("invalid argument");
+                    { error ("invalid argument"); }
                   else
                     {
                       Matrix aux = args(in).matrix_value ();
                       if (in == 1)
-                        dims = aux.dims ();
+                        { dims = aux.dims (); }
                       else
                         {
                           dim_vector newdims = aux.dims ();
@@ -93,23 +93,23 @@
                 {
                   octave_idx_type vdim = f->value_dimension (0);
                   if (nargout != vdim)
-                    error ("wrong number of output arguments");
+                    { error ("wrong number of output arguments"); }
                   else
                     {
                       std::vector <Matrix> evaluations;
                       for (octave_idx_type out = 0; out < vdim; ++out)
-                        evaluations.push_back (Matrix (dims));
+                        { evaluations.push_back (Matrix (dims)); }
 
                       for (octave_idx_type k = 0; k < dims.numel (); ++k)
                         {
                           Array<double> point (dim_vector (pdim, 1));
                           for (octave_idx_type el = 0; el < pdim; ++el)
-                            point (el) = coordinates[el] (k);
-                          dolfin::Array<double> 
+                            { point (el) = coordinates[el] (k); }
+                          dolfin::Array<double>
                             x (point.length (), point.fortran_vec ());
 
                           Array<double> res (dim_vector (vdim, 1));
-                          dolfin::Array<double> 
+                          dolfin::Array<double>
                             values (res.length (), res.fortran_vec ());
                           try
                             {
@@ -124,15 +124,15 @@
                             }
 
                           for (octave_idx_type el = 0; el < vdim; ++el)
-                            evaluations[el] (k) = res (el);
+                            { evaluations[el] (k) = res (el); }
                         }
 
                       if (! error_state)
                         {
                           for (std::vector<Matrix>::iterator it =
-                               evaluations.begin ();
+                                 evaluations.begin ();
                                it != evaluations.end (); ++it)
-                            retval.append (octave_value (*it));
+                            { retval.append (octave_value (*it)); }
                         }
                     }
                 }
--- a/src/function.h	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/function.h	Thu Aug 14 12:26:55 2014 +0200
@@ -28,98 +28,98 @@
 class function : public octave_base_value
 {
 
- public:
+public:
 
   function ()
     : octave_base_value (), fun () {}
 
-  function (std::string & _str, 
+  function (std::string & _str,
             SHARED_PTR <const dolfin::Function> _fun)
-    : octave_base_value (), str(_str), fun (_fun) {}
+    : octave_base_value (), str (_str), fun (_fun) {}
 
-  function (function const& _func)
+  function (function const & _func)
     : octave_base_value (), str (_func.get_str ()), fun (_func.get_pfun ()) {}
 
-  void 
-  print (std::ostream& os,
+  void
+  print (std::ostream & os,
          bool pr_as_read_syntax = false) const
-    { os << "Function " << str << ": " << fun->str (true) << std::endl; }
+  { os << "Function " << str << ": " << fun->str (true) << std::endl; }
 
-  ~function(void) {}
+  ~function (void) {}
 
-  bool 
+  bool
   is_defined (void) const
-    { return true; }
+  { return true; }
 
   const dolfin::Function &
   get_fun (void) const
-    { return (*fun); }
+  { return (*fun); }
 
   const SHARED_PTR <const dolfin::Function> &
   get_pfun (void) const
-    { return fun; }
+  { return fun; }
 
-  void 
+  void
   set_fun (dolfin::Function & _fun)
-    {
-      dolfin::Function * p = new dolfin::Function (_fun);
-      fun = SHARED_PTR <const dolfin::Function> (p);
-    }
+  {
+    dolfin::Function * p = new dolfin::Function (_fun);
+    fun = SHARED_PTR <const dolfin::Function> (p);
+  }
 
-  const std::string & 
+  const std::string &
   get_str (void) const
-    { return str; }
+  { return str; }
 
   octave_value
-  subsref (const std::string& type,
-           const std::list<octave_value_list>& idx)
-    {
-      octave_value retval;
-      retval = subsref (type, idx, 1);
-      return retval;
-    }
+  subsref (const std::string & type,
+           const std::list<octave_value_list> & idx)
+  {
+    octave_value retval;
+    retval = subsref (type, idx, 1);
+    return retval;
+  }
 
   octave_value_list
-  subsref (const std::string& type,
-           const std::list<octave_value_list>& idx,
+  subsref (const std::string & type,
+           const std::list<octave_value_list> & idx,
            int nargout)
-    {
-      octave_value_list retval;
+  {
+    octave_value_list retval;
 
-      switch (type[0])
+    switch (type[0])
+      {
+      case '(':
         {
-        case '(':
-          {
-            retval = do_multi_index_op (nargout, idx.front ());
-          }
-          break;
+          retval = do_multi_index_op (nargout, idx.front ());
+        }
+        break;
 
-        case '{':
-        case '.':
-          {
-            std::string nm = type_name ();
-            error ("%s cannot be indexed with %c", nm.c_str (), type[0]);
-          }
-          break;
+      case '{':
+      case '.':
+        {
+          std::string nm = type_name ();
+          error ("%s cannot be indexed with %c", nm.c_str (), type[0]);
+        }
+        break;
 
-        default:
-          panic_impossible ();
-        }
+      default:
+        { panic_impossible (); }
+      }
 
-      return retval;
-    }
+    return retval;
+  }
 
   octave_value_list
-  do_multi_index_op (int nargout, const octave_value_list& idx)
-    {
-      octave_value_list retval;
-      std::list<octave_value_list> args (1, idx);
-      args.push_front (octave_value (new function (*this)));
-      retval = feval ("feval", args, nargout);
-      return retval;
-    }
+  do_multi_index_op (int nargout, const octave_value_list & idx)
+  {
+    octave_value_list retval;
+    std::list<octave_value_list> args (1, idx);
+    args.push_front (octave_value (new function (*this)));
+    retval = feval ("feval", args, nargout);
+    return retval;
+  }
 
- private:
+private:
 
   std::string str;
   SHARED_PTR <const dolfin::Function> fun;
--- a/src/interpolate.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/interpolate.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -37,9 +37,9 @@
 
   int nargin = args.length ();
   octave_value retval;
-  
+
   if (nargin < 2 || nargin > 3 || nargout > 1)
-    print_usage ();
+    { print_usage (); }
   else
     {
       if (! function_type_loaded)
@@ -71,20 +71,20 @@
           offset = 1;
         }
 
-      if (args(1+offset).type_id () == functionspace::static_type_id ())
+      if (args(1 + offset).type_id () == functionspace::static_type_id ())
         {
           const functionspace & u1 =
-            static_cast<const functionspace&> (args(1+offset).get_rep ());
+            static_cast<const functionspace &> (args(1 + offset).get_rep ());
 
           if (! error_state)
             {
               SHARED_PTR <dolfin::Function>
                 output (new dolfin::Function (u1.get_pfsp ()));
 
-              if (args(0+offset).type_id () == function::static_type_id ())
+              if (args(0 + offset).type_id () == function::static_type_id ())
                 {
                   const function & u0 =
-                    static_cast<const function&> (args(0+offset).get_rep ());
+                    static_cast<const function &> (args(0 + offset).get_rep ());
 
                   if (! error_state)
                     {
@@ -96,16 +96,16 @@
                       if (! error_state)
                         {
                           if (name.empty ())
-                            name = u0.get_str ();
+                            { name = u0.get_str (); }
                           retval = new function (name, output);
                         }
                     }
                 }
-              else if (args(0+offset).type_id () ==
+              else if (args(0 + offset).type_id () ==
                        coefficient::static_type_id ())
                 {
                   const coefficient & u0 =
-                    static_cast<const coefficient&> (args(0+offset).get_rep ());
+                    static_cast<const coefficient &> (args(0 + offset).get_rep ());
 
                   if (! error_state)
                     {
@@ -117,29 +117,29 @@
                       if (! error_state)
                         {
                           if (name.empty ())
-                            name = u0.get_str ();
+                            { name = u0.get_str (); }
                           retval = new function (name, output);
                         }
                     }
                 }
               else
-                error ("interpolate: invalid arguments");
+                { error ("interpolate: invalid arguments"); }
             }
         }
-      else if (args(1+offset).type_id () == function::static_type_id ())
+      else if (args(1 + offset).type_id () == function::static_type_id ())
         {
           const function & u0 =
-            static_cast<const function&> (args(1+offset).get_rep ());
+            static_cast<const function &> (args(1 + offset).get_rep ());
 
           if (! error_state)
             {
               SHARED_PTR <dolfin::Function>
                 output (new dolfin::Function (u0.get_fun ()));
 
-              if (args(0+offset).type_id () == function::static_type_id ())
+              if (args(0 + offset).type_id () == function::static_type_id ())
                 {
                   const function & u1 =
-                    static_cast<const function&> (args(0+offset).get_rep ());
+                    static_cast<const function &> (args(0 + offset).get_rep ());
 
                   if (! error_state)
                     {
@@ -151,16 +151,16 @@
                       if (! error_state)
                         {
                           if (name.empty ())
-                            name = u1.get_str ();
+                            { name = u1.get_str (); }
                           retval = new function (name, output);
                         }
                     }
                 }
-              else if (args(0+offset).type_id () ==
+              else if (args(0 + offset).type_id () ==
                        coefficient::static_type_id ())
                 {
                   const coefficient & u1 =
-                    static_cast<const coefficient&> (args(0+offset).get_rep ());
+                    static_cast<const coefficient &> (args(0 + offset).get_rep ());
 
                   if (! error_state)
                     {
@@ -172,17 +172,17 @@
                       if (! error_state)
                         {
                           if (name.empty ())
-                            name = u1.get_str ();
+                            { name = u1.get_str (); }
                           retval = new function (name, output);
                         }
                     }
                 }
               else
-                error ("interpolate: invalid arguments");
+                { error ("interpolate: invalid arguments"); }
             }
         }
       else
-        error ("interpolate: invalid arguments");
+        { error ("interpolate: invalid arguments"); }
     }
   return retval;
 }
--- a/src/is_master_node.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/is_master_node.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -30,7 +30,7 @@
   int nargin = args.length ();
 
   if (nargin > 0 || nargout > 1)
-    print_usage ();
+    { print_usage (); }
   else
     {
 #ifdef LATEST_DOLFIN
--- a/src/mark.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/mark.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -33,8 +33,8 @@
   int nargin = args.length ();
   octave_value retval;
 
-  if (nargin < 3 || nargin > 3 ||nargout > 1)
-    print_usage ();
+  if (nargin < 3 || nargin > 3 || nargout > 1)
+    { print_usage (); }
   else
     {
       if (! meshfunction_type_loaded)
@@ -70,7 +70,7 @@
             }
         }
       else
-        error ("invalid input arguments");
+        { error ("invalid input arguments"); }
     }
 
   return retval;
--- a/src/meshfunction.h	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/meshfunction.h	Thu Aug 14 12:26:55 2014 +0200
@@ -24,7 +24,7 @@
 
 class meshfunction : public octave_base_value
 {
-  public:
+public:
 
   meshfunction (void)
     : octave_base_value () {}
@@ -50,25 +50,25 @@
 
   bool
   is_defined (void) const
-    { return true; }
+  { return true; }
 
   void
-  print (std::ostream& os, bool pr_as_read_syntax = false) const
-    { os << "MeshFunction <std::size_t>: " << get_pmf ()->str (true) << std::endl; }
+  print (std::ostream & os, bool pr_as_read_syntax = false) const
+  { os << "MeshFunction <std::size_t>: " << get_pmf ()->str (true) << std::endl; }
 
   dolfin::MeshFunction <std::size_t> const &
   get_mf (void) const
-    { return *pmf; }
+  { return *pmf; }
 
   SHARED_PTR <dolfin::MeshFunction <std::size_t> const> const &
   get_pmf (void) const
-    { return pmf; }
+  { return pmf; }
 
   std::string const &
   get_str (void) const
-    { return str; }
+  { return str; }
 
-  private:
+private:
 
   SHARED_PTR <dolfin::MeshFunction <std::size_t> const> pmf;
   std::string str;
--- a/src/save_func.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/save_func.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -13,7 +13,8 @@
 
  You should have received a copy of the GNU General Public License along with
  this program; if not, see <http://www.gnu.org/licenses/>.
-*/  
+*/
+
 #include "function.h"
 #include "dolfin_compat.h"
 
@@ -33,9 +34,9 @@
 
   int nargin = args.length ();
   octave_value retval;
-  
+
   if (nargin < 2 || nargin > 2)
-    print_usage ();
+    { print_usage (); }
   else
     {
       if (! function_type_loaded)
@@ -47,7 +48,7 @@
       if (args(0).type_id () == function::static_type_id ())
         {
           const function & uo =
-            static_cast<const function&> (args(0).get_rep ());
+            static_cast<const function &> (args(0).get_rep ());
           std::string str = args(1).string_value ();
 
           if (!error_state)
--- a/src/save_mesh.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/save_mesh.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -34,7 +34,7 @@
   octave_value retval;
 
   if (nargin < 2 || nargin > 2 || nargout > 1)
-    print_usage ();
+    { print_usage (); }
   else
     {
       if (! mesh_type_loaded)
@@ -66,7 +66,7 @@
             }
         }
       else
-        error ("invalid input arguments");
+        { error ("invalid input arguments"); }
     }
 
   return retval;
--- a/src/save_mf.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/save_mf.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -34,7 +34,7 @@
   octave_value retval;
 
   if (nargin < 2 || nargin > 2 || nargout > 1)
-    print_usage ();
+    { print_usage (); }
   else
     {
       if (! meshfunction_type_loaded)
@@ -67,7 +67,7 @@
             }
         }
       else
-        error ("invalid input arguments");
+        { error ("invalid input arguments"); }
     }
 
   return retval;
--- a/src/subdomain.h	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/subdomain.h	Thu Aug 14 12:26:55 2014 +0200
@@ -23,7 +23,7 @@
 
 class subdomain : public octave_base_value
 {
-  public:
+public:
 
   subdomain ()
     : octave_base_value () {}
@@ -34,20 +34,18 @@
   ~subdomain (void) {}
 
   void
-  print (std::ostream& os, bool pr_as_read_syntax = false) const
-    {
-      os << "SubDomain" << std::endl;
-    }
+  print (std::ostream & os, bool pr_as_read_syntax = false) const
+  { os << "SubDomain" << std::endl; }
 
   bool
-  is_defined (void) const 
-    { return true; }
+  is_defined (void) const
+  { return true; }
 
   SHARED_PTR <subdomain_rep const> const &
   get_psd (void) const
-    { return rep; }
+  { return rep; }
 
-  private:
+private:
 
   SHARED_PTR <subdomain_rep const> rep;
 
--- a/src/subdomain_rep.h	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/subdomain_rep.h	Thu Aug 14 12:26:55 2014 +0200
@@ -28,7 +28,7 @@
 
 class subdomain_rep : public dolfin::SubDomain
 {
-  public:
+public:
 
   subdomain_rep (void)
     : dolfin::SubDomain (), pfh (NULL) {}
@@ -39,21 +39,21 @@
 
   ~subdomain_rep (void) { delete pfh; }
 
-  bool 
+  bool
   inside (dolfin::Array<double> const & x, bool on_boundary) const
-    {
-      octave_value_list b;
-      b.resize (x.size ());
-      for (std::size_t i = 0; i < x.size (); ++i)
-        b(i) = x[i];
-      octave_value_list tmp = feval (pfh->function_value (), b);
-      bool retval = tmp(0).bool_value ();
-      if (check_boundary)
-        retval = retval && on_boundary;
-      return retval;
-    }
+  {
+    octave_value_list b;
+    b.resize (x.size ());
+    for (std::size_t i = 0; i < x.size (); ++i)
+      { b(i) = x[i]; }
+    octave_value_list tmp = feval (pfh->function_value (), b);
+    bool retval = tmp(0).bool_value ();
+    if (check_boundary)
+      { retval = retval && on_boundary; }
+    return retval;
+  }
 
-  private:
+private:
 
   octave_fcn_handle * pfh;
   bool check_boundary;
--- a/src/uBLAS_factory.cc	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/uBLAS_factory.cc	Thu Aug 14 12:26:55 2014 +0200
@@ -17,82 +17,80 @@
 
 #include "uBLAS_factory.h"
 
-femfenics_base_factory const&
+femfenics_base_factory const &
 uBLAS_factory::instance (void)
-  {
-    static uBLAS_factory const theinstance;
-    return theinstance;
-  }
+{
+  static uBLAS_factory const theinstance;
+  return theinstance;
+}
 
 octave_value
-uBLAS_factory::matrix (dolfin::Matrix const& A) const
-  {
-    octave_value retval;
+uBLAS_factory::matrix (dolfin::Matrix const & A) const
+{
+  octave_value retval;
 
-    // Get capacity of the dolfin sparse matrix
-    boost::tuples::tuple<const std::size_t*, 
-                         const std::size_t*, 
-                         const double*, int> 
-      aa = A.data ();
+  // Get capacity of the dolfin sparse matrix
+  boost::tuples::tuple <const std::size_t *,
+                        const std::size_t *,
+                        const double *, int>
+    aa = A.data ();
 
-    int nnz = aa.get<3> ();
-    std::size_t nr = A.size (0), nc = A.size (1);
-    std::vector<double> data_tmp;
-    std::vector<std::size_t> cidx_tmp;
+  int nnz = aa.get<3> ();
+  std::size_t nr = A.size (0), nc = A.size (1);
+  std::vector<double> data_tmp;
+  std::vector<std::size_t> cidx_tmp;
 
-    dim_vector dims (nnz, 1);
-    octave_idx_type nz = 0, ii = 0;
-    Array<octave_idx_type> 
-      ridx (dims, 0), 
-      cidx (dims, 0);
-    Array<double> data (dims, 0);
+  dim_vector dims (nnz, 1);
+  octave_idx_type nz = 0, ii = 0;
+  Array<octave_idx_type> ridx (dims, 0), cidx (dims, 0);
+  Array<double> data (dims, 0);
 
-    octave_idx_type* orow = ridx.fortran_vec ();
-    octave_idx_type* oc = cidx.fortran_vec ();
-    double* ov = data.fortran_vec ();
+  octave_idx_type * orow = ridx.fortran_vec ();
+  octave_idx_type * oc = cidx.fortran_vec ();
+  double * ov = data.fortran_vec ();
 
-    for (std::size_t i = 0; i < nr; ++i)
-      {
-        A.getrow (i, cidx_tmp, data_tmp);
-        nz += cidx_tmp.size ();
+  for (std::size_t i = 0; i < nr; ++i)
+    {
+      A.getrow (i, cidx_tmp, data_tmp);
+      nz += cidx_tmp.size ();
 
-        for (octave_idx_type j = 0; 
-             j < cidx_tmp.size (); ++j)
-          {
-            orow [ii + j] = i;
-            oc [ii + j] = cidx_tmp [j];
-            ov [ii + j] = data_tmp [j];
-          }
+      for (octave_idx_type j = 0;
+           j < cidx_tmp.size (); ++j)
+        {
+          orow[ii + j] = i;
+          oc[ii + j] = cidx_tmp[j];
+          ov[ii + j] = data_tmp[j];
+        }
 
-        ii = nz;
-      }
+      ii = nz;
+    }
 
-    dims(0) = ii;
-    ridx.resize (dims);
-    cidx.resize (dims);
-    data.resize (dims);
+  dims(0) = ii;
+  ridx.resize (dims);
+  cidx.resize (dims);
+  data.resize (dims);
 
-    SparseMatrix sm (data, ridx, cidx, nr, nc);
-    retval = sm;
+  SparseMatrix sm (data, ridx, cidx, nr, nc);
+  retval = sm;
 
-    return retval;
-  }
+  return retval;
+}
 
 octave_value
-uBLAS_factory::vector (dolfin::Vector const& b) const
-  {
-    octave_value retval;
+uBLAS_factory::vector (dolfin::Vector const & b) const
+{
+  octave_value retval;
 
-    dim_vector dims;
-    dims.resize (2);
-    dims(0) = b.size ();
-    dims(1) = 1;
-    Array<double> myb (dims);
+  dim_vector dims;
+  dims.resize (2);
+  dims(0) = b.size ();
+  dims(1) = 1;
+  Array<double> myb (dims);
 
-    for (std::size_t i = 0; i < b.size (); ++i)
-      myb.xelem (i) = b[i];
+  for (std::size_t i = 0; i < b.size (); ++i)
+    { myb.xelem (i) = b[i]; }
 
-    retval = myb;
+  retval = myb;
 
-    return retval;
-  }
\ No newline at end of file
+  return retval;
+}
\ No newline at end of file
--- a/src/uBLAS_factory.h	Tue Aug 12 15:42:50 2014 +0200
+++ b/src/uBLAS_factory.h	Thu Aug 14 12:26:55 2014 +0200
@@ -22,20 +22,20 @@
 
 class uBLAS_factory : public femfenics_base_factory
 {
-  public:
+public:
 
   virtual ~uBLAS_factory () {}
 
-  octave_value matrix (dolfin::Matrix const&) const;
-  octave_value vector (dolfin::Vector const&) const;
+  octave_value matrix (dolfin::Matrix const &) const;
+  octave_value vector (dolfin::Vector const &) const;
 
-  static femfenics_base_factory const& instance (void);
+  static femfenics_base_factory const & instance (void);
 
-  private:
+private:
 
   uBLAS_factory () {}
-  uBLAS_factory (uBLAS_factory const&);
-  uBLAS_factory & operator = (uBLAS_factory const&);
+  uBLAS_factory (uBLAS_factory const &);
+  uBLAS_factory & operator = (uBLAS_factory const &);
 };
 
 #endif
\ No newline at end of file