Ifpack2 Templated Preconditioning Package Version 1.0
Loading...
Searching...
No Matches
Ifpack2_LinePartitioner_decl.hpp
1// @HEADER
2// *****************************************************************************
3// Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
4//
5// Copyright 2009 NTESS and the Ifpack2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef IFPACK2_LINEPARTITIONER_DECL_HPP
11#define IFPACK2_LINEPARTITIONER_DECL_HPP
12
13#include "Ifpack2_ConfigDefs.hpp"
14#include "Ifpack2_OverlappingPartitioner.hpp"
15#include "Teuchos_ScalarTraits.hpp"
16#include "Tpetra_MultiVector.hpp"
17
18namespace Ifpack2 {
19
21
43
44template <class GraphType, class Scalar>
45class LinePartitioner : public OverlappingPartitioner<GraphType> {
46 public:
47 typedef typename GraphType::local_ordinal_type local_ordinal_type;
48 typedef typename GraphType::global_ordinal_type global_ordinal_type;
49 typedef typename GraphType::node_type node_type;
50 typedef Tpetra::RowGraph<local_ordinal_type, global_ordinal_type, node_type> row_graph_type;
51 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType magnitude_type;
52 typedef Tpetra::MultiVector<magnitude_type, local_ordinal_type, global_ordinal_type, node_type> multivector_type;
53
54 typedef typename row_graph_type::nonconst_global_inds_host_view_type nonconst_global_inds_host_view_type;
55 typedef typename row_graph_type::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
56
58 LinePartitioner(const Teuchos::RCP<const row_graph_type>& graph);
59
61 virtual ~LinePartitioner();
62
64 void setPartitionParameters(Teuchos::ParameterList& List);
65
67 void computePartitions();
68
69 private:
70 // Useful functions
71 int Compute_Blocks_AutoLine(Teuchos::ArrayView<local_ordinal_type> blockIndices) const;
72 void local_automatic_line_search(int NumEqns, Teuchos::ArrayView<local_ordinal_type> blockIndices, local_ordinal_type last, local_ordinal_type next, local_ordinal_type LineID, double tol, Teuchos::Array<local_ordinal_type> itemp, Teuchos::Array<magnitude_type> dtemp) const;
73
74 // User data
75 int NumEqns_;
76 Teuchos::RCP<multivector_type> coord_;
77 double threshold_;
78};
79
80} // namespace Ifpack2
81
82#endif // IFPACK2_LINEPARTITIONER_DECL_HPP
Ifpack2::LinePartitioner: A class to define partitions into a set of lines.
Definition Ifpack2_LinePartitioner_decl.hpp:45
void setPartitionParameters(Teuchos::ParameterList &List)
Set the partitioner's parameters (none for linear partitioning).
Definition Ifpack2_LinePartitioner_def.hpp:37
virtual ~LinePartitioner()
Destructor.
Definition Ifpack2_LinePartitioner_def.hpp:33
void computePartitions()
Compute the partitions.
Definition Ifpack2_LinePartitioner_def.hpp:50
Create overlapping partitions of a local graph.
Definition Ifpack2_OverlappingPartitioner_decl.hpp:45
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:40