Skip to content
This repository was archived by the owner on Dec 30, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
name = "FastSolvers"
uuid = "afc03370-3a10-4444-b401-158123c3c69f"
authors = ["Anant Thazhemadam <anant.thazhemadam@gmail.com>"]
version = "0.1.0"
authors = ["Anant Thazhemadam <anant.thazhemadam@gmail.com>"]

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[compat]
LinearAlgebra = "1.10"
ModelingToolkit = "9.20.0"
NonlinearSolve = "3.13.1"
QuasiMonteCarlo = "0.3.3"
SparseArrays = "1.10"
Symbolics = "5.32.0"
julia = "1.10"
11 changes: 1 addition & 10 deletions src/FastSolvers.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
module FastSolvers
using SparseArrays
using NonlinearSolve
using LinearAlgebra
using QuasiMonteCarlo

import QuasiMonteCarlo.SamplingAlgorithm
import QuasiMonteCarlo.sample

import ModelingToolkit.PDESystem
import ModelingToolkit.Equation
using LinearAlgebra: norm, I

include("utils.jl")

Expand Down
38 changes: 1 addition & 37 deletions src/utils.jl
Original file line number Diff line number Diff line change
@@ -1,37 +1 @@
function sample_collocation_points(
domain::T, num_points::Tuple{Int, Int}, sampler::SamplingAlgorithm) where {T}
d = length(domain)
ni, nb = num_points

# Sample interior points
lb = []
ub = []
for i in 1:d
push!(lb, domain[i].left)
push!(ub, domain[i].right)
end
interior_points = sample(ni, lb, ub, sampler)

# Sample boundary points
nbcs = length(bcs)
nb_local = floor(Int, nb / nbcs)
boundary_points = []
for j in 1:nbcs
mask = []
bcs_local = bcs[j]
for i in 1:d
if typeof(bcs_local.lhs.arguments[i]) != SymbolicUtils.BasicSymbolic
push!(mask, i)
end
end
lb_local = lb[mask]
ub_local = ub[mask]
push!(
boundary_points, QuasiMonteCarlo.sample(nb_local, lb_local, ub_local, sampler))
end
return interior_points, reduce(vcat, boundary_points)
end

function LinearAlgebra.UpperTriangular(a::Float64)
return a
end
# Utility functions for FastSolvers
9 changes: 1 addition & 8 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
DomainSets = "0.7.14"
ModelingToolkit = "9.20.0"
OrdinaryDiffEq = "6.84.0"
julia = "1.10"
8 changes: 8 additions & 0 deletions test/explicit_imports.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using ExplicitImports
using FastSolvers
using Test

@testset "ExplicitImports" begin
@test check_no_implicit_imports(FastSolvers) === nothing
@test check_no_stale_explicit_imports(FastSolvers) === nothing
end
10 changes: 6 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ using FastSolvers
using Test
using ForwardDiff
using QuasiMonteCarlo
using SparseArrays
using LinearAlgebra
using NonlinearSolve
using BenchmarkTools
using SparseArrays: spzeros
using NonlinearSolve: NonlinearLeastSquaresProblem, solve

@testset "RKHS kernels" begin
include("kernels/interface.jl")
Expand All @@ -24,3 +22,7 @@ end
include("rfnn/derivatives.jl")
include("rfnn/function_approx.jl")
end

@testset "Explicit Imports" begin
include("explicit_imports.jl")
end
Loading