Reference documentation for deal.II version 9.3.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
sparsity_tools.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2008 - 2020 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.md at
12 // the top level directory of deal.II.
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 
23 
27 
28 #include <memory>
29 #include <vector>
30 
31 #ifdef DEAL_II_WITH_MPI
32 # include <deal.II/base/index_set.h>
33 
34 # include <mpi.h>
35 #endif
36 
38 
39 
50 namespace SparsityTools
51 {
55  enum class Partitioner
56  {
60  metis = 0,
64  zoltan
65  };
66 
67 
103  void
104  partition(const SparsityPattern & sparsity_pattern,
105  const unsigned int n_partitions,
106  std::vector<unsigned int> &partition_indices,
107  const Partitioner partitioner = Partitioner::metis);
108 
109 
120  void
121  partition(const SparsityPattern & sparsity_pattern,
122  const std::vector<unsigned int> &cell_weights,
123  const unsigned int n_partitions,
124  std::vector<unsigned int> & partition_indices,
125  const Partitioner partitioner = Partitioner::metis);
126 
159  unsigned int
160  color_sparsity_pattern(const SparsityPattern & sparsity_pattern,
161  std::vector<unsigned int> &color_indices);
162 
212  void
214  const DynamicSparsityPattern & sparsity,
215  std::vector<DynamicSparsityPattern::size_type> & new_indices,
216  const std::vector<DynamicSparsityPattern::size_type> &starting_indices =
217  std::vector<DynamicSparsityPattern::size_type>());
218 
240  void
242  const DynamicSparsityPattern & sparsity,
243  std::vector<DynamicSparsityPattern::size_type> &new_indices);
244 
245 #ifdef DEAL_II_WITH_MPI
246 
270  void
272  const IndexSet & locally_owned_rows,
273  const MPI_Comm & mpi_comm,
274  const IndexSet & locally_relevant_rows);
275 
286  void
289  const std::vector<DynamicSparsityPattern::size_type> &rows_per_cpu,
290  const MPI_Comm & mpi_comm,
291  const IndexSet & myrange);
292 
307  void
309  const IndexSet & locally_owned_rows,
310  const MPI_Comm & mpi_comm,
311  const IndexSet &locally_relevant_rows);
312 
317  void
319  const std::vector<IndexSet> &owned_set_per_cpu,
320  const MPI_Comm & mpi_comm,
321  const IndexSet & myrange);
322 
346  void
348  const IndexSet & locally_owned_rows,
349  const MPI_Comm & mpi_comm,
350  const IndexSet & locally_relevant_rows);
351 
356  DEAL_II_DEPRECATED void
358  const std::vector<IndexSet> &owned_rows_per_processor,
359  const MPI_Comm & mpi_comm,
360  const IndexSet & ghost_range);
361 
362 #endif
363 
364 
369  "The function you called requires METIS, but you did not "
370  "configure deal.II with METIS.");
371 
376  int,
377  << "The number of partitions you gave is " << arg1
378  << ", but must be greater than zero.");
379 
384  int,
385  << " An error with error number " << arg1
386  << " occurred while calling a METIS function");
387 
392  int,
393  int,
394  << "The array has size " << arg1 << " but should have size "
395  << arg2);
401  "The function you called requires ZOLTAN, but you did not "
402  "configure deal.II with ZOLTAN or zoltan_cpp.h is not available.");
403 } // namespace SparsityTools
404 
410 
411 #endif
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:538
void gather_sparsity_pattern(DynamicSparsityPattern &dsp, const IndexSet &locally_owned_rows, const MPI_Comm &mpi_comm, const IndexSet &locally_relevant_rows)
static ::ExceptionBase & ExcMETISNotInstalled()
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 >())
static ::ExceptionBase & ExcInvalidNumberOfPartitions(int arg1)
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:515
void partition(const SparsityPattern &sparsity_pattern, const unsigned int n_partitions, std::vector< unsigned int > &partition_indices, const Partitioner partitioner=Partitioner::metis)
static ::ExceptionBase & ExcInvalidArraySize(int arg1, int arg2)
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:493
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:395
void reorder_hierarchical(const DynamicSparsityPattern &sparsity, std::vector< DynamicSparsityPattern::size_type > &new_indices)
static ::ExceptionBase & ExcZOLTANNotInstalled()
unsigned int color_sparsity_pattern(const SparsityPattern &sparsity_pattern, std::vector< unsigned int > &color_indices)
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:394
#define DEAL_II_DEPRECATED
Definition: config.h:157
void distribute_sparsity_pattern(DynamicSparsityPattern &dsp, const IndexSet &locally_owned_rows, const MPI_Comm &mpi_comm, const IndexSet &locally_relevant_rows)
static ::ExceptionBase & ExcMETISError(int arg1)