Skip to content

Commit

Permalink
version - min 1.3.1 for Libdl
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Mar 1, 2024
1 parent dc9e1fb commit 510aa17
Show file tree
Hide file tree
Showing 6 changed files with 486 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
julia-version: ['1.3', '1', 'nightly']
julia-version: ['1.3.1', '1', 'nightly']
steps:
- name: Environment setup
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
[compat]
FastGaussQuadrature = "0.4.9, 0.5, 1"
Polynomials = "2.0.25, 3, 4"
julia = "1.3"
julia = "1.3.1"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Dirichlet BDDC Example"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# dependencies\n",
"using Pkg\n",
"Pkg.activate(\"./\")\n",
"Pkg.instantiate()\n",
"using LFAToolkit\n",
"using LinearAlgebra\n",
"using Plots"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"code_folding": []
},
"outputs": [],
"source": [
"# setup\n",
"p = 4\n",
"mesh = Mesh2D(1.0, 1.0)\n",
"\n",
"# diffusion operator\n",
"diffusion = GalleryOperator(\"diffusion\", p + 1, p + 2, mesh)\n",
"\n",
"# Dirichlet BDDC smoother\n",
"bddc = DirichletBDDC(diffusion)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"code_folding": [
14,
16,
27
],
"scrolled": true
},
"outputs": [],
"source": [
"# full operator symbols\n",
"numbersteps = 4\n",
"maxeigenvalue = 0\n",
"θ_min = -π/2\n",
"θ_max = 3π/2\n",
"θ_step = (2π-2π/numbersteps)/(numbersteps-1)\n",
"θ_range = θ_min:θ_step:θ_max\n",
"\n",
"# compute and plot smoothing factor\n",
"# setup\n",
"ω = [1.0]\n",
"eigenvalues = []\n",
"\n",
"# compute\n",
"for i in 1:numbersteps, j in 1:numbersteps\n",
" θ = [θ_range[i], θ_range[j]]\n",
" if sqrt(abs(θ[1])^2 + abs(θ[2])^2) > π/128\n",
" A = computesymbols(bddc, ω, θ)\n",
" currenteigenvalues = [abs(val) for val in eigvals(I - A)]\n",
" push!(eigenvalues, currenteigenvalues)\n",
" end\n",
"end\n",
"\n",
"# plot\n",
"histogram(\n",
" eigenvalues,\n",
" title=\"Dirichlet BDDC Eigenvalues\",\n",
" legend=false,\n",
" aspect_ratio=:equal,\n",
" normalize=:density,\n",
" color=:cividis\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"savefig(\"DirichletBDDCHighOrderEigenvalues\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.2",
"language": "julia",
"name": "julia-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Dirichlet BDDC Example"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# dependencies\n",
"using Pkg\n",
"Pkg.activate(\"./\")\n",
"Pkg.instantiate()\n",
"using LFAToolkit\n",
"using LinearAlgebra\n",
"using Plots"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"code_folding": []
},
"outputs": [],
"source": [
"# setup\n",
"p = 4\n",
"mesh = Mesh2D(1.0, 1.0)\n",
"\n",
"# diffusion operator\n",
"diffusion = GalleryOperator(\"diffusion\", p + 1, p + 2, mesh)\n",
"\n",
"# Dirichlet BDDC smoother\n",
"bddc = DirichletBDDC(diffusion)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"code_folding": [
14,
16,
27
],
"scrolled": true
},
"outputs": [],
"source": [
"# full operator symbols\n",
"numbersteps = 250\n",
"maxeigenvalue = 0\n",
"θ_min = -π/2\n",
"θ_max = 3π/2\n",
"θ_step = 2π/(numbersteps-1)\n",
"θ_range = θ_min:θ_step:θ_max\n",
"\n",
"# compute and plot smoothing factor\n",
"# setup\n",
"ω = [1.0]\n",
"maxeigenvalues = zeros(numbersteps, numbersteps)\n",
"\n",
"# compute\n",
"for i in 1:numbersteps, j in 1:numbersteps\n",
" θ = [θ_range[i], θ_range[j]]\n",
" if sqrt(abs(θ[1])^2 + abs(θ[2])^2) > π/128\n",
" A = computesymbols(bddc, ω, θ)\n",
" eigenvalues = [abs(val) for val in eigvals(I - A)]\n",
" maxeigenvalues[i, j] = max(eigenvalues...)\n",
" maxeigenvalue = max(maxeigenvalue, maxeigenvalues[i, j])\n",
" end\n",
"end\n",
"\n",
"# plot\n",
"println(\"max eigenvalue: \", maxeigenvalue)\n",
"xrange = θ_range/π\n",
"heatmap(\n",
" xrange,\n",
" xlabel=\"θ/π\",\n",
" xtickfont=font(12, \"Courier\"),\n",
" xrange,\n",
" ylabel=\"θ/π\",\n",
" ytickfont=font(12, \"Courier\"),\n",
" maxeigenvalues,\n",
" title=\"Dirichlet BDDC Symbol\",\n",
" transpose=true,\n",
" aspect_ratio=:equal,\n",
" color=:cividis\n",
")\n",
"xlims!(θ_min/π, θ_max/π)\n",
"ylims!(θ_min/π, θ_max/π)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"savefig(\"DirichletBDDCHighOrder\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.2",
"language": "julia",
"name": "julia-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Lumped BDDC Eigenvalue Histogram"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# dependencies\n",
"using Pkg\n",
"Pkg.activate(\"./\")\n",
"Pkg.instantiate()\n",
"using LFAToolkit\n",
"using LinearAlgebra\n",
"using Plots"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"code_folding": []
},
"outputs": [],
"source": [
"# setup\n",
"p = 8\n",
"mesh = Mesh2D(1.0, 1.0)\n",
"\n",
"# diffusion operator\n",
"diffusion = GalleryOperator(\"diffusion\", p + 1, p + 2, mesh)\n",
"\n",
"# bddc smoother\n",
"bddc = LumpedBDDC(diffusion)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"code_folding": [
14,
16,
27
],
"scrolled": true
},
"outputs": [],
"source": [
"# full operator symbols\n",
"numbersteps = 4\n",
"maxeigenvalue = 0\n",
"θ_min = -π/2\n",
"θ_max = 3π/2\n",
"θ_step = 2π/(numbersteps-1)\n",
"θ_range = θ_min:θ_step:θ_max\n",
"\n",
"# compute and plot smoothing factor\n",
"# setup\n",
"ω = [1.0]\n",
"eigenvalues = []\n",
"\n",
"# compute\n",
"for i in 1:numbersteps, j in 1:numbersteps\n",
" θ = [θ_range[i], θ_range[j]]\n",
" if sqrt(abs(θ[1])^2 + abs(θ[2])^2) > π/128\n",
" A = computesymbols(bddc, ω, θ)\n",
" currenteigenvalues = [abs(val) for val in eigvals(I - A)]\n",
" push!(eigenvalues, currenteigenvalues)\n",
" end\n",
"end\n",
"\n",
"# plot\n",
"histogram(\n",
" eigenvalues,\n",
" title=\"Lumped BDDC Eigenvalues\",\n",
" legend=false,\n",
" aspect_ratio=:equal,\n",
" color=:cividis,\n",
" normed=true\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"savefig(\"lumpedBDDCHighOrderEigenvalues\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.2",
"language": "julia",
"name": "julia-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit 510aa17

Please sign in to comment.