schwz  Generated automatically from develop
Public Member Functions | Public Attributes | List of all members
schwz::SchwarzBase< ValueType, IndexType, MixedValueType > Class Template Reference

The Base solver class is meant to be the class implementing the common implementations for all the schwarz methods. More...

#include <schwarz_base.hpp>

Collaboration diagram for schwz::SchwarzBase< ValueType, IndexType, MixedValueType >:
[legend]

Public Member Functions

 SchwarzBase (Settings &settings, Metadata< ValueType, IndexType > &metadata)
 The constructor that takes in the user settings and a metadata struct containing the solver metadata. More...
 
void initialize ()
 Initialize the matrix and vectors.
 
void run (std::shared_ptr< gko::matrix::Dense< ValueType >> &solution)
 The function that runs the actual solver and obtains the final solution. More...
 
void print_vector (const std::shared_ptr< gko::matrix::Dense< ValueType >> &vector, int subd, std::string name)
 The auxiliary function that prints a passed in vector. More...
 
void print_matrix (const std::shared_ptr< gko::matrix::Csr< ValueType, IndexType >> &matrix, int rank, std::string name)
 The auxiliary function that prints a passed in CSR matrix. More...
 
- Public Member Functions inherited from schwz::Initialize< ValueType, IndexType >
 Initialize (Settings &settings, Metadata< ValueType, IndexType > &metadata)
 
void generate_rhs (std::vector< ValueType > &rhs)
 Generates the right hand side vector. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from schwz::Settings
 Settings (std::string executor_string="reference")
 
- Public Member Functions inherited from schwz::Communicate< ValueType, IndexType, MixedValueType >
virtual void setup_comm_buffers ()=0
 Sets up the communication buffers needed for the boundary exchange.
 
virtual void setup_windows (const Settings &settings, const Metadata< ValueType, IndexType > &metadata, std::shared_ptr< gko::matrix::Dense< ValueType >> &main_buffer)=0
 Sets up the windows needed for the asynchronous communication. More...
 
virtual void exchange_boundary (const Settings &settings, const Metadata< ValueType, IndexType > &metadata, std::shared_ptr< gko::matrix::Dense< ValueType >> &global_solution)=0
 Exchanges the elements of the solution vector. More...
 
void local_to_global_vector (const Settings &settings, const Metadata< ValueType, IndexType > &metadata, const std::shared_ptr< gko::matrix::Dense< ValueType >> &local_vector, std::shared_ptr< gko::matrix::Dense< ValueType >> &global_vector)
 Transforms data from a local vector to a global vector. More...
 
virtual void update_boundary (const Settings &settings, const Metadata< ValueType, IndexType > &metadata, std::shared_ptr< gko::matrix::Dense< ValueType >> &local_solution, const std::shared_ptr< gko::matrix::Dense< ValueType >> &local_rhs, const std::shared_ptr< gko::matrix::Dense< ValueType >> &global_solution, const std::shared_ptr< gko::matrix::Csr< ValueType, IndexType >> &interface_matrix)=0
 Update the values into local vector from obtained from the neighboring sub-domains using the interface matrix. More...
 
void clear (Settings &settings)
 Clears the data.
 
- Public Member Functions inherited from schwz::Solve< ValueType, IndexType, MixedValueType >
 Solve (const Settings &settings)
 

Public Attributes

std::shared_ptr< gko::matrix::Csr< ValueType, IndexType > > local_matrix
 The local subdomain matrix.
 
std::shared_ptr< gko::matrix::Permutation< IndexType > > local_perm
 The local subdomain permutation matrix/array.
 
std::shared_ptr< gko::matrix::Permutation< IndexType > > local_inv_perm
 The local subdomain inverse permutation matrix/array.
 
std::shared_ptr< gko::matrix::Csr< ValueType, IndexType > > triangular_factor_l
 The local lower triangular factor used for the triangular solves.
 
std::shared_ptr< gko::matrix::Csr< ValueType, IndexType > > triangular_factor_u
 The local upper triangular factor used for the triangular solves.
 
std::shared_ptr< gko::matrix::Csr< ValueType, IndexType > > interface_matrix
 The local interface matrix.
 
std::shared_ptr< gko::matrix::Csr< ValueType, IndexType > > global_matrix
 The global matrix.
 
std::shared_ptr< gko::matrix::Dense< ValueType > > local_rhs
 The local right hand side.
 
std::shared_ptr< gko::matrix::Dense< ValueType > > global_rhs
 The global right hand side.
 
std::shared_ptr< gko::matrix::Dense< ValueType > > local_solution
 The local solution vector.
 
std::shared_ptr< gko::matrix::Dense< ValueType > > global_solution
 The global solution vector.
 
std::vector< ValueType > local_residual_vector_out
 The global residual vector.
 
std::vector< std::vector< ValueType > > global_residual_vector_out
 The local residual vector.
 
- Public Attributes inherited from schwz::Initialize< ValueType, IndexType >
std::vector< unsigned int > partition_indices
 The partition indices containing the subdomains to which each row(vertex) of the matrix(graph) belongs to.
 
std::vector< unsigned int > cell_weights
 The cell weights for the partition algorithm.
 
- Public Attributes inherited from schwz::Settings
std::string executor_string
 The string that contains the ginkgo executor paradigm.
 
std::shared_ptr< gko::Executor > executor = gko::ReferenceExecutor::create()
 The ginkgo executor the code is to be executed on.
 
std::shared_ptr< device_guardcuda_device_guard
 The ginkgo executor the code is to be executed on.
 
partition_settings partition = partition_settings::partition_regular
 
gko::int32 overlap = 2
 The overlap between the subdomains.
 
std::string matrix_filename = "null"
 The string that contains the matrix file name to read from .
 
bool explicit_laplacian = true
 Flag if the laplacian matrix should be generated within the library. More...
 
bool use_mixed_precision = false
 Flag if mixed precision should be used.
 
bool enable_random_rhs = false
 Flag to enable a random rhs.
 
bool print_matrices = false
 Flag to enable printing of matrices.
 
bool debug_print = false
 Flag to enable some debug printing.
 
local_solver_settings local_solver
 
bool non_symmetric_matrix = false
 Is the matrix non-symmetric ? , Use GMRES for local solves.
 
unsigned int restart_iter = 1u
 The restart iter for the GMRES solver.
 
int reset_local_crit_iter = -1
 The global iter at which to reset the local solver criterion.
 
bool naturally_ordered_factor = false
 Disables the re-ordering of the matrix before computing the triangular factors during the CHOLMOD factorization. More...
 
std::string metis_objtype
 This setting defines the objective type for the metis partitioning.
 
bool use_precond = false
 Enable the block jacobi local preconditioner for the local solver.
 
bool write_debug_out = false
 Enable the writing of debug out to file.
 
bool write_iters_and_residuals = false
 Enable writing the iters and residuals to a file.
 
bool enable_logging = false
 Flag to enable logging for local iterative solvers. More...
 
bool write_perm_data = false
 Enable the local permutations from CHOLMOD to a file.
 
int shifted_iter = 1
 Iteration shift for node local communication.
 
comm_settings comm_settings
 
convergence_settings convergence_settings
 
std::string factorization = "cholmod"
 The factorization for the local direct solver.
 
std::string reorder
 The reordering for the local solve.
 
- Public Attributes inherited from schwz::Communicate< ValueType, IndexType, MixedValueType >
comm_struct comm_struct
 

Additional Inherited Members

- Public Types inherited from schwz::Settings
enum  partition_settings {
  partition_regular = 0x0, partition_regular2d = 0x4, partition_metis = 0x1, partition_zoltan = 0x2,
  partition_custom = 0x3
}
 The partition algorithm to be used for partitioning the matrix.
 
enum  local_solver_settings {
  direct_solver_cholmod = 0x0, direct_solver_umfpack = 0x5, direct_solver_ginkgo = 0x1, iterative_solver_ginkgo = 0x2,
  iterative_solver_dealii = 0x3, solver_custom = 0x4
}
 The local solver algorithm for the local subdomain solves.
 
- Public Types inherited from schwz::Solve< ValueType, IndexType, MixedValueType >
using ResidualCriterionFactory = typename gko::stop::ResidualNormReduction< ValueType >::Factory
 
using IterationCriterionFactory = typename gko::stop::Iteration::Factory
 

Detailed Description

template<typename ValueType = gko::default_precision, typename IndexType = gko::int32, typename MixedValueType = gko::default_precision>
class schwz::SchwarzBase< ValueType, IndexType, MixedValueType >

The Base solver class is meant to be the class implementing the common implementations for all the schwarz methods.

It derives from the Initialization class, the Communication class and the Solve class all of which are templated.

Template Parameters
ValueTypeThe type of the floating point values.
IndexTypeThe type of the index type values.

Constructor & Destructor Documentation

◆ SchwarzBase()

template<typename ValueType , typename IndexType , typename MixedValueType >
schwz::SchwarzBase< ValueType, IndexType, MixedValueType >::SchwarzBase ( Settings settings,
Metadata< ValueType, IndexType > &  metadata 
)

Member Function Documentation

◆ print_matrix()

template<typename ValueType = gko::default_precision, typename IndexType = gko::int32, typename MixedValueType = gko::default_precision>
void schwz::SchwarzBase< ValueType, IndexType, MixedValueType >::print_matrix ( const std::shared_ptr< gko::matrix::Csr< ValueType, IndexType >> &  matrix,
int  rank,
std::string  name 
)

The auxiliary function that prints a passed in CSR matrix.

Parameters
matrixThe matrix to be printed.
subdThe subdomain on which the vector exists.
nameThe name of the matrix as a string.

◆ print_vector()

template<typename ValueType = gko::default_precision, typename IndexType = gko::int32, typename MixedValueType = gko::default_precision>
void schwz::SchwarzBase< ValueType, IndexType, MixedValueType >::print_vector ( const std::shared_ptr< gko::matrix::Dense< ValueType >> &  vector,
int  subd,
std::string  name 
)

The auxiliary function that prints a passed in vector.

Parameters
vectorThe vector to be printed.
subdThe subdomain on which the vector exists.
nameThe name of the vector as a string.

◆ run()

template<typename ValueType , typename IndexType , typename MixedValueType >
void schwz::SchwarzBase< ValueType, IndexType, MixedValueType >::run ( std::shared_ptr< gko::matrix::Dense< ValueType >> &  solution)

The documentation for this class was generated from the following files: