Mercurial > fem-fenics-eugenio
comparison inst/example/Poisson/Poisson.m @ 238:b96f6b12f8ca
Move ufl to m-file in Poisson example
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Tue, 24 Jun 2014 16:43:13 +0200 |
parents | e85390ed620d |
children |
comparison
equal
deleted
inserted
replaced
237:418a5119047b | 238:b96f6b12f8ca |
---|---|
12 ## | 12 ## |
13 ## You should have received a copy of the GNU General Public License along with | 13 ## You should have received a copy of the GNU General Public License along with |
14 ## this program; if not, see <http://www.gnu.org/licenses/>. | 14 ## this program; if not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 pkg load fem-fenics msh | 16 pkg load fem-fenics msh |
17 import_ufl_Problem ('Poisson') | 17 |
18 ufl start Poisson | |
19 ufl 'element = FiniteElement("Lagrange", triangle, 1)' | |
20 ufl | |
21 ufl u = TrialFunction(element) | |
22 ufl v = TestFunction(element) | |
23 ufl f = Coefficient(element) | |
24 ufl g = Coefficient(element) | |
25 ufl | |
26 ufl "a = inner(grad(u), grad(v))*dx" | |
27 ufl L = f*v*dx + g*v*ds | |
28 ufl end | |
18 | 29 |
19 # Create mesh and define function space | 30 # Create mesh and define function space |
20 x = y = linspace (0, 1, 33); | 31 x = y = linspace (0, 1, 33); |
21 mesh = Mesh(msh2m_structured_mesh (x, y, 1, 1:4)); | 32 mesh = Mesh(msh2m_structured_mesh (x, y, 1, 1:4)); |
22 | 33 |