Skip to content

Commit

Permalink
fixed minor upgrade bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed Aug 29, 2024
1 parent e991756 commit 86c7ab8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Cartan"
uuid = "e24af43f-9fd5-4672-9264-a75f3ae40eb2"
authors = ["Michael Reed"]
version = "0.3.0"
version = "0.3.1"

[deps]
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Expand Down
9 changes: 3 additions & 6 deletions src/diffgeo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,9 @@ centraldiff(f::AbstractArray,args...) = centraldiff_fast(f,args...)

gradient(f::IntervalMap,args...) = gradient_slow(f,args...)
gradient(f::TensorField{B,F,N,<:AbstractArray} where {B,F,N},args...) = gradient_fast(f,args...)
function unitgradient(f::TensorField{B,F,N,<:AbstractArray} where {B,F,N},d=centraldiff(domain(f)),t=centraldiff(codomain(f),d))
TensorField(domain(f), (t./abs.(t)))
end
function unitgradient(f::ScalarMap)
t = interp(domain(f),gradient(domain(f),codomain(f)))
TensorField(domain(f), (t./abs.(t)))
function unitgradient(f::TensorField,args...)
t = gradient(f,args...)
return t/abs(t)
end

(::Derivation)(t::TensorField) = getnabla(t)
Expand Down
12 changes: 6 additions & 6 deletions src/element.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export assembleload, assemblemassload, assemblerobin, edges, edgesindices, neigh
export solvepoisson, solvetransportdiffusion, solvetransport, solvedirichlet, adaptpoisson
export gradienthat, gradientCR, gradient, interp, nedelec, nedelecmean, jumps
export submesh, detsimplex, iterable, callable, value, edgelengths, laplacian
export boundary, interior, trilength, trinormals, incidence, degrees
export boundary, interior, trilength, trinormals, incidence, degrees, edges
import Grassmann: norm, column, columns, points, pointset
using Base.Threads

Expand Down Expand Up @@ -337,20 +337,20 @@ function assembleincidence(X::SimplexFrameBundle,f::F,m::V,::Val{T}=Val{false}()
end
return b
end
function incidence(t,cols=columns(t))
np,nt = length(points(t)),length(t)
function incidence(t,cols=columns(topology(t)))
np,nt = length(points(t)),length(immersion(t))
A = spzeros(Int,np,nt)
for i Grassmann.list(1,mdims(Manifold(t)))
for i Grassmann.list(1,mdims(immersion(t)))
A += sparse(cols[i],1:nt,1,np,nt)
end
return A
end # node-element incidence, A[i,j]=1 -> i∈t[j]

assembleload(t,m=volumes(t),d=degrees(t,m)) = assembleincidence(t,inv.(d),m,Val(true))

interp(t) = assembleload(t,incidence(t))
interp(t,B::SparseMatrixCSC=incidence(t)) = Diagonal(inv.(degrees(t,B)))*B
interp(t,b,d=degrees(t,b)) = assembleload(t,b,d)
pretni(t,B::SparseMatrixCSC=incidence(t)) = assembleload(t,sparse(B'))
pretni(t,B::SparseMatrixCSC=incidence(t)) = interp(t,sparse(B'))
pretni(t,ut,B=pretni(t)) = B*ut #interp(t,ut,B::SparseMatrixCSC) = B*ut

interior(e) = interior(length(points(e)),pointset(e))
Expand Down

2 comments on commit 86c7ab8

@chakravala
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/114193

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.1 -m "<description of version>" 86c7ab8003092c50696870d1ca51c38c0cf36bc3
git push origin v0.3.1

Please sign in to comment.