Mercurial > fem-fenics-eugenio
annotate inst/private/generate_lhs.m @ 268:61830a4f9ab9
Improve formatting
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Thu, 14 Aug 2014 12:26:55 +0200 |
parents | a61fc34334ca |
children |
rev | line source |
---|---|
152
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
124
diff
changeset
|
1 ## Copyright (C) 2013 Marco Vassallo <gedeone-octave@users.sourceforge.net> |
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
124
diff
changeset
|
2 ## |
124
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
3 ## This program is free software; you can redistribute it and/or modify it under |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
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:
124
diff
changeset
|
5 ## Foundation; either version 3 of the License, or (at your option) any later |
124
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
6 ## version. |
152
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
124
diff
changeset
|
7 ## |
124
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
8 ## This program is distributed in the hope that it will be useful, but WITHOUT |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
11 ## details. |
152
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
124
diff
changeset
|
12 ## |
124
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
13 ## You should have received a copy of the GNU General Public License along with |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
14 ## this program; if not, see <http://www.gnu.org/licenses/>. |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
15 |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
16 |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
17 ## -*- texinfo -*- |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
18 ## function for internal usage only |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
93
diff
changeset
|
19 ## @end deftypefn |
268
61830a4f9ab9
Improve formatting
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
263
diff
changeset
|
20 |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
21 function output = generate_lhs (ufl_name) |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
22 |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
23 STRING ="\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
24 #include ""@@UFL_NAME@@.h""\n\ |
154
262c9d7bda1c
Call the header file from the /include directories
gedeone-octave <marcovass89@hotmail.it>
parents:
153
diff
changeset
|
25 #include <fem-fenics/form.h>\n\ |
262c9d7bda1c
Call the header file from the /include directories
gedeone-octave <marcovass89@hotmail.it>
parents:
153
diff
changeset
|
26 #include <fem-fenics/coefficient.h>\n\ |
262c9d7bda1c
Call the header file from the /include directories
gedeone-octave <marcovass89@hotmail.it>
parents:
153
diff
changeset
|
27 #include <fem-fenics/function.h>\n\ |
262c9d7bda1c
Call the header file from the /include directories
gedeone-octave <marcovass89@hotmail.it>
parents:
153
diff
changeset
|
28 #include <fem-fenics/functionspace.h>\n\ |
263
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
29 #include <fem-fenics/meshfunction.h>\n\ |
253
5e9b5bbdc56b
Support both DOLFIN 1.3.0 and 1.4.0
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
155
diff
changeset
|
30 #include <fem-fenics/dolfin_compat.h>\n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
31 \n\ |
268
61830a4f9ab9
Improve formatting
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
263
diff
changeset
|
32 DEFUN_DLD (@@UFL_NAME@@_LinearForm, args, ,\ |
61830a4f9ab9
Improve formatting
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
263
diff
changeset
|
33 "" b = fem_lhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")\n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
34 {\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
35 int nargin = args.length ();\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
36 octave_value retval;\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
37 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
38 if (nargin < 1)\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
39 print_usage ();\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
40 else\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
41 {\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
42 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
43 if (! functionspace_type_loaded)\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
44 {\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
45 functionspace::register_type ();\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
46 functionspace_type_loaded = true;\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
47 mlock ();\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
48 }\n\ |
93
9e7035e0494b
Return an object of type form.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
49 if (! form_type_loaded)\n\ |
9e7035e0494b
Return an object of type form.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
50 {\n\ |
9e7035e0494b
Return an object of type form.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
51 form::register_type ();\n\ |
9e7035e0494b
Return an object of type form.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
52 form_type_loaded = true;\n\ |
9e7035e0494b
Return an object of type form.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
53 mlock ();\n\ |
9e7035e0494b
Return an object of type form.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
54 }\n\ |
9e7035e0494b
Return an object of type form.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
55 \n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
56 if (args(0).type_id () == functionspace::static_type_id ())\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
57 {\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
58 const functionspace & fspo\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
59 = static_cast<const functionspace&> (args(0).get_rep ());\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
60 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
61 if (! error_state)\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
62 {\n\ |
93
9e7035e0494b
Return an object of type form.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
63 const dolfin::FunctionSpace & V = fspo.get_fsp ();\n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
64 @@UFL_NAME@@::LinearForm L (V);\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
65 std::size_t ncoef = L.num_coefficients (), nc = 0;\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
66 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
67 if (! coefficient_type_loaded)\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
68 {\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
69 coefficient::register_type ();\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
70 coefficient_type_loaded = true;\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
71 mlock ();\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
72 }\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
73 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
74 if (! function_type_loaded)\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
75 {\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
76 function::register_type ();\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
77 function_type_loaded = true;\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
78 mlock ();\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
79 }\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
80 \n\ |
263
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
81 if (! meshfunction_type_loaded)\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
82 {\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
83 meshfunction::register_type ();\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
84 meshfunction_type_loaded = true;\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
85 mlock ();\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
86 }\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
87 \n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
88 for (std::size_t i = 1; i < nargin; ++i)\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
89 {\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
90 if (args(i).type_id () == coefficient::static_type_id ())\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
91 {\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
92 const coefficient & cf\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
93 = static_cast <const coefficient&> (args(i).get_rep ());\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
94 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
95 std::size_t n = L.coefficient_number (cf.get_str ());\n\ |
253
5e9b5bbdc56b
Support both DOLFIN 1.3.0 and 1.4.0
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
155
diff
changeset
|
96 const SHARED_PTR <const expression> & pexp = cf.get_expr ();\n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
97 L.set_coefficient (n, pexp);\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
98 ++nc;\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
99 }\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
100 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
101 if (args(i).type_id () == function::static_type_id ())\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
102 {\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
103 const function & fun\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
104 = static_cast <const function&> (args(i).get_rep ());\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
105 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
106 std::size_t n = L.coefficient_number (fun.get_str ());\n\ |
268
61830a4f9ab9
Improve formatting
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
263
diff
changeset
|
107 const SHARED_PTR <const dolfin::Function> & pfun =\ |
61830a4f9ab9
Improve formatting
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
263
diff
changeset
|
108 fun.get_pfun ();\n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
109 L.set_coefficient (n, pfun);\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
110 ++nc;\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
111 }\n\ |
263
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
112 \n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
113 if (args(i).type_id () == meshfunction::static_type_id ())\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
114 {\n\ |
268
61830a4f9ab9
Improve formatting
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
263
diff
changeset
|
115 meshfunction const & mf_arg =\n\ |
61830a4f9ab9
Improve formatting
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
263
diff
changeset
|
116 static_cast <meshfunction const &> (args(i).get_rep ());\n\ |
263
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
117 \n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
118 std::string type = mf_arg.get_str ();\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
119 dolfin::MeshFunction <std::size_t> const &\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
120 mf = mf_arg.get_mf ();\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
121 if (type == ""dx"")\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
122 L.dx = mf;\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
123 else if (type == ""ds"")\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
124 L.ds = mf;\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
125 else if (type == ""dS"")\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
126 L.dS = mf;\n\ |
a61fc34334ca
Use meshfunction to mark subdomains
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
253
diff
changeset
|
127 }\n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
128 }\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
129 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
130 if (nc != ncoef)\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
131 error (""Wrong number of coefficient"");\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
132 else\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
133 {\n\ |
93
9e7035e0494b
Return an object of type form.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
134 retval = new form (L);\n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
135 }\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
136 }\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
137 }\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
138 }\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
139 return retval;\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
140 }"; |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
141 |
268
61830a4f9ab9
Improve formatting
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
263
diff
changeset
|
142 STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name); |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
143 |
268
61830a4f9ab9
Improve formatting
Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
parents:
263
diff
changeset
|
144 fid = fopen (sprintf ("%s_LinearForm.cc", ufl_name), "w"); |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
145 if (fid >= 0) |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
146 fputs (fid, STRING); |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
147 output = fclose (fid); |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
148 else |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
149 error ("cannot open file"); |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
150 output = 1; |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
151 endif |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
152 |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
153 endfunction |