/usr/include/libmesh/parmetis_partitioner.h is in libmesh-dev 0.7.1-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | // $Id: parmetis_partitioner.h 3930 2010-08-24 23:04:08Z roystgnr $
// The libMesh Finite Element Library.
// Copyright (C) 2002-2008 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef __parmetis_partitioner_h__
#define __parmetis_partitioner_h__
// C++ Includes -----------------------------------
#include <vector>
#include <map>
// Local Includes -----------------------------------
#include "partitioner.h"
namespace libMesh
{
/**
* The \p ParmetisPartitioner uses the Parmetis graph partitioner
* to partition the elements.
*/
// ------------------------------------------------------------
// ParmetisPartitioner class definition
class ParmetisPartitioner : public Partitioner
{
public:
/**
* Constructor.
*/
ParmetisPartitioner () {}
/**
* Creates a new partitioner of this type and returns it in
* an \p AutoPtr.
*/
virtual AutoPtr<Partitioner> clone () const {
AutoPtr<Partitioner> cloned_partitioner
(new ParmetisPartitioner());
return cloned_partitioner;
}
protected:
/**
* Parmetis can handle dynamically repartitioning a mesh such
* that the redistribution costs are minimized. This method
* takes a previously partitioned domain (which may have
* then been adaptively refined) and repartitions it.
*/
virtual void _do_repartition (MeshBase& mesh,
const unsigned int n);
/**
* Partition the \p MeshBase into \p n subdomains.
*/
virtual void _do_partition (MeshBase& mesh,
const unsigned int n);
private:
// These methods & data only need to be available if the
// ParMETIS library is available.
#ifdef LIBMESH_HAVE_PARMETIS
/**
* Initialize data structures.
*/
void initialize (const MeshBase& mesh, const unsigned int n_sbdmns);
/**
* Build the graph.
*/
void build_graph (const MeshBase& mesh);
/**
* Assign the computed partitioning to the mesh.
*/
void assign_partitioning (MeshBase& mesh);
/**
* The number of active elements on each processor. Note that
* ParMETIS requires that each processor have some active elements,
* it will abort if any processor passes a NULL _part array.
*/
std::vector<unsigned int> _n_active_elem_on_proc;
/**
* Maps active element ids into a contiguous range, as needed by ParMETIS.
*/
std::map<unsigned int, unsigned int> _global_index_by_pid_map;
/**
* Data structures used by ParMETIS to describe the connectivity graph
* of the mesh. Consult the ParMETIS documentation.
*/
std::vector<int> _vtxdist;
std::vector<int> _xadj;
std::vector<int> _adjncy;
std::vector<int> _part;
std::vector<float> _tpwgts;
std::vector<float> _ubvec;
std::vector<int> _options;
std::vector<int> _vwgt;
int _wgtflag;
int _ncon;
int _numflag;
int _nparts;
int _edgecut;
#endif
};
} // namespace libMesh
#endif // #define __parmetis_partitioner_h__
|