Reference documentation for deal.II version 8.1.0
sparsity_tools.h
1 // ---------------------------------------------------------------------
2 // @f$Id: sparsity_tools.h 31932 2013-12-08 02:15:54Z heister @f$
3 //
4 // Copyright (C) 2008 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__sparsity_tools_h
18 #define __deal2__sparsity_tools_h
19 
20 
21 #include <deal.II/base/config.h>
23 
24 #include <vector>
25 
26 #ifdef DEAL_II_WITH_MPI
27 #include <mpi.h>
28 #include <deal.II/base/index_set.h>
29 #endif
30 
32 
33 class SparsityPattern;
34 
35 
36 
47 namespace SparsityTools
48 {
53 
110  void partition (const SparsityPattern &sparsity_pattern,
111  const unsigned int n_partitions,
112  std::vector<unsigned int> &partition_indices);
113 
202  void
203  reorder_Cuthill_McKee (const SparsityPattern &sparsity,
204  std::vector<size_type> &new_indices,
205  const std::vector<size_type> &starting_indices = std::vector<size_type>());
206 
207 
208 #ifdef DEAL_II_WITH_MPI
209 
250  template <class CSP_t>
251  void distribute_sparsity_pattern(CSP_t &csp,
252  const std::vector<size_type> &rows_per_cpu,
253  const MPI_Comm &mpi_comm,
254  const IndexSet &myrange);
255 
262  template <class CSP_t>
263  void distribute_sparsity_pattern(CSP_t &csp,
264  const std::vector<IndexSet> &owned_set_per_cpu,
265  const MPI_Comm &mpi_comm,
266  const IndexSet &myrange);
267 
268 #endif
269 
270 
274  DeclException0 (ExcMETISNotInstalled);
278  DeclException1 (ExcInvalidNumberOfPartitions,
279  int,
280  << "The number of partitions you gave is " << arg1
281  << ", but must be greater than zero.");
282 
286  DeclException1 (ExcMETISError,
287  int,
288  << " An error with error number " << arg1
289  << " occurred while calling a METIS function");
290 
294  DeclException2 (ExcInvalidArraySize,
295  int, int,
296  << "The array has size " << arg1 << " but should have size "
297  << arg2);
298 }
299 
304 DEAL_II_NAMESPACE_CLOSE
305 
306 #endif
void reorder_Cuthill_McKee(const SparsityPattern &sparsity, std::vector< size_type > &new_indices, const std::vector< size_type > &starting_indices=std::vector< size_type >())
void partition(const SparsityPattern &sparsity_pattern, const unsigned int n_partitions, std::vector< unsigned int > &partition_indices)
unsigned int global_dof_index
Definition: types.h:100
DeclException0(ExcMETISNotInstalled)
DeclException2(ExcInvalidArraySize, int, int,<< "The array has size "<< arg1<< " but should have size "<< arg2)
DeclException1(ExcInvalidNumberOfPartitions, int,<< "The number of partitions you gave is "<< arg1<< ", but must be greater than zero.")
types::global_dof_index size_type
void distribute_sparsity_pattern(CSP_t &csp, const std::vector< size_type > &rows_per_cpu, const MPI_Comm &mpi_comm, const IndexSet &myrange)