|
| | smoothed_aggregation (void) |
| |
| template<typename MatrixType > |
| | smoothed_aggregation (const MatrixType &A) |
| |
| template<typename MatrixType , typename ArrayType > |
| | smoothed_aggregation (const MatrixType &A, const ArrayType &B) |
| |
| template<typename MemorySpace2 , typename SmootherType2 , typename SolverType2 , typename Format2 > |
| | smoothed_aggregation (const smoothed_aggregation< IndexType, ValueType, MemorySpace2, SmootherType2, SolverType2, Format2 > &M) |
| |
| template<typename MatrixType > |
| void | initialize (const MatrixType &A) |
| |
| template<typename MatrixType , typename ArrayType > |
| void | initialize (const MatrixType &A, const ArrayType &B) |
| |
template<typename IndexType, typename ValueType, typename MemorySpace, typename SmootherType = thrust::use_default, typename SolverType = thrust::use_default, typename Format = thrust::use_default>
class cusp::precond::aggregation::smoothed_aggregation< IndexType, ValueType, MemorySpace, SmootherType, SolverType, Format >
Algebraic multigrid preconditioner based on smoothed aggregation.
- Template Parameters
-
| IndexType | Type used for matrix values (e.g. int or size_t). |
| ValueType | Type used for matrix values (e.g. float or double). |
| MemorySpace | A memory space (e.g. cusp::host_memory or cusp::device_memory) |
- Overview
- Given a matrix
A to precondition, the smoothed aggregation preconditioner constructs a algebraic multigrid (AMG) operator.
Smoothed aggregation is expensive to use but is a very effective preconditioning technique to solve challenging linear systems. The default configuration uses a symmetric strength measure, MIS-based aggregation in device memory, sequential aggregation in host_memory, Jacobi smoothing is applied to the tentative prolongator, Jacobi relaxation on each level of hierarchy and LU to solve the coarse matrix in host memory.
- Example
- The following code snippet demonstrates how to use a
smoothed_aggregation preconditioner to solve a linear system.
#include <iostream>
int main(int argc, char *argv[])
{
typedef int IndexType;
typedef double ValueType;
typedef cusp::device_memory MemorySpace;
IndexType N = 256;
std::cout << "Generated matrix (poisson5pt) "
<< "with shape (" << A.num_rows << "," << A.num_cols << ") and "
<< A.num_entries << " entries" << "\n";
std::cout << "\nSolving with smoothed aggregation preconditioner and jacobi smoother" << std::endl;
M.print();
return 0;
}
Conjugate Gradient (CG) method.
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" mem...
Hybrid (HYB) representation a sparse matrix.
Implements standard convergence criteria and reporting for iterative solvers.
Algebraic multigrid preconditioner based on smoothed aggregation.
Compressed Sparse Row matrix format.
void poisson5pt(MatrixType &matrix, const size_t m, const size_t n)
void cg(const LinearOperator &A, VectorType1 &x, const VectorType2 &b, Monitor &monitor, Preconditioner &M)
Conjugate Gradient method.
void print(void)
Prints the number of iterations and convergence history information.
Poisson matrix generators.
Algebraic multigrid preconditioner based on smoothed aggregation.
Definition at line 161 of file smoothed_aggregation.h.
template<typename IndexType , typename ValueType , typename MemorySpace , typename SmootherType = thrust::use_default, typename SolverType = thrust::use_default, typename Format = thrust::use_default>
template<typename MatrixType , typename ArrayType >
Construct a smoothed_aggregation preconditioner from a matrix and specified near nullspace vector.
- Parameters
-
| A | matrix used to create the AMG hierarchy. |
| B | candidate near nullspace vector. |
template<typename IndexType , typename ValueType , typename MemorySpace , typename SmootherType = thrust::use_default, typename SolverType = thrust::use_default, typename Format = thrust::use_default>
template<typename MemorySpace2 , typename SmootherType2 , typename SolverType2 , typename Format2 >
| cusp::precond::aggregation::smoothed_aggregation< IndexType, ValueType, MemorySpace, SmootherType, SolverType, Format >::smoothed_aggregation |
( |
const smoothed_aggregation< IndexType, ValueType, MemorySpace2, SmootherType2, SolverType2, Format2 > & |
M | ) |
|
template<typename IndexType , typename ValueType , typename MemorySpace , typename SmootherType = thrust::use_default, typename SolverType = thrust::use_default, typename Format = thrust::use_default>
template<typename MatrixType , typename ArrayType >
Initialize a smoothed_aggregation preconditioner from a matrix and initial near nullspace vector. Used to initialize a smoothed_aggregation preconditioner constructed with no input matrix specified.
- Parameters
-
| A | matrix used to create the AMG hierarchy. |
| B | candidate near nullspace vector. |