Mercurial > fem-fenics-eugenio
comparison devel/example/Ficticious_Domain/Unsteady/L2_penalization/VelocityUpdate.ufl @ 192:945c19831a16
Unsteady NS with L2 penalization.
author | gedeone-octave <marcovass89@hotmail.it> |
---|---|
date | Sun, 10 Nov 2013 19:33:44 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
191:0c748179f6d4 | 192:945c19831a16 |
---|---|
1 ## Copyright (C) 2013 Marco Vassallo <gedeone-octave@users.sourceforge.net> | |
2 ## | |
3 ## This program is free software; you can redistribute it and/or modify it under | |
4 ## the terms of the GNU General Public License as published by the Free Software | |
5 ## Foundation; either version 3 of the License, or (at your option) any later | |
6 ## version. | |
7 ## | |
8 ## This program is distributed in the hope that it will be useful, but WITHOUT | |
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | |
11 ## details. | |
12 ## | |
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/>. | |
15 | |
16 # Define function spaces (P2-P1) | |
17 V = VectorElement("CG", triangle, 2) | |
18 Q = FiniteElement("CG", triangle, 1) | |
19 | |
20 # Define trial and test functions | |
21 u = TrialFunction(V) | |
22 v = TestFunction(V) | |
23 | |
24 # Define coefficients | |
25 k = Constant(triangle) | |
26 u1 = Coefficient(V) | |
27 p1 = Coefficient(Q) | |
28 | |
29 # Define bilinear and linear forms | |
30 a = inner(u, v)*dx | |
31 L = inner(u1, v)*dx - k*inner(grad(p1), v)*dx |