Mercurial > fem-fenics-eugenio
annotate inst/BilinearForm.m @ 263:a61fc34334ca
Use meshfunction to mark subdomains
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Thu, 07 Aug 2014 19:21:36 +0200 |
parents | 0f302d70bb6d |
children |
rev | line source |
---|---|
152
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
148
diff
changeset
|
1 ## Copyright (C) 2013 Marco Vassallo <gedeone-octave@users.sourceforge.net> |
148
f2193e825ad7
Maint: update copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
137
diff
changeset
|
2 ## |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
3 ## This program is free software; you can redistribute it and/or modify it under |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
4 ## the terms of the GNU General Public License as published by the Free Software |
152
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
148
diff
changeset
|
5 ## Foundation; either version 3 of the License, or (at your option) any later |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
6 ## version. |
148
f2193e825ad7
Maint: update copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
137
diff
changeset
|
7 ## |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
8 ## This program is distributed in the hope that it will be useful, but WITHOUT |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
11 ## details. |
148
f2193e825ad7
Maint: update copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
137
diff
changeset
|
12 ## |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
13 ## You should have received a copy of the GNU General Public License along with |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
14 ## this program; if not, see <http://www.gnu.org/licenses/>. |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
15 |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
16 ## -*- texinfo -*- |
184
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
17 ## @deftypefn {Function File} {[@var{a}]} = @ |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
18 ## BilinearForm (@var{my_problem}, @var{U}, @var{V}, @var{coefficient_1}, @ |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
19 ## @var{coefficient_2},...) |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
20 ## |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
21 ## Construct a BilinearForm previously imported from ufl. |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
22 ## |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
23 ## The compulsory arguments are: |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
24 ## @itemize @bullet |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
25 ## @item @var{my_problem} the name of the problem to solve. |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
26 ## @item the FunctionSpace @var{U} and @var{V} where the problem is defined. |
185
0e6d1d79244a
Fix error in the documentation.
gedeone-octave <marcovass89@hotmail.it>
parents:
184
diff
changeset
|
27 ## @end itemize |
184
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
28 ## |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
29 ## The optional arguments are the @var{coefficient_1}, @var{coefficient_2} |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
30 ## which specify the parameters for the BilinearForm as stated in the ufl file. |
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
31 ## They can be either a Constant, a Function or an Expression. |
263
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
187
diff
changeset
|
32 ## You can also optionally provide a MeshFunction marking subdomains. |
184
66071811eef8
Improve the documentation for the pkg releae.
gedeone-octave <marcovass89@hotmail.it>
parents:
181
diff
changeset
|
33 ## |
187
0f302d70bb6d
Fix another documentation issue.
gedeone-octave <marcovass89@hotmail.it>
parents:
186
diff
changeset
|
34 ## @seealso{import_ufl_BilinearForm, import_ufl_Problem, FunctionSpace, |
263
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
187
diff
changeset
|
35 ## LinearForm, ResidualForm, MeshFunction} |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
36 ## @end deftypefn |
163
5f22232b9fcc
The BilinearForm takes two FunctionalSpace as input argument.
gedeone-octave <marcovass89@hotmail.it>
parents:
152
diff
changeset
|
37 function a = BilinearForm (name, U, V, varargin) |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
38 |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
39 if nargin < 2 |
163
5f22232b9fcc
The BilinearForm takes two FunctionalSpace as input argument.
gedeone-octave <marcovass89@hotmail.it>
parents:
152
diff
changeset
|
40 error ("BilinearForm: wrong number of input parameters."); |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
41 elseif ! ischar (name) |
163
5f22232b9fcc
The BilinearForm takes two FunctionalSpace as input argument.
gedeone-octave <marcovass89@hotmail.it>
parents:
152
diff
changeset
|
42 error ("BilinearForm: first argument is not a valid string"); |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
43 endif |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
44 |
163
5f22232b9fcc
The BilinearForm takes two FunctionalSpace as input argument.
gedeone-octave <marcovass89@hotmail.it>
parents:
152
diff
changeset
|
45 program = sprintf ("%s_BilinearForm(U, V", name); |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
46 for k = 1:length (varargin) |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
47 eval(['f_' num2str(k) '=varargin{k};']); |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
48 program = strjoin ({ program, strcat('f_',num2str(k))}, ','); |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
49 end |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
50 |
137
3a0f952a79ec
Avois useless output.
gedeone-octave <marcovass89@hotmail.it>
parents:
134
diff
changeset
|
51 program = strjoin ({program, ');'}); |
134
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
52 a = eval (program); |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
53 |
286930e440cf
New functions used to call the DLD-functions created from the user.
gedeone-octave <marcovass89@hotmail.it>
parents:
diff
changeset
|
54 endfunction |