Mercurial > fem-fenics-eugenio
diff src/assemble.cc @ 268:61830a4f9ab9
Improve formatting
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Thu, 14 Aug 2014 12:26:55 +0200 |
parents | 5e9b5bbdc56b |
children | f4d6ae912a08 |
line wrap: on
line diff
--- 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"); } } } }