{"id":24818667,"url":"https://github.com/integralequations/ifgf.jl","last_synced_at":"2025-04-11T23:50:27.135Z","repository":{"id":38182776,"uuid":"394979537","full_name":"IntegralEquations/IFGF.jl","owner":"IntegralEquations","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-06T07:58:06.000Z","size":1270,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T19:43:56.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IntegralEquations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-11T12:22:38.000Z","updated_at":"2024-10-01T08:14:21.000Z","dependencies_parsed_at":"2024-03-13T09:48:56.150Z","dependency_job_id":"f187c92e-028d-4b62-b150-dc3a5428ca83","html_url":"https://github.com/IntegralEquations/IFGF.jl","commit_stats":null,"previous_names":["integralequations/ifgf.jl"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntegralEquations%2FIFGF.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntegralEquations%2FIFGF.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntegralEquations%2FIFGF.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntegralEquations%2FIFGF.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IntegralEquations","download_url":"https://codeload.github.com/IntegralEquations/IFGF.jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497890,"owners_count":21113984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-30T17:37:18.786Z","updated_at":"2025-04-11T23:50:27.112Z","avatar_url":"https://github.com/IntegralEquations.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IFGF.jl\n\n*A Julia implementation of the [Interpolated Factored Green Function Method](https://arxiv.org/abs/2010.02857)*\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://IntegralEquations.github.io/IFGF.jl/stable)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://IntegralEquations.github.io/IFGF.jl/dev)\n[![Build Status](https://github.com/IntegralEquations/IFGF.jl/workflows/CI/badge.svg)](https://github.com/IntegralEquations/IFGF.jl/actions)\n[![codecov](https://codecov.io/gh/IntegralEquations/IFGF.jl/graph/badge.svg?token=IqlADUFvwx)](https://codecov.io/gh/IntegralEquations/IFGF.jl)\n\n## Installation\nInstall from the Pkg REPL:\n```\npkg\u003e add https://github.com/IntegralEquations/IFGF.jl\n```\n\n## Overview\n\nThis package provides an implementation of the [Interpolated Factored Green\nFunction Method (IFGF)](https://arxiv.org/abs/2010.02857) for accelerating the\nevaluation of certain dense linear operators arising in boundary integral equation\nmethods. In particular, it provides an efficient approximation of the\nmatrix-vector product for both non-oscillatory kernels (e.g. Laplace, Stokes) and\noscillatory kernels (e.g. Helmholtz, Maxwell).\n\nTo illustrate how the `IFGFOp` can be used to approximate dense linear maps,\nconsider the problem of computing `Ax` where `A` is an `M×N` matrix with\nentries given by `A[i,j] = K(X[i],Y[j])`, with `K(x,y)=exp(ik|x-y|)/|x-y|` being\nthe kernel function, and `X,Y` being a vector of `M` and `N` points in three\ndimensions. The following code show how one may set up the aforementioned\nmatrix:\n\n```julia\nusing IFGF, LinearAlgebra, StaticArrays\nimport IFGF: wavenumber\n\n# random points on a cube\nconst Point3D = SVector{3,Float64}\nm,n = 100_000, 100_000\nX,Y = rand(Point3D,m), rand(Point3D,n)\n\n# define a the kernel matrix\nstruct HelmholtzMatrix \u003c: AbstractMatrix{ComplexF64}\n    X::Vector{Point3D}\n    Y::Vector{Point3D}\n    k::Float64\nend\n\n# indicate that this is an ocillatory kernel with wavenumber `k`\nwavenumber(A::HelmholtzMatrix) = A.k\n\n# functor interface\nfunction (K::HelmholtzMatrix)(x,y)\n    k = wavenumber(K)\n    d = norm(x-y)\n    exp(im*k*d)*inv(4*pi*d)\nend\n\n# abstract matrix interface\nBase.size(::HelmholtzMatrix) = length(X), length(Y)\nBase.getindex(A::HelmholtzMatrix,i::Int,j::Int) = A(A.X[i],A.Y[j])\n\n# create the abstract matrix\nk = 2π   \nA = HelmholtzMatrix(X,Y,k)\n```\n\nAlthough the memory footprint of the object `A` is very small (it *lazily*\ncomputes its entries), multiplying it by a vector has complexity proportional to\n`m*n`, which can be prohibitively costly for large problem sizes. The `IFGFOp`\ncomputes an approximation as follows:\n\n```julia\nL = assemble_ifgf(A,X,Y; tol = 1e-4)\n```\n\nWe can now use `L` in lieu of `A` to approximate the matrix vector product, as\nillustrated below:\n\n```julia\nx     = randn(ComplexF64,n)\ny     = L*x\n```\n\nIn order to assess the quality of the approximation, we may take a few random\nrows and compare the approximate result against the exact one:\n\n```julia\nI  = rand(1:m,100)\nexact = [sum(A[i,j]*x[j] for j in 1:n) for i in I]\ner    = norm(y[I]-exact) / norm(exact) \n```\n\nThe error should be smaller than the prescribed tolerance.\n\nSee the [documentation](https://IntegralEquations.github.io/IFGF.jl/dev/) for more\ndetails and examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralequations%2Fifgf.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintegralequations%2Fifgf.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralequations%2Fifgf.jl/lists"}