~njansson/dolfin/hpc

« back to all changes in this revision

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

  • Committer: Johannes Ring
  • Date: 2008-03-05 22:43:06 UTC
  • Revision ID: johannr@simula.no-20080305224306-2npsdyhfdpl2esji
The BIG commit!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Demonstration of MeshFunction
 
2
#
 
3
# Original implementation: ../cpp/main.cpp by Ola Skavhaug.
 
4
#
 
5
__author__ = "Kristian B. Oelgaard (k.b.oelgaard@tudelft.nl)"
 
6
__date__ = "2007-11-15 -- 2007-11-28"
 
7
__copyright__ = "Copyright (C) 2007 Kristian B. Oelgaard"
 
8
__license__  = "GNU LGPL Version 2.1"
 
9
 
 
10
from dolfin import *
 
11
 
 
12
mesh = Mesh("../mesh2D.xml.gz")
 
13
 
 
14
# Read mesh function from file
 
15
file_in = File("../meshfunction.xml")
 
16
f = MeshFunction("real", mesh)
 
17
file_in >> f
 
18
 
 
19
# Write mesh function to file
 
20
out = File("meshfunction_out.xml");
 
21
out << f
 
22
 
 
23
# Plot mesh function
 
24
plot(f)
 
25