In [35]:
include("./lagrange_spec.jl")
include("../src/HPFEM.jl")


WARNING: replacing module HPFEM
Out[35]:
HPFEM

In [34]:



LoadError: syntax: optional positional arguments must occur at end
while loading In[34], in expression starting on line 14

In [32]:
function defaults(a,b,x=5,y=6)
    return "$a $b and $x $y"
end


Out[32]:
defaults (generic function with 3 methods)

In [9]:
function lagrange(M,Q,nel,a=-1,b=1,idir=[1],fun, = 100)
  nnodes = nel + 1
  lagr = HPFEM.Lagrange1d(M);
  quad = HPFEM.QuadType(Q);
  base = HPFEM.Basis1d(lagr, quad);
  nodes = collect(linspace(a, b, nnodes));
  lmap = HPFEM.locmap(base)
  dof = HPFEM.DofMap1d(lmap, nnodes, idir);

  elemento = [HPFEM.Element1d(e, nodes[e], nodes[e+1], base) for e = 1:nel]
  solver = HPFEM.CholeskySC(dof, HPFEM.BBSymTri);

  for e = 1:nel
      Ae = HPFEM.mass_matrix(base, elemento[e])
      HPFEM.add_local_matrix(solver, e, Ae)
  end

  HPFEM.solve!(solver, Fe)

   = 101
  ξ = collect(linspace(-1,1,));
  ϕ = zeros(, M)
  for i = 1:M
      ϕ[:,i] = base(ξ, i)
  end
  Ue = ϕ * Fe;

  for e = 1:nel
      uu = fun(x[e])
      err = maxabs(uu-Ue[:,e])
      if err > maxerr maxerr = err end

      #plot(x[e], Ue[:,e], "r", x[e], uu, "b")
  end
  return maxerr

end


LoadError: syntax: optional positional arguments must occur at end
while loading In[9], in expression starting on line 38