~ubuntu-branches/ubuntu/maverick/dolfin/maverick

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2008-09-16 08:41:20 UTC
  • Revision ID: james.westby@ubuntu.com-20080916084120-i8k3u6lhx3mw3py3
Tags: upstream-0.9.2
ImportĀ upstreamĀ versionĀ 0.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2008 Ola Skavhaug and Anders Logg.
 
2
// Licensed under the GNU LGPL Version 2.1.
 
3
//
 
4
// First added:  2008-12-18
 
5
// Last changed: 2008-12-18
 
6
//
 
7
// Run this demo in parallel by
 
8
//
 
9
//     mpirun -n <n> ./demo
 
10
//
 
11
// where <n> is the desired number of processes.
 
12
// Then plot the partitions by
 
13
//
 
14
//     ./plotpartitions <n>
 
15
 
 
16
#include <dolfin.h>
 
17
 
 
18
using namespace dolfin;
 
19
 
 
20
int main()
 
21
{
 
22
  // Read in mesh from XML file in parallel
 
23
  Mesh mesh("unitsquare.xml.gz");
 
24
  
 
25
  // Store partition to file
 
26
  char filename[100];
 
27
  sprintf(filename, "unitsquare-%d.xml", dolfin::MPI::process_number());
 
28
  File file(filename);
 
29
  file << mesh;
 
30
 
 
31
  return 0;
 
32
}