~njansson/dolfin/hpc

« back to all changes in this revision

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

  • Committer: Garth N. Wells
  • Date: 2008-03-29 09:34:25 UTC
  • Revision ID: gnw20@cam.ac.uk-20080329093425-3ea2vhjvccq56zvi
Add some basic build & install instructions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (C) 2008 Anders Logg and Magnus Vikström.
 
1
// Copyright (C) 2007 Anders Logg and Magnus Vikström.
2
2
// Licensed under the GNU LGPL Version 2.1.
3
3
//
4
4
// First added:  2007-05-08
5
 
// Last changed: 2008-04-11
 
5
// Last changed: 2007-12-18
6
6
 
7
7
#include <dolfin.h>
8
8
 
10
10
 
11
11
int main()
12
12
{
13
 
#ifndef HAS_SCOTCH
14
 
  message("Sorry, this demo requires SCOTCH.");
15
 
  return 0;
16
 
#endif
17
 
 
18
13
  // Create mesh
19
14
  UnitCube mesh(16, 16, 16);
20
15
 
22
17
  MeshFunction<unsigned int> partitions;
23
18
  mesh.partition(partitions, 20);
24
19
 
 
20
  // Display partition
 
21
  partitions.disp();
 
22
 
25
23
  // Plot mesh partition
26
24
  plot(partitions);
27
25
 
28
 
  return 0;
29
26
}