# HG changeset patch # User gedeone-octave # Date 1380965439 -3600 # Node ID 5f22232b9fcc0a393ddee9a2c73691460c597f7e # Parent 344e9bc30b033017eb738445e67c96ef97dd4890 The BilinearForm takes two FunctionalSpace as input argument. diff -r 344e9bc30b03 -r 5f22232b9fcc inst/BilinearForm.m --- a/inst/BilinearForm.m Fri Sep 13 12:45:22 2013 +0200 +++ b/inst/BilinearForm.m Sat Oct 05 10:30:39 2013 +0100 @@ -14,21 +14,21 @@ ## this program; if not, see . ## -*- texinfo -*- -## @deftypefn {Function File} {a} = BilinearForm (name, V, [coefficients]) +## @deftypefn {Function File} {a} = BilinearForm (name, U, V, [coefficients]) ## This function takes as input the name of the problem that you want to solve ## and the FunctionSpace where it is defined and return a Form defined with ## the coefficients passed as optional argument. ## @seealso{FunctionSpace, BilinearForm, ResidualForm} ## @end deftypefn -function a = BilinearForm (name, V, varargin) +function a = BilinearForm (name, U, V, varargin) if nargin < 2 - error ("FunctionSpace: wrong number of input parameters."); + error ("BilinearForm: wrong number of input parameters."); elseif ! ischar (name) - error ("Constant: second argument is not a valid string"); + error ("BilinearForm: first argument is not a valid string"); endif - program = sprintf ("%s_BilinearForm(V", name); + program = sprintf ("%s_BilinearForm(U, V", name); for k = 1:length (varargin) eval(['f_' num2str(k) '=varargin{k};']); program = strjoin ({ program, strcat('f_',num2str(k))}, ','); diff -r 344e9bc30b03 -r 5f22232b9fcc inst/JacobianForm.m --- a/inst/JacobianForm.m Fri Sep 13 12:45:22 2013 +0200 +++ b/inst/JacobianForm.m Sat Oct 05 10:30:39 2013 +0100 @@ -14,7 +14,7 @@ ## this program; if not, see . ## -*- texinfo -*- -## @deftypefn {Function File} {V} = JacobianForm (name, V, [coefficients]) +## @deftypefn {Function File} {V} = JacobianForm (name, U, V, [coefficients]) ## This function takes as input the name of the problem that you want to solve ## and the FunctionSpace where it is defined and return a Form defined with ## the coefficients passed as optional argument. @@ -29,7 +29,7 @@ error ("JacobianForm: first argument is not a valid string"); endif - program = sprintf ("%s_BilinearForm(V", name); + program = sprintf ("%s_BilinearForm(V, V", name); for k = 1:length (varargin) eval(['f_' num2str(k) '=varargin{k};']); program = strjoin ({ program, strcat('f_',num2str(k))}, ','); diff -r 344e9bc30b03 -r 5f22232b9fcc inst/private/generate_rhs.m --- a/inst/private/generate_rhs.m Fri Sep 13 12:45:22 2013 +0200 +++ b/inst/private/generate_rhs.m Sat Oct 05 10:30:39 2013 +0100 @@ -49,15 +49,19 @@ mlock ();\n\ }\n\ \n\ - if (args(0).type_id () == functionspace::static_type_id ())\n\ + if (args(0).type_id () == functionspace::static_type_id ()\n\ + && args(1).type_id () == functionspace::static_type_id ())\n\ {\n\ - const functionspace & fspo\n\ + const functionspace & fspo1\n\ = static_cast (args(0).get_rep ());\n\ + const functionspace & fspo2\n\ + = static_cast (args(1).get_rep ());\n\ \n\ if (! error_state)\n\ {\n\ - const dolfin::FunctionSpace & V = fspo.get_fsp ();\n\ - @@UFL_NAME@@::BilinearForm a (V, V);\n\ + const dolfin::FunctionSpace & U = fspo1.get_fsp ();\n\ + const dolfin::FunctionSpace & V = fspo2.get_fsp ();\n\ + @@UFL_NAME@@::BilinearForm a (U, V);\n\ std::size_t ncoef = a.num_coefficients (), nc = 0;\n\ \n\ if (! coefficient_type_loaded)\n\ @@ -74,7 +78,7 @@ mlock ();\n\ }\n\ \n\ - for (std::size_t i = 1; i < nargin; ++i)\n\ + for (std::size_t i = 2; i < nargin; ++i)\n\ {\n\ if (args(i).type_id () == coefficient::static_type_id ())\n\ {\n\