In [87]:
include("HPFEM.jl")
Out[87]:
In [7]:
using Jacobi
using PyPlot
In [4]:
function ψj(p,E,Q)
if(p == 1)
return (1-E)/2
elseif(p == 2)
return (1+E)/2
else
return (1-E)*(1+E)/4 .* jacobi(E, p-3, 1, 1)
end
end
Out[4]:
In [17]:
function ϕ_matrix(ψj,Q,M)
ϕ = zeros(Q,M)
ξ = zglj(Q)
for i in 1:M
for j in 1:Q
ϕ[j,i] = ψj(i,ξ[j],M)
end
end
return ϕ
end
Out[17]:
In [45]:
function integrateϕ(w,Q,i,j)
m= 0.0
for q in 1:Q
m = m + ϕ[q,i]*ϕ[q,j]*w[q]
end
return m
end
Out[45]:
In [56]:
integrateϕ(w,10,2,2)
Ahh = zeros(2,2)
for i in 1:2
for j in 1:2
Ahh[i,j] =
end
end
Out[56]:
In [75]:
#elemento
b = [1,2] #modos de fronteira
i = [3] #modos internos
lnum = HPFEM.LocalNumSys1d(b,i)
Nel = 2
nnodes = Nel + 1
idir = [1]
dof_map = zeros(Int, 2, Nel)
for i = 1:Nel
dof_map[1,i] = i
dof_map[2,i] = i+1
end
ii = [nnodes;1:(nnodes-1);]
nb = Nel+1
nd = 2
for e in 1:Nel
dof_map[1,e] = ii[e]
dof_map[2,e] = ii[e+1]
end
dof_map
Out[75]:
In [ ]: