~ubuntu-branches/ubuntu/natty/dolfin/natty

« back to all changes in this revision

Viewing changes to demo/undocumented/elasticity/python/demo.py

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2011-02-24 10:34:44 UTC
  • mfrom: (1.1.7 upstream) (14.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110224103444-n3fwnmh32lfoske0
Tags: 0.9.10-1
* New upstream release. This release fixes bug "FTBFS: error:
  'SCOTCH_Dgraph' was not declared in this scope" (closes: #612602).
* debian/control:
  - Add libslepc3.1-dev and libboost-thread-dev to Build-Depends and
    Depends field in binary package libdolfin0-dev.
  - Bump build dependency on python-ufc to >= 2.0.0.
  - Remove Build-Depends-Indep field as upstream no longer ships the
    user manual.
  - Remove old fields Conflicts, Provides, and Replaces from
    libdolfin0-dev, libdolfin0, libdolfin0-dbg, and python-dolfin.
* Remove all patches as they are now incorporated upstream.
* Add dolfin-plot and dolfin-version to debian/dolfin-bin.install.
* Remove .doc-base file since the user manual is removed by upstream.
* Remove targets clean and install/dolfin-doc from debian/rules since
  they are no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
for a gear clamped at two of its ends and twisted 30 degrees."""
4
4
 
5
5
__author__ = "Kristian B. Oelgaard (k.b.oelgaard@tudelft.nl)"
6
 
__date__ = "2007-11-14 -- 2009-10-07"
 
6
__date__ = "2007-11-14 -- 2010-09-05"
7
7
__copyright__ = "Copyright (C) 2007 Kristian B. Oelgaard"
8
8
__license__  = "GNU LGPL Version 2.1"
9
9
 
12
12
from dolfin import *
13
13
 
14
14
# Form compiler options
15
 
parameters["form_compiler"]["cpp_optimize"] = True
16
 
parameters["form_compiler"]["optimize"] = True
 
15
#parameters["form_compiler"]["cpp_optimize"] = True
 
16
#parameters["form_compiler"]["optimize"] = True
 
17
 
 
18
set_log_level(0)
17
19
 
18
20
# Load mesh and define function space
19
21
mesh = Mesh("gear.xml.gz")
45
47
        values[1] = y - x[1]
46
48
        values[2] = z - x[2]
47
49
 
48
 
    def dim(self):
49
 
        return 3
 
50
    def value_shape(self):
 
51
        return (3,)
50
52
 
51
53
# Sub domain for rotation at right end
52
54
def right(x, on_boundary):
86
88
u = problem.solve()
87
89
 
88
90
# Save solution to VTK format
89
 
vtk_file = File("elasticity.pvd")
90
 
vtk_file << u
 
91
File("elasticity.pvd") << u
 
92
 
 
93
# Save colored mesh partitions in VTK format if running in parallel
 
94
if MPI.num_processes() > 1:
 
95
    File("partitions.pvd") << CellFunction("uint", mesh, MPI.process_number())
91
96
 
92
97
# Plot solution
93
 
plot(u, mode="displacement", interactive=True)
 
98
#plot(u, mode="displacement", interactive=True)