34 #ifndef initialization_hpp 35 #define initialization_hpp 45 #include <schwarz/config.hpp> 49 #include <deal.II/lac/sparse_matrix.h> 53 #include <partition_tools.hpp> 54 #include <settings.hpp> 70 template <
typename ValueType = gko::default_precision,
71 typename IndexType = gko::int32>
103 const dealii::SparseMatrix<ValueType> &matrix,
104 std::shared_ptr<gko::matrix::Csr<ValueType, IndexType>> &global_matrix);
108 std::shared_ptr<gko::matrix::Csr<ValueType, IndexType>> &global_matrix);
122 const std::shared_ptr<gko::matrix::Csr<ValueType, IndexType>>
124 std::vector<unsigned int> &partition_indices);
139 std::vector<ValueType> &rhs,
140 std::shared_ptr<gko::matrix::Dense<ValueType>> &local_rhs,
141 std::shared_ptr<gko::matrix::Dense<ValueType>> &global_rhs,
142 std::shared_ptr<gko::matrix::Dense<ValueType>> &local_solution);
160 std::vector<unsigned int> &partition_indices,
161 std::shared_ptr<gko::matrix::Csr<ValueType, IndexType>> &global_matrix,
162 std::shared_ptr<gko::matrix::Csr<ValueType, IndexType>> &local_matrix,
163 std::shared_ptr<gko::matrix::Csr<ValueType, IndexType>>
164 &interface_matrix) = 0;
174 #endif // initialization.hpp void setup_vectors(const Settings &settings, const Metadata< ValueType, IndexType > &metadata, std::vector< ValueType > &rhs, std::shared_ptr< gko::matrix::Dense< ValueType >> &local_rhs, std::shared_ptr< gko::matrix::Dense< ValueType >> &global_rhs, std::shared_ptr< gko::matrix::Dense< ValueType >> &local_solution)
Setup the vectors with default values and allocate mameory if not allocated.
Definition: initialization.cpp:333
virtual void setup_local_matrices(Settings &settings, Metadata< ValueType, IndexType > &metadata, std::vector< unsigned int > &partition_indices, std::shared_ptr< gko::matrix::Csr< ValueType, IndexType >> &global_matrix, std::shared_ptr< gko::matrix::Csr< ValueType, IndexType >> &local_matrix, std::shared_ptr< gko::matrix::Csr< ValueType, IndexType >> &interface_matrix)=0
Sets up the local and the interface matrices from the global matrix and the partition indices...
Definition: initialization.cpp:79
void partition(const Settings &settings, const Metadata< ValueType, IndexType > &metadata, const std::shared_ptr< gko::matrix::Csr< ValueType, IndexType >> &global_matrix, std::vector< unsigned int > &partition_indices)
The partitioning function.
Definition: initialization.cpp:279
The struct that contains the solver settings and the parameters to be set by the user.
Definition: settings.hpp:77
std::vector< unsigned int > cell_weights
The cell weights for the partition algorithm.
Definition: initialization.hpp:85
The Schwarz wrappers namespace.
Definition: comm_helpers.hpp:49
The initialization class that provides methods for initialization of the solver.
Definition: initialization.hpp:72
std::vector< unsigned int > partition_indices
The partition indices containing the subdomains to which each row(vertex) of the matrix(graph) belong...
Definition: initialization.hpp:80
void generate_rhs(std::vector< ValueType > &rhs)
Generates the right hand side vector.
Definition: initialization.cpp:89
void setup_global_matrix(const std::string &filename, const gko::size_type &oned_laplacian_size, std::shared_ptr< gko::matrix::Csr< ValueType, IndexType >> &global_matrix)
Generates the 2D global laplacian matrix.
Definition: initialization.cpp:197