Giter Site home page Giter Site logo

algebraicmultigrid.jl's Introduction

Algebraic Multigrid (AMG)

Build Status
Build Status

This package lets you solve sparse linear systems using Algebraic Multigrid (AMG). This works especially well for symmetric positive definite matrices.

Usage

Using the CommonSolve interface

This is highest level API. It internally creates the multilevel object and calls the multigrid cycling _solve.

A = poisson(100); 
b = rand(100);
solve(A, b, RugeStubenAMG(), maxiter = 1, abstol = 1e-6)

Multigrid cycling

using AlgebraicMultigrid

A = poisson(1000) # Creates a sample symmetric positive definite sparse matrix
ml = ruge_stuben(A) # Construct a Ruge-Stuben solver
# Multilevel Solver
# -----------------
# Operator Complexity: 1.9859906604402935
# Grid Complexity: 1.99
# No. of Levels: 8
# Coarse Solver: AMG.Pinv()
# Level     Unknowns     NonZeros
# -----     --------     --------
#     1         1000         2998 [50.35%]
#     2          500         1498 [25.16%]
#     3          250          748 [12.56%]
#     4          125          373 [ 6.26%]
#     5           62          184 [ 3.09%]
#     6           31           91 [ 1.53%]
#     7           15           43 [ 0.72%]
#     8            7           19 [ 0.32%]


AlgebraicMultigrid._solve(ml, A * ones(1000)) # should return ones(1000)

As a Preconditioner

You can use AMG as a preconditioner for Krylov methods such as Conjugate Gradients.

import IterativeSolvers: cg
p = aspreconditioner(ml)
c = cg(A, A*ones(1000), Pl = p)

Features and Roadmap

This package currently supports:

AMG Styles:

  • Ruge-Stuben Solver
  • Smoothed Aggregation (SA)

Strength of Connection:

  • Classical Strength of Connection
  • Symmetric Strength of Connection

Smoothers:

  • Gauss Seidel (Symmetric, Forward, Backward)
  • Damped Jacobi

Cycling:

  • V, W and F cycles

In the future, this package will support:

  1. Other splitting methods (like CLJP)
  2. SOR smoother
  3. AMLI cycles

Acknowledgements

This package has been heavily inspired by the PyAMG project.

algebraicmultigrid.jl's People

Contributors

alexander-barth avatar chrisrackauckas avatar cortner avatar fredrikekre avatar github-actions[bot] avatar jagot avatar mohamed82008 avatar ranjanan avatar viralbshah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.