1
1
2
- # This file is part of Adapode.jl. It is licensed under the AGPL license
2
+ # This file is part of Adapode.jl
3
+ # It is licensed under the AGPL license
3
4
# Adapode Copyright (C) 2019 Michael Reed
5
+ # _ _ _
6
+ # | | | | | |
7
+ # ___| |__ __ _| | ___ __ __ ___ ____ _| | __ _
8
+ # / __| '_ \ / _` | |/ / '__/ _` \ \ / / _` | |/ _` |
9
+ # | (__| | | | (_| | <| | | (_| |\ V / (_| | | (_| |
10
+ # \___|_| |_|\__,_|_|\_\_| \__,_| \_/ \__,_|_|\__,_|
11
+ #
12
+ # https://github.com/chakravala
13
+ # https://crucialflow.com
4
14
5
15
export assemble, assembleglobal, assemblestiffness, assembleconvection, assembleSD
6
16
export assemblemass, assemblefunction, assemblemassfunction, assembledivergence
@@ -107,7 +117,7 @@ function incidence(t,cols=columns(t))
107
117
end # node-element incidence, A[i,j]=1 -> i∈t[j]
108
118
109
119
assemblemassincidence (t,f,m= volumes (t),l= m) = assemblemassincidence (t,iterpts (t,f),iterable (t,m),iterable (t,l))
110
- function assemblemassincidence (t,f:: F ,m:: V ,l:: T ) where {F<: AbstractVector ,V<: AbstractVector ,T<: AbstractVector ,D <: AbstractVector }
120
+ function assemblemassincidence (t,f:: F ,m:: V ,l:: T ) where {F<: AbstractVector ,V<: AbstractVector ,T<: AbstractVector }
111
121
np,n = length (points (t)),Val (mdims (Manifold (t)))
112
122
M,b,v = spzeros (np,np), zeros (np), f
113
123
for k ∈ 1 : length (t)
@@ -131,11 +141,11 @@ pretni(t,B::SparseMatrixCSC=incidence(t)) = assembleload(t,sparse(B'))
131
141
pretni (t,ut,B= pretni (t)) = B* ut # interp(t,ut,B::SparseMatrixCSC) = B*ut
132
142
133
143
# mass(a,b,::Val{N}) where N = (ones(SMatrix{N,N,Int})+I)/Int(factorial(N+1)/factorial(N-1))
134
- mass (a,b,:: Val{N} ) where N = (x= SubManifold (N)(∇);outer (x,x)+ I)/ Int (factorial (N+ 1 )/ factorial (N- 1 ))
144
+ mass (a,b,:: Val{N} ) where N = (x= Submanifold (N)(∇);outer (x,x)+ I)/ Int (factorial (N+ 1 )/ factorial (N- 1 ))
135
145
assemblemass (t,m= volumes (t)) = assembleglobal (mass,t,iterpts (t,m))
136
146
137
147
stiffness (c,g:: Float64 ,:: Val{2} ) = (cg = c* g^ 2 ; Chain (Chain (cg,- cg),Chain (- cg,cg)))
138
- stiffness (c,g,:: Val{N} ) where N = Chain {SubManifold (N),1} (map .(* ,c,value (g).⋅ Ref (g)))
148
+ stiffness (c,g,:: Val{N} ) where N = Chain {Submanifold (N),1} (map .(* ,c,value (g).⋅ Ref (g)))
139
149
assemblestiffness (t,c= 1 ,m= volumes (t),g= gradienthat (t,m)) = assembleglobal (stiffness,t,m,iterable (c isa Real ? t : means (t),c),g)
140
150
# iterable(means(t),c) # mapping of c.(means(t))
141
151
@@ -310,7 +320,7 @@ function nedelec(λ,g,v::Val{3})
310
320
end
311
321
312
322
function basisnedelec (p)
313
- M = SubManifold (ℝ^ 3 ); V = ↓ (M)
323
+ M = Submanifold (ℝ^ 3 ); V = ↓ (M)
314
324
Chain {M,1} (
315
325
Chain {V,1} (- p[2 ],p[1 ]),
316
326
Chain {V,1} (- p[2 ],p[1 ]- 1 ),
0 commit comments