In [87]:
include("HPFEM.jl")


WARNING: replacing module HPFEM
Out[87]:
HPFEM

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]:
ψj (generic function with 1 method)

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]:
ϕ_matrix (generic function with 1 method)

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]:
integrateϕ (generic function with 1 method)

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]:
2x2 Array{Float64,2}:
 0.0  0.0
 0.0  0.0

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]:
2x2 Array{Int64,2}:
 3  1
 1  2

In [ ]: