Reference documentation for deal.II version Git e3a3ec7800 2020-08-07 14:08:19 +0200
\(\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 
285  void
288  const std::vector<DynamicSparsityPattern::size_type> &rows_per_cpu,
289  const MPI_Comm & mpi_comm,
290  const IndexSet & myrange);
291 
306  void
308  const IndexSet & locally_owned_rows,
309  const MPI_Comm & mpi_comm,
310  const IndexSet &locally_relevant_rows);
311 
316  void
318  const std::vector<IndexSet> &owned_set_per_cpu,
319  const MPI_Comm & mpi_comm,
320  const IndexSet & myrange);
321 
345  void
347  const IndexSet & locally_owned_rows,
348  const MPI_Comm & mpi_comm,
349  const IndexSet & locally_relevant_rows);
350 
355  DEAL_II_DEPRECATED void
357  const std::vector<IndexSet> &owned_rows_per_processor,
358  const MPI_Comm & mpi_comm,
359  const IndexSet & ghost_range);
360 
361 #endif
362 
363 
368  "The function you called requires METIS, but you did not "
369  "configure deal.II with METIS.");
370 
375  int,
376  << "The number of partitions you gave is " << arg1
377  << ", but must be greater than zero.");
378 
383  int,
384  << " An error with error number " << arg1
385  << " occurred while calling a METIS function");
386 
391  int,
392  int,
393  << "The array has size " << arg1 << " but should have size "
394  << arg2);
400  "The function you called requires ZOLTAN, but you did not "
401  "configure deal.II with ZOLTAN or zoltan_cpp.h is not available.");
402 } // namespace SparsityTools
403 
409 
410 #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:363
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:362
#define DEAL_II_DEPRECATED
Definition: config.h:152
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)