Skip to content

Commit

Permalink
build based on cdc4db6
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Nov 13, 2024
1 parent ef10dd8 commit caf36df
Show file tree
Hide file tree
Showing 83 changed files with 1,107 additions and 710 deletions.
2 changes: 1 addition & 1 deletion previews/PR798/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-12T15:38:29","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-13T17:15:14","documenter_version":"1.7.0"}}
4 changes: 2 additions & 2 deletions previews/PR798/changelog/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR798/cited-literature/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR798/devdocs/FEValues/index.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions previews/PR798/devdocs/assembly/index.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions previews/PR798/devdocs/dofhandler/index.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions previews/PR798/devdocs/elements/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR798/devdocs/index.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions previews/PR798/devdocs/interpolations/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR798/devdocs/performance/index.html

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions previews/PR798/devdocs/reference_cells/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions previews/PR798/devdocs/special_datastructures/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions previews/PR798/gallery/helmholtz/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR798/gallery/index.html

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions previews/PR798/gallery/landau.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
{
"output_type": "execute_result",
"data": {
"text/plain": "Main.var\"##347\".ThreadCache"
"text/plain": "Main.var\"##349\".ThreadCache"
},
"metadata": {},
"execution_count": 6
Expand Down Expand Up @@ -233,7 +233,7 @@
{
"output_type": "execute_result",
"data": {
"text/plain": "Main.var\"##347\".LandauModel"
"text/plain": "Main.var\"##349\".LandauModel"
},
"metadata": {},
"execution_count": 7
Expand Down Expand Up @@ -596,32 +596,32 @@
"text": [
"Iter Function value Gradient norm \n",
" 0 2.127588e+06 3.597094e+02\n",
" * time: 0.028335094451904297\n",
" * time: 0.044840097427368164\n",
" 1 3.786155e+05 1.047687e+02\n",
" * time: 3.7368240356445312\n",
" * time: 3.8716330528259277\n",
" 2 5.306125e+04 2.978953e+01\n",
" * time: 6.726307153701782\n",
" * time: 6.9034929275512695\n",
" 3 -2.642320e+03 7.943136e+00\n",
" * time: 9.658858060836792\n",
" * time: 9.894609928131104\n",
" 4 -1.027484e+04 1.752693e+00\n",
" * time: 12.59636902809143\n",
" * time: 12.89869999885559\n",
" 5 -1.084925e+04 2.157295e-01\n",
" * time: 15.55314302444458\n",
" * time: 15.894901037216187\n",
" 6 -1.085880e+04 5.288877e-03\n",
" * time: 18.519394159317017\n",
" * time: 18.890753030776978\n",
" 7 -1.085881e+04 3.478176e-06\n",
" * time: 21.498953104019165\n",
" * time: 21.86781597137451\n",
" 8 -1.085881e+04 1.596091e-12\n",
" * time: 24.434569120407104\n",
" * time: 24.851419925689697\n",
" 9 -1.085881e+04 1.444882e-12\n",
" * time: 27.415829181671143\n",
" * time: 27.8595929145813\n",
" 10 -1.085881e+04 1.548831e-13\n",
" * time: 30.352124214172363\n",
" * time: 30.83955407142639\n",
" 11 -1.085881e+04 1.548831e-13\n",
" * time: 33.39971709251404\n",
" * time: 33.93924903869629\n",
" 12 -1.085881e+04 1.508030e-13\n",
" * time: 33.82969617843628\n",
" 41.169691 seconds (14.91 M allocations: 4.061 GiB, 1.42% gc time, 12.11% compilation time)\n"
" * time: 34.39251208305359\n",
" 41.942652 seconds (14.91 M allocations: 4.061 GiB, 1.35% gc time, 13.40% compilation time)\n"
]
}
],
Expand Down
30 changes: 15 additions & 15 deletions previews/PR798/gallery/landau/index.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions previews/PR798/gallery/topology_optimization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
{
"output_type": "execute_result",
"data": {
"text/plain": "Main.var\"##351\".MaterialParameters"
"text/plain": "Main.var\"##353\".MaterialParameters"
},
"metadata": {},
"execution_count": 4
Expand Down Expand Up @@ -827,7 +827,7 @@
" Starting Newton iterations\n",
"Converged at iteration number: 65\n",
"Rel. stiffness: 4.8466 \n",
" 4.538163 seconds (2.44 M allocations: 2.015 GiB, 2.12% gc time, 6.46% compilation time)\n"
" 4.741273 seconds (2.44 M allocations: 2.015 GiB, 1.98% gc time, 6.59% compilation time)\n"
]
}
],
Expand Down
6 changes: 3 additions & 3 deletions previews/PR798/gallery/topology_optimization/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR798/howto/index.html

Large diffs are not rendered by default.

248 changes: 124 additions & 124 deletions previews/PR798/howto/postprocessing.ipynb

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions previews/PR798/howto/postprocessing/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions previews/PR798/howto/threaded_assembly/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR798/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR798/literate-tutorials/heat_equation_hdiv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function create_grid(ny::Int)
return grid
end

grid = create_grid(100)
grid = create_grid(10)

# ### Setup
# We define one `CellValues` for each field which share the same quadrature rule.
Expand Down
91 changes: 91 additions & 0 deletions previews/PR798/literate-tutorials/maxwell.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#=
# Solving Maxwell's equations
```math
\begin{align*}
\nabla \cdot \boldsymbol{D} &= \rho_\mathrm{f} \\
\nabla \times \boldsymbol{H} &= \boldsymbol{J}_\mathrm{f} + \frac{\partial \boldsymbol{D}}{\partial t} \\
\nabla \cdot \boldsymbol{B} &= 0 \\
\nabla \times \boldsymbol{E} &= -\frac{\partial \boldsymbol{B}}{\partial t}
\end{align*}
```
=#

#=
# Maxwell eigenvalue problem
Strong form
```math
\begin{align*}
\mathrm{curl}(\mathrm{curl}(\boldsymbol{u})) &= \lambda \boldsymbol{u} \text{ in } \Omega \\
\boldsymbol{u} \times \boldsymbol{n} &= \boldsymbol{0} \text{ on } \partial\Omega
\end{align*}
```
Weak form
```math
\int_\Omega \mathrm{curl}(\boldsymbol{\delta u}) \cdot \mathrm{curl}(\boldsymbol{u})\ \mathrm{d}\Omega = \lambda \int_\Omega \boldsymbol{\delta u} \cdot \boldsymbol{u}\ \mathrm{d}\Omega \quad \forall\ \boldsymbol{\delta u} \in H_0(\text{curl})
```
Finite element formulation
```math
\underbrace{\int_\Omega \mathrm{curl}(\boldsymbol{\delta N}_i) \cdot \mathrm{curl}(\boldsymbol{N_j})\ \mathrm{d}\Omega}_{A_{ij}}\ x_j = \lambda \underbrace{\int_\Omega \boldsymbol{\delta N_i} \cdot \boldsymbol{N_j}\ \mathrm{d}\Omega}_{B_{ij}}\ x_j
```
=#

# ## Implementation
using Ferrite, Tensors, KrylovKit
using Arpack: Arpack
# ### Element routine
function element_routine!(Ae, Be, cv::CellValues)
for q_point in 1:getnquadpoints(cv)
= getdetJdV(cv, q_point)
for i in 1:getnbasefunctions(cv)
δN = shape_value(cv, q_point, i)
curl_δN = shape_curl(cv, q_point, i)
for j in 1:getnbasefunctions(cv)
N = shape_value(cv, q_point, j)
curl_N = shape_curl(cv, q_point, j)
Ae[i, j] = (curl_δN curl_N) *
Be[i, j] = (δN N) *
end
end
end
return
end

# ### FE setup
function doassemble!(A, B, dh, cv)
n = ndofs_per_cell(dh)
Ae = zeros(n, n)
Be = zeros(n, n)
a_assem, b_assem = start_assemble.((A, B))
for cc in CellIterator(dh)
cell = getcells(dh.grid, cellid(cc))
reinit!(cv, cell, getcoordinates(cc))
element_routine!(Ae, Be, cv)
assemble!(a_assem, celldofs(cc), Ae)
assemble!(b_assem, celldofs(cc), Be)
end
return A, B
end

function setup_and_assemble(ip::VectorInterpolation{2, RefTriangle})
grid = generate_grid(Triangle, (10, 10))
cv = CellValues(QuadratureRule{RefTriangle}(2), ip, geometric_interpolation(Triangle))
dh = close!(add!(DofHandler(grid), :u, ip))
∂Ω = union((getfacetset(grid, k) for k in ("left", "top", "right", "bottom"))...)
dbc = Dirichlet(:u, ∂Ω, ip isa VectorizedInterpolation ? Returns([0.0, 0.0]) : Returns(0.0))
ch = close!(add!(ConstraintHandler(dh), dbc))
sp = init_sparsity_pattern(dh)
add_sparsity_entries!(sp, dh)
A = allocate_matrix(sp)
B = allocate_matrix(sp)
doassemble!(A, B, dh, cv)
Ferrite.zero_out_rows!(B, ch.dofmapping)
Ferrite.zero_out_columns!(B, ch.prescribed_dofs)
return A, B, dh
end

ip = Nedelec{2, RefTriangle, 1}()

A, B, dh = setup_and_assemble(ip)

# vals, vecs, info = geneigsolve((A, B), 1, EigSorter(x -> abs(x - 5.0)); maxiter = 1000);
# λ, ϕ = Arpack.eigs(A, B, nev = 2, sigma=5.5);
Binary file modified previews/PR798/objects.inv
Binary file not shown.
8 changes: 4 additions & 4 deletions previews/PR798/reference/assembly/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit caf36df

Please sign in to comment.