Mercurial > fem-fenics-eugenio
changeset 239:cb6f11a09667
Move ufl to m-file in Evolution example
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Tue, 24 Jun 2014 16:55:49 +0200 |
parents | b96f6b12f8ca |
children | a57001686abb |
files | inst/example/Evolution/Evolution.m inst/example/Evolution/Evolution.ufl |
diffstat | 2 files changed, 15 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/inst/example/Evolution/Evolution.m Tue Jun 24 16:43:13 2014 +0200 +++ b/inst/example/Evolution/Evolution.m Tue Jun 24 16:55:49 2014 +0200 @@ -15,8 +15,22 @@ pkg load fem-fenics msh +ufl start Evolution +ufl 'element = FiniteElement("Lagrange", triangle, 1)' +ufl +ufl u = TrialFunction(element) +ufl v = TestFunction(element) +ufl +ufl u0 = Coefficient(element) +ufl +ufl dt = Constant(triangle) +ufl +ufl eq = (1/dt)*(u-u0)*v*dx + "inner(grad(u), grad(v))*dx" +ufl a = rhs (eq) +ufl L = lhs (eq) +ufl end + problem = 'Evolution'; -import_ufl_Problem (problem); mesh = Mesh (msh2m_structured_mesh (0:0.05:1, 0:0.05:1, 1, 1:4));
--- a/inst/example/Evolution/Evolution.ufl Tue Jun 24 16:43:13 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -## Copyright (C) 2013 Marco Vassallo <gedeone-octave@users.sourceforge.net> -## -## This program is free software; you can redistribute it and/or modify it under -## the terms of the GNU General Public License as published by the Free Software -## Foundation; either version 3 of the License, or (at your option) any later -## version. -## -## This program is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -## details. -## -## You should have received a copy of the GNU General Public License along with -## this program; if not, see <http://www.gnu.org/licenses/>. - -element = FiniteElement("Lagrange", triangle, 1) - -u = TrialFunction(element) -v = TestFunction(element) - -u0 = Coefficient(element) - -dt = Constant(triangle) - -eq = (1/dt)*(u-u0)*v*dx + inner(grad(u), grad(v))*dx -a = rhs (eq) -L = lhs (eq)