Skip to content

Commit 21010d4

Browse files
committed
upgraded to Grassmann v0.7
1 parent 31657a8 commit 21010d4

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Project.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Adapode"
22
uuid = "0750cfb5-909a-49d7-927e-29b6595444bf"
33
authors = ["Michael Reed"]
4-
version = "0.2.5"
4+
version = "0.2.6"
55

66
[deps]
77
DirectSum = "22fd7b30-a8c0-5bf2-aabe-97783860d07c"
@@ -12,9 +12,9 @@ AbstractTensors = "a8e43f4a-99b7-5565-8bf1-0165161caaea"
1212

1313
[compat]
1414
julia = "1"
15-
AbstractTensors = "0.5"
15+
AbstractTensors = "0.6"
1616
DirectSum = "0.7"
17-
Grassmann = "0.6"
17+
Grassmann = "0.7"
1818

1919
[extras]
2020
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/element.jl

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ using Base.Threads
2323
revrot(hk::Chain{V,1},f=identity) where V = Chain{V,1}(-f(hk[2]),f(hk[1]))
2424

2525
function gradienthat(t,m=volumes(t))
26-
N = ndims(Manifold(t))
26+
N = mdims(Manifold(t))
2727
if N == 2 #inv.(m)
2828
V = Manifold(points(t))
2929
c = Chain{↓(V),1}.(inv.(m))
@@ -70,7 +70,7 @@ assembleglobal(M,t,m=volumes(t),c=1,g=0) = assembleglobal(M,t,iterable(t,m),iter
7070
function assembleglobal(M,t,m::T,c::C,g::F) where {T<:AbstractVector,C<:AbstractVector,F<:AbstractVector}
7171
np = length(points(t)); A = spzeros(np,np)
7272
for k 1:length(t)
73-
assemblelocal!(A,M(c[k],g[k],Val(ndims(Manifold(t)))),m[k],value(t[k]))
73+
assemblelocal!(A,M(c[k],g[k],Val(mdims(Manifold(t)))),m[k],value(t[k]))
7474
end
7575
return A
7676
end
@@ -99,15 +99,15 @@ end
9999
function incidence(t,cols=columns(t))
100100
np,nt = length(points(t)),length(t)
101101
A = spzeros(Int,np,nt)
102-
for i Grassmann.list(1,ndims(Manifold(t)))
102+
for i Grassmann.list(1,mdims(Manifold(t)))
103103
A += sparse(cols[i],1:nt,1,np,nt)
104104
end
105105
return A
106106
end # node-element incidence, A[i,j]=1 -> i∈t[j]
107107

108108
assemblemassfunction(t,f,m=volumes(t),l=m,d=degrees(t)) = assemblemassfunction(t,iterpts(t,f),iterable(t,m),iterable(t,l),iterpts(t,d))
109109
function assemblemassfunction(t,f::F,m::V,l::T,d::D) where {F<:AbstractVector,V<:AbstractVector,T<:AbstractVector,D<:AbstractVector}
110-
np,n = length(points(t)),Val(ndims(Manifold(t)))
110+
np,n = length(points(t)),Val(mdims(Manifold(t)))
111111
M,b,v = spzeros(np,np), zeros(np), f./d
112112
for k 1:length(t)
113113
tk = value(t[k])
@@ -158,7 +158,7 @@ function assembledivergence(t,m,g)
158158
D1,D2 = spzeros(nt,np), spzeros(nt,np)
159159
for k 1:length(t)
160160
tk,gm = value(t[k]),g[k]*m[k]
161-
for i 1:ndims(Manifold(t))
161+
for i 1:mdims(Manifold(t))
162162
D1[k,tk[i]] = gm[i][1]
163163
D2[k,tk[i]] = gm[i][2]
164164
end
@@ -246,7 +246,7 @@ const solveboundary = solvedirichlet # deprecate
246246
const edgelengths = volumes # deprecate
247247
const boundary = pointset # deprecate
248248

249-
facesindices(t,cols=columns(t)) = ndims(t) == 3 ? edgesindices(t,cols) : throw(error())
249+
facesindices(t,cols=columns(t)) = mdims(t) == 3 ? edgesindices(t,cols) : throw(error())
250250

251251
function edgesindices(t,cols=columns(t))
252252
np,nt = length(points(t)),length(t)
@@ -262,7 +262,7 @@ function neighbor(k::Int,ab...)::Int
262262
end
263263

264264
@generated function neighbors(A::SparseMatrixCSC,V,tk,k)
265-
N,F = ndims(Manifold(V)),(x->x>0)
265+
N,F = mdims(Manifold(V)),(x->x>0)
266266
N1 = Grassmann.list(1,N)
267267
x = Values{N}([Symbol(:x,i) for i N1])
268268
f = Values{N}([:(findall($F,A[:,tk[$i]])) for i N1])
@@ -274,7 +274,7 @@ end
274274
function neighbors(t,n2e=incidence(t))
275275
V,A = Manifold(Manifold(t)),sparse(n2e')
276276
nt = length(t)
277-
n = Chain{V,1,Int,ndims(V)}[]; resize!(n,nt)
277+
n = Chain{V,1,Int,mdims(V)}[]; resize!(n,nt)
278278
@threads for k 1:nt
279279
n[k] = neighbors(A,V,t[k],k)
280280
end
@@ -322,7 +322,7 @@ function nedelecmean(t,t2e,signs,u)
322322
end
323323

324324
function jumps(t,c,a,f,u,m=volumes(t),g=gradienthat(t,m))
325-
N,np,nt = ndims(Manifold(t)),length(points(t)),length(t)
325+
N,np,nt = mdims(Manifold(t)),length(points(t)),length(t)
326326
η = zeros(nt)
327327
if N == 2
328328
fau = iterable(points(t),f).-a*u

0 commit comments

Comments
 (0)