Reference documentation for deal.II version 9.2.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 
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
SparsityTools::ExcMETISError
static ::ExceptionBase & ExcMETISError(int arg1)
SparsityTools::ExcZOLTANNotInstalled
static ::ExceptionBase & ExcZOLTANNotInstalled()
DeclExceptionMsg
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:496
IndexSet
Definition: index_set.h:74
dynamic_sparsity_pattern.h
SparsityTools::gather_sparsity_pattern
void gather_sparsity_pattern(DynamicSparsityPattern &dsp, const IndexSet &locally_owned_rows, const MPI_Comm &mpi_comm, const IndexSet &locally_relevant_rows)
Definition: sparsity_tools.cc:932
SparsityTools::reorder_Cuthill_McKee
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 >())
Definition: sparsity_tools.cc:580
SparsityTools::ExcInvalidArraySize
static ::ExceptionBase & ExcInvalidArraySize(int arg1, int arg2)
MPI_Comm
BlockDynamicSparsityPattern
Definition: block_sparsity_pattern.h:521
block_sparsity_pattern.h
SparsityTools::partition
void partition(const SparsityPattern &sparsity_pattern, const unsigned int n_partitions, std::vector< unsigned int > &partition_indices, const Partitioner partitioner=Partitioner::metis)
Definition: sparsity_tools.cc:400
SparsityTools::ExcMETISNotInstalled
static ::ExceptionBase & ExcMETISNotInstalled()
SparsityTools::Partitioner
Partitioner
Definition: sparsity_tools.h:55
SparsityTools
Definition: sparsity_tools.h:50
mpi.h
index_set.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
SparsityTools::color_sparsity_pattern
unsigned int color_sparsity_pattern(const SparsityPattern &sparsity_pattern, std::vector< unsigned int > &color_indices)
Definition: sparsity_tools.cc:456
DynamicSparsityPattern
Definition: dynamic_sparsity_pattern.h:323
SparsityPattern
Definition: sparsity_pattern.h:865
SparsityTools::ExcInvalidNumberOfPartitions
static ::ExceptionBase & ExcInvalidNumberOfPartitions(int arg1)
DEAL_II_DEPRECATED
#define DEAL_II_DEPRECATED
Definition: config.h:98
DeclException1
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:518
SparsityTools::Partitioner::metis
@ metis
sparsity_pattern.h
SparsityTools::Partitioner::zoltan
@ zoltan
exceptions.h
SparsityTools::distribute_sparsity_pattern
void distribute_sparsity_pattern(DynamicSparsityPattern &dsp, const IndexSet &locally_owned_rows, const MPI_Comm &mpi_comm, const IndexSet &locally_relevant_rows)
Definition: sparsity_tools.cc:1046
config.h
SparsityTools::reorder_hierarchical
void reorder_hierarchical(const DynamicSparsityPattern &sparsity, std::vector< DynamicSparsityPattern::size_type > &new_indices)
Definition: sparsity_tools.cc:901
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
DeclException2
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:541