Reference documentation for deal.II version GIT relicensing-837-gaf73e64026 2024-06-15 22:40:02+00:00
\(\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// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2008 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_sparsity_tools_h
16#define dealii_sparsity_tools_h
17
18
19#include <deal.II/base/config.h>
20
24
28
29#include <memory>
30#include <vector>
31
33
34
47{
51 enum class Partitioner
52 {
56 metis = 0,
60 zoltan
61 };
62
63
99 void
100 partition(const SparsityPattern &sparsity_pattern,
101 const unsigned int n_partitions,
102 std::vector<unsigned int> &partition_indices,
103 const Partitioner partitioner = Partitioner::metis);
104
105
116 void
117 partition(const SparsityPattern &sparsity_pattern,
118 const std::vector<unsigned int> &cell_weights,
119 const unsigned int n_partitions,
120 std::vector<unsigned int> &partition_indices,
121 const Partitioner partitioner = Partitioner::metis);
122
155 unsigned int
156 color_sparsity_pattern(const SparsityPattern &sparsity_pattern,
157 std::vector<unsigned int> &color_indices);
158
208 void
210 const DynamicSparsityPattern &sparsity,
211 std::vector<DynamicSparsityPattern::size_type> &new_indices,
212 const std::vector<DynamicSparsityPattern::size_type> &starting_indices =
213 std::vector<DynamicSparsityPattern::size_type>());
214
236 void
238 const DynamicSparsityPattern &sparsity,
239 std::vector<DynamicSparsityPattern::size_type> &new_indices);
240
241#ifdef DEAL_II_WITH_MPI
266 void
268 const IndexSet &locally_owned_rows,
269 const MPI_Comm mpi_comm,
270 const IndexSet &locally_relevant_rows);
271
282 void
285 const std::vector<DynamicSparsityPattern::size_type> &rows_per_cpu,
286 const MPI_Comm mpi_comm,
287 const IndexSet &myrange);
288
303 void
305 const IndexSet &locally_owned_rows,
306 const MPI_Comm mpi_comm,
307 const IndexSet &locally_relevant_rows);
308
313 void
315 const std::vector<IndexSet> &owned_set_per_cpu,
316 const MPI_Comm mpi_comm,
317 const IndexSet &myrange);
318
342 void
344 const IndexSet &locally_owned_rows,
345 const MPI_Comm mpi_comm,
346 const IndexSet &locally_relevant_rows);
347
348#endif
349
350
355 "The function you called requires METIS, but you did not "
356 "configure deal.II with METIS.");
357
362 int,
363 << "The number of partitions you gave is " << arg1
364 << ", but must be greater than zero.");
365
370 int,
371 << " An error with error number " << arg1
372 << " occurred while calling a METIS function");
373
378 int,
379 int,
380 << "The array has size " << arg1 << " but should have size "
381 << arg2);
387 "The function you called requires ZOLTAN, but you did not "
388 "configure deal.II with ZOLTAN or zoltan_cpp.h is not available.");
389} // namespace SparsityTools
390
396
397#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
static ::ExceptionBase & ExcMETISNotInstalled()
static ::ExceptionBase & ExcInvalidNumberOfPartitions(int arg1)
static ::ExceptionBase & ExcMETISError(int arg1)
#define DeclException2(Exception2, type1, type2, outsequence)
Definition exceptions.h:539
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:494
static ::ExceptionBase & ExcInvalidArraySize(int arg1, int arg2)
#define DeclException1(Exception1, type1, outsequence)
Definition exceptions.h:516
static ::ExceptionBase & ExcZOLTANNotInstalled()
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 distribute_sparsity_pattern(DynamicSparsityPattern &dsp, const IndexSet &locally_owned_rows, const MPI_Comm mpi_comm, const IndexSet &locally_relevant_rows)
void gather_sparsity_pattern(DynamicSparsityPattern &dsp, const IndexSet &locally_owned_rows, const MPI_Comm mpi_comm, const IndexSet &locally_relevant_rows)
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 >())