~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/kernel/mesh/MeshPartition.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) 2007 Magnus Vikstrom.
2
 
// Licensed under the GNU LGPL Version 2.1.
3
 
//
4
 
// Modified by Anders Logg, 2008.
5
 
//
6
 
// First added:  2007-04-03
7
 
// Last changed: 2008-02-11
8
 
 
9
 
#include <dolfin/Graph.h>
10
 
#include <dolfin/GraphPartition.h>
11
 
#include <dolfin/MeshPartition.h>
12
 
#include <dolfin/MeshFunction.h>
13
 
#include <dolfin/parameters.h>
14
 
 
15
 
using namespace dolfin;
16
 
 
17
 
//-----------------------------------------------------------------------------
18
 
void MeshPartition::partition(Mesh& mesh,
19
 
                              MeshFunction<uint>& partitions,
20
 
                              uint num_partitions)
21
 
{
22
 
  partitions.init(mesh, mesh.topology().dim());
23
 
  Graph graph(mesh);
24
 
  GraphPartition::partition(graph, num_partitions, partitions.values());
25
 
 
26
 
  bool report_edge_cut = dolfin_get("report edge cut");
27
 
  if(report_edge_cut)
28
 
    GraphPartition::edgecut(graph, num_partitions, partitions.values());
29
 
}
30
 
//-----------------------------------------------------------------------------