00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __deal2__sparsity_tools_h
00013 #define __deal2__sparsity_tools_h
00014
00015
00016 #include <deal.II/base/config.h>
00017 #include <deal.II/base/exceptions.h>
00018
00019 #include <vector>
00020
00021 #ifdef DEAL_II_COMPILER_SUPPORTS_MPI
00022 #include <mpi.h>
00023 #include <deal.II/base/index_set.h>
00024 #endif
00025
00026 DEAL_II_NAMESPACE_OPEN
00027
00028 class SparsityPattern;
00029
00030
00031
00042 namespace SparsityTools
00043 {
00100 void partition (const SparsityPattern &sparsity_pattern,
00101 const unsigned int n_partitions,
00102 std::vector<unsigned int> &partition_indices);
00103
00192 void
00193 reorder_Cuthill_McKee (const SparsityPattern &sparsity,
00194 std::vector<unsigned int> &new_indices,
00195 const std::vector<unsigned int> &starting_indices = std::vector<unsigned int>());
00196
00197
00198 #ifdef DEAL_II_COMPILER_SUPPORTS_MPI
00199
00238 template <class CSP_t>
00239 void distribute_sparsity_pattern(CSP_t & csp,
00240 const std::vector<unsigned int> & rows_per_cpu,
00241 const MPI_Comm & mpi_comm,
00242 const IndexSet & myrange);
00243 #endif
00244
00245
00249 DeclException0 (ExcMETISNotInstalled);
00253 DeclException1 (ExcInvalidNumberOfPartitions,
00254 int,
00255 << "The number of partitions you gave is " << arg1
00256 << ", but must be greater than zero.");
00260 DeclException2 (ExcInvalidArraySize,
00261 int, int,
00262 << "The array has size " << arg1 << " but should have size "
00263 << arg2);
00264 }
00265
00270 DEAL_II_NAMESPACE_CLOSE
00271
00272 #endif
00273