~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to demo/mesh/meshfunction/cpp/main.cpp

  • 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
// Copyright (C) 2006 Ola Skavhaug.
 
2
// Licensed under the GNU LGPL Version 2.1.
 
3
//
 
4
// Modified by Anders Logg, 2007.
 
5
//
 
6
// First added:  2006-11-29
 
7
// Last changed: 2007-05-09
 
8
 
 
9
#include <dolfin.h>
 
10
 
 
11
using namespace dolfin;
 
12
 
 
13
int main()
 
14
{
 
15
  Mesh mesh("../mesh2D.xml.gz");
 
16
  
 
17
  // Read mesh function from file
 
18
  File in("../meshfunction.xml");
 
19
  MeshFunction<double> f(mesh);
 
20
  in >> f;
 
21
 
 
22
  // Write mesh function to file
 
23
  File out("meshfunction_out.xml");
 
24
  out << f;
 
25
 
 
26
  // Plot mesh function
 
27
  plot(f);
 
28