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

The initialization class that provides methods for initialization of the solver. More...

#include <initialization.hpp>

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

Public Member Functions

 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 Attributes

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.
 

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.
 

Detailed Description

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

The initialization class that provides methods for initialization of the solver.

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

Initialization

Member Function Documentation

◆ generate_rhs()

template<typename ValueType , typename IndexType >
void schwz::Initialize< ValueType, IndexType >::generate_rhs ( std::vector< ValueType > &  rhs)

Generates the right hand side vector.

Parameters
rhsThe rhs vector.

References schwz::Initialize< ValueType, IndexType >::setup_global_matrix().

Referenced by schwz::SchwarzBase< ValueType, IndexType, MixedValueType >::initialize().

◆ partition()

template<typename ValueType , typename IndexType >
void schwz::Initialize< ValueType, IndexType >::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.

Allows the partition of the global matrix depending with METIS and a regular 1D decomposition.

Parameters
settingsThe settings struct.
metadataThe metadata struct.
global_matrixThe global matrix.
partition_indicesThe partition indices [OUTPUT].

References schwz::Metadata< ValueType, IndexType >::global_size, schwz::Metadata< ValueType, IndexType >::my_rank, schwz::Metadata< ValueType, IndexType >::num_subdomains, and schwz::Settings::write_debug_out.

Referenced by schwz::SchwarzBase< ValueType, IndexType, MixedValueType >::initialize().

◆ setup_global_matrix()

template<typename ValueType , typename IndexType >
void schwz::Initialize< ValueType, IndexType >::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.

Parameters
oned_laplacian_sizeThe size of the one d laplacian grid.
global_matrixThe global matrix.

Referenced by schwz::Initialize< ValueType, IndexType >::generate_rhs(), and schwz::SchwarzBase< ValueType, IndexType, MixedValueType >::initialize().

◆ setup_local_matrices()

template<typename ValueType , typename IndexType >
void schwz::Initialize< ValueType, IndexType >::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 
)
pure virtual

Sets up the local and the interface matrices from the global matrix and the partition indices.

Parameters
settingsThe settings struct.
metadataThe metadata struct.
partition_indicesThe array containing the partition indices.
global_matrixThe global system matrix.
local_matrixThe local system matrix.
interface_matrixThe interface matrix containing the interface and the overlap data mainly used for exchanging values between different sub-domains.
local_permThe local permutation, obtained through RCM or METIS.

Implemented in schwz::SolverRAS< ValueType, IndexType, MixedValueType >.

Referenced by schwz::SchwarzBase< ValueType, IndexType, MixedValueType >::initialize().

◆ setup_vectors()

template<typename ValueType , typename IndexType >
void schwz::Initialize< ValueType, IndexType >::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.

Parameters
settingsThe settings struct.
metadataThe metadata struct.
local_rhsThe local right hand side vector in the subdomain.
global_rhsThe global right hand side vector.
local_solutionThe local solution vector in the subdomain.

References schwz::Settings::executor, schwz::Metadata< ValueType, IndexType >::first_row, schwz::Metadata< ValueType, IndexType >::local_size_x, and schwz::Metadata< ValueType, IndexType >::my_rank.

Referenced by schwz::SchwarzBase< ValueType, IndexType, MixedValueType >::initialize().


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