Reference documentation for deal.II version 9.4.1
\(\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\}}\)
Loading...
Searching...
No Matches
sparsity_tools.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2008 - 2021 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
33
34# include <mpi.h>
35#endif
36
38
39
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
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
352#endif
353
354
359 "The function you called requires METIS, but you did not "
360 "configure deal.II with METIS.");
361
366 int,
367 << "The number of partitions you gave is " << arg1
368 << ", but must be greater than zero.");
369
374 int,
375 << " An error with error number " << arg1
376 << " occurred while calling a METIS function");
377
382 int,
383 int,
384 << "The array has size " << arg1 << " but should have size "
385 << arg2);
391 "The function you called requires ZOLTAN, but you did not "
392 "configure deal.II with ZOLTAN or zoltan_cpp.h is not available.");
393} // namespace SparsityTools
394
400
401#endif
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
static ::ExceptionBase & ExcMETISNotInstalled()
static ::ExceptionBase & ExcInvalidNumberOfPartitions(int arg1)
static ::ExceptionBase & ExcMETISError(int arg1)
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:532
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:487
static ::ExceptionBase & ExcInvalidArraySize(int arg1, int arg2)
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:509
static ::ExceptionBase & ExcZOLTANNotInstalled()
void gather_sparsity_pattern(DynamicSparsityPattern &dsp, const IndexSet &locally_owned_rows, const MPI_Comm &mpi_comm, const IndexSet &locally_relevant_rows)
unsigned int color_sparsity_pattern(const SparsityPattern &sparsity_pattern, std::vector< unsigned int > &color_indices)
void partition(const SparsityPattern &sparsity_pattern, const unsigned int n_partitions, std::vector< unsigned int > &partition_indices, const Partitioner partitioner=Partitioner::metis)
void reorder_hierarchical(const DynamicSparsityPattern &sparsity, std::vector< DynamicSparsityPattern::size_type > &new_indices)
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 >())
void distribute_sparsity_pattern(DynamicSparsityPattern &dsp, const IndexSet &locally_owned_rows, const MPI_Comm &mpi_comm, const IndexSet &locally_relevant_rows)