~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to demo/mesh/ale/python/demo.py

  • Committer: Anders Logg
  • Date: 2008-05-28 09:03:15 UTC
  • mto: (2668.1.38 trunk)
  • mto: This revision was merged to the branch mainline in revision 2670.
  • Revision ID: logg@simula.no-20080528090315-9q4pm9mokn156ve5
ALE mesh smoothing updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
methods)."""
6
6
 
7
7
__author__ = "Solveig Bruvoll (solveio@ifi.uio.no) and Anders Logg (logg@simula.no)"
8
 
__date__ = "2008-05-02 -- 2008-05-05"
 
8
__date__ = "2008-05-02 -- 2008-05-28"
9
9
__copyright__ = "Copyright (C) 2008 Solveig Bruvoll and Anders Logg"
10
10
__license__  = "GNU LGPL Version 2.1"
11
11
 
12
12
from dolfin import *
13
13
 
14
14
# Create mesh
15
 
mesh = UnitSquare(32, 32)
 
15
mesh = UnitSquare(20, 20)
16
16
 
17
17
# Create boundary mesh
18
 
vertex_map = MeshFunction("uint")
19
 
boundary = BoundaryMesh(mesh, vertex_map)
 
18
boundary = BoundaryMesh(mesh)
20
19
 
21
20
# Move vertices in boundary
22
21
for x in boundary.coordinates():
23
22
    x[0] *= 3.0
24
23
    x[1] += 0.1*sin(5.0*x[0])
25
 
plot(boundary)
26
24
 
27
25
# Move mesh
28
 
mesh.move(boundary, vertex_map)
29
 
plot(mesh)
 
26
mesh.move(boundary)
30
27
 
31
 
interactive()
 
28
# Plot mesh
 
29
plot(mesh, interactive=True)