Reference documentation for deal.II version 8.4.2
sparsity_tools.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2008 - 2016 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__sparsity_tools_h
17 #define dealii__sparsity_tools_h
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/base/exceptions.h>
22 #include <deal.II/lac/block_sparsity_pattern.h>
23 #include <deal.II/lac/dynamic_sparsity_pattern.h>
24 #include <deal.II/lac/sparsity_pattern.h>
25 
26 #include <vector>
27 
28 #ifdef DEAL_II_WITH_MPI
29 #include <mpi.h>
30 #include <deal.II/base/index_set.h>
31 #endif
32 
33 DEAL_II_NAMESPACE_OPEN
34 
35 
46 namespace SparsityTools
47 {
80  void partition (const SparsityPattern &sparsity_pattern,
81  const unsigned int n_partitions,
82  std::vector<unsigned int> &partition_indices);
83 
133  void
135  std::vector<DynamicSparsityPattern::size_type> &new_indices,
136  const std::vector<DynamicSparsityPattern::size_type> &starting_indices = std::vector<DynamicSparsityPattern::size_type>());
137 
143  void
144  reorder_Cuthill_McKee (const SparsityPattern &sparsity,
145  std::vector<SparsityPattern::size_type> &new_indices,
146  const std::vector<SparsityPattern::size_type> &starting_indices = std::vector<SparsityPattern::size_type>()) DEAL_II_DEPRECATED;
147 
169  void
171  std::vector<DynamicSparsityPattern::size_type> &new_indices);
172 
173 #ifdef DEAL_II_WITH_MPI
174 
200  const std::vector<DynamicSparsityPattern::size_type> &rows_per_cpu,
201  const MPI_Comm &mpi_comm,
202  const IndexSet &myrange);
203 
218  const std::vector<IndexSet> &owned_set_per_cpu,
219  const MPI_Comm &mpi_comm,
220  const IndexSet &myrange);
221 
222 #endif
223 
224 
228  DeclException0 (ExcMETISNotInstalled);
232  DeclException1 (ExcInvalidNumberOfPartitions,
233  int,
234  << "The number of partitions you gave is " << arg1
235  << ", but must be greater than zero.");
236 
240  DeclException1 (ExcMETISError,
241  int,
242  << " An error with error number " << arg1
243  << " occurred while calling a METIS function");
244 
248  DeclException2 (ExcInvalidArraySize,
249  int, int,
250  << "The array has size " << arg1 << " but should have size "
251  << arg2);
252 }
253 
258 DEAL_II_NAMESPACE_CLOSE
259 
260 #endif
void reorder_Cuthill_McKee(const DynamicSparsityPattern &sparsity, std::vector< DynamicSparsityPattern::size_type > &new_indices, const std::vector< DynamicSparsityPattern::size_type > &starting_indices=std::vector< DynamicSparsityPattern::size_type >())
#define DEAL_II_DEPRECATED
Definition: config.h:88
void partition(const SparsityPattern &sparsity_pattern, const unsigned int n_partitions, std::vector< unsigned int > &partition_indices)
void distribute_sparsity_pattern(DynamicSparsityPattern &dsp, const std::vector< DynamicSparsityPattern::size_type > &rows_per_cpu, const MPI_Comm &mpi_comm, const IndexSet &myrange)
DeclException0(ExcMETISNotInstalled)
void reorder_hierarchical(const DynamicSparsityPattern &sparsity, std::vector< DynamicSparsityPattern::size_type > &new_indices)
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.")