Mercurial > fem-fenics-eugenio
changeset 163:5f22232b9fcc
The BilinearForm takes two FunctionalSpace as input argument.
author | gedeone-octave <marcovass89@hotmail.it> |
---|---|
date | Sat, 05 Oct 2013 10:30:39 +0100 |
parents | 344e9bc30b03 |
children | 7190852cf57f |
files | inst/BilinearForm.m inst/JacobianForm.m inst/private/generate_rhs.m |
diffstat | 3 files changed, 16 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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 <http://www.gnu.org/licenses/>. ## -*- 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))}, ',');
--- 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 <http://www.gnu.org/licenses/>. ## -*- 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))}, ',');
--- 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<const functionspace&> (args(0).get_rep ());\n\ + const functionspace & fspo2\n\ + = static_cast<const functionspace&> (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\