Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Simon
    @SimonDanisch
    which seems to be the newest version
    alblaz
    @alblaz
    Thanks @SimonDanisch! I had v0.3.6+. After running Pkg.free("Reactive") the tests run smoothly again!
    Simon
    @SimonDanisch
    great :)
    Sheehan Olver
    @dlfivefifty
    I'm planning to get a live animation working again with GLVisualize, where I reuse the same grid for each frame. Is this possible using Plots.jl, or should I use GLVisualize.jl directly?
    Christopher Rackauckas
    @ChrisRackauckas
    tbreloff/Plots.jl#580
    Sheehan Olver
    @dlfivefifty
    I guess since it's open the answer is use GLVisualize.jl directly for now?
    Christopher Rackauckas
    @ChrisRackauckas
    yeah
    Sheehan Olver
    @dlfivefifty
    Is the GLVisualization documentation out of date? I get the following using the surface example:
    julia> using GLVisualize, GLAbstraction, Colors, Reactive, GeometryTypes
    
    julia> window = glscreen()
    name: GLVisualize
    children: 0
    Inputs:
      framebuffer_size => Reactive.Signal{FixedSizeArrays.Vec{2,Int64}}
      buttons_pressed => Reactive.Signal{Set{Int64}}
      scroll => Reactive.Signal{FixedSizeArrays.Vec{2,Float64}}
      hasfocus => Reactive.Signal{Bool}
      keyboard_buttons => Reactive.Signal{Tuple{Int64,Int64,Int64,Int64}}
      button_down => Reactive.Signal{Int64}
      mouseinside => Reactive.Signal{Bool}
      window_size => Reactive.Signal{FixedSizeArrays.Vec{2,Int64}}
      mouse_buttons_pressed => Reactive.Signal{Set{Int64}}
      mouse_button_down => Reactive.Signal{Int64}
      dropped_files => Reactive.Signal{Array{String,1}}
      arrow_navigation => Reactive.Signal{Symbol}
      button_released => Reactive.Signal{Int64}
      unicode_input => Reactive.Signal{Array{Char,1}}
      cursor_position => Reactive.Signal{FixedSizeArrays.Vec{2,Float64}}
      window_area => Reactive.Signal{GeometryTypes.SimpleRectangle{Int64}}
      mouseposition => Reactive.Signal{FixedSizeArrays.Vec{2,Float64}}
      key_pressed => Reactive.Signal{Bool}
      window_open => Reactive.Signal{Bool}
      mouse2id => Reactive.Signal{GLWindow.SelectionID{Int64}}
      mouse_buttons => Reactive.Signal{Tuple{Int64,Int64,Int64}}
      entered_window => Reactive.Signal{Bool}
      window_position => Reactive.Signal{FixedSizeArrays.Vec{2,Int64}}
      mouse_button_released => Reactive.Signal{Int64}
    
    
    julia> timesignal = loop(linspace(0f0,1f0,360))
    Signal{Float32}(0.0, nactions=0)
    
    julia> # generate some pretty data
           function xy_data(x,y,i, N)
               x = ((x/N)-0.5f0)*i
               y = ((y/N)-0.5f0)*i
               r = sqrt(x*x + y*y)
               Float32(sin(r)/r)
           end
    xy_data (generic function with 1 method)
    
    julia> surf(i, N) = Float32[xy_data(x, y, i, N) for x=1:N, y=1:N]
    surf (generic function with 1 method)
    
    julia> t = map(t->(t*30f0)+20f0, timesignal)
    Signal{Float32}(20.167131, nactions=0)
    
    julia> bb = Signal(AABB{Float32}(Vec3f0(0), Vec3f0(1)))
    Signal{GeometryTypes.HyperRectangle{3,Float32}}(GeometryTypes.HyperRectangle{3,Float32}(Vec(0.0,0.0,0.0),Vec(1.0,1.0,1.0)), nactions=0)
    
    julia> view(visualize(const_lift(surf, t, 400), :surface, boundingbox=bb))
    ERROR: MethodError: no method matching view(::GLAbstraction.Context{GLAbstraction.DeviceUnit})
    Closest candidates are:
      view(::Images.AbstractImage{T,N}, ::Union{AbstractArray{T<:Real,1},Colon,Int64}...) at /Users/solver/.julia/v0.5/Images/src/core.jl:513
      view(::Images.AbstractImage{T,N}, ::Union{AbstractArray{T<:Real,1},Colon,T<:Real}...) at /Users/solver/.julia/v0.5/Images/src/core.jl:514
      view{T,N}(::AbstractArray{T,N}, ::Union{AbstractArray{T,N},Colon,Real}...) at subarray.jl:63
      ...
    It looks like view should be something else now
    Ah, it's _view
    Sheehan Olver
    @dlfivefifty
    How do I specify the plotting grid?
    Sheehan Olver
    @dlfivefifty
    Nevermind, found this works
    function mgrid(dim1, dim2)
        X = [i for i in dim1, j in dim2]
        Y = [j for i in dim1, j in dim2]
        return X,Y
    end
    X, Y = mgrid(linspace(-1f0,1f0,100),linspace(-1f0,1f0,100))
    Z = exp.(-X.^2-Y.^2)
    
    
    window = glscreen()
    _view(visualize((X,Y,Z), :surface))
    @async renderloop(window)
    Sheehan Olver
    @dlfivefifty
    PS I'm not a fan of _view. Why not GLVisualize.view?
    Simon
    @SimonDanisch
    Sorry about these inconveniences
    I think you can't overwrite view in your own module since its in base... and overloading doesn't work either, since it creates ambiguities
    Simon
    @SimonDanisch
    I will try to bring GLPlot up to date... there it's already only glplot without a _view step ;)
    Sheehan Olver
    @dlfivefifty
    How do I update data after it's been plotted? I'm using
    X  = # some Matrix{Float32}
    Y  = # some Matrix{Float32}
    Z =  # some Matrix{Float32}
    _view(visualize((X,Y,Z),:surface))
    @async renderloop(window)
    but I now want to update the values of just Z
    Simon
    @SimonDanisch
    Oh sorry! didn't see this
    that should be something like:
    using GLVisualize;
    w = glscreen()
    @async GLWindow.waiting_renderloop(w)
    X = rand(Float32, 10, 10)# some Matrix{Float32}
    Y = rand(Float32, 10, 10) # some Matrix{Float32}
    Z = rand(Float32, 10, 10) # some Matrix{Float32}
    vis = visualize((X,Y,Z),:surface)
    _view(vis)
    GLAbstraction.set_arg!(vis, :position_z, rand(Float32, 10, 10))
    Sheehan Olver
    @dlfivefifty
    Thanks!! it works. I'll send you the code. Any easy way to output a movie?
    Sheehan Olver
    @dlfivefifty
    Simon
    @SimonDanisch
    yes! let me see how it works best currently!
    Simon
    @SimonDanisch
    is the calculation super slow?
    Christopher Rackauckas
    @ChrisRackauckas
    it's using an implicit Euler method
    there's a reason why there's so much research in timestepping routines and making ODE solvers faster for stiff equations :smile:
    Sheehan Olver
    @dlfivefifty
    No the calculation is really fast as soon as QR cache is built up
    The solve takes about 0.004s though evaluating on the grid is slower, 0.2s, but still 5fps or so
    Christopher Rackauckas
    @ChrisRackauckas
    oh I see, you just cache the QR
    how many basis elements does it take (what's the size of the matrix?)
    Sheehan Olver
    @dlfivefifty
    I want to move the evaluation step to the GPU
    Christopher Rackauckas
    @ChrisRackauckas
    I really need to get on-board and take some time learning ApproxFun
    Sheehan Olver
    @dlfivefifty
    It grows adaptively, so Inf x Inf
    Christopher Rackauckas
    @ChrisRackauckas
    but how could you do that on the GPU?
    They're awful at dynamic allocation
    Sheehan Olver
    @dlfivefifty
    Just the evaluation step
    Christopher Rackauckas
    @ChrisRackauckas
    (Xeon Phi on the otherhand sounds interesting for this)
    Sheehan Olver
    @dlfivefifty
    This is a 2D Clenshaw
    The plotting grid is not adaptive
    Christopher Rackauckas
    @ChrisRackauckas
    what exactly is the evaluation step doing?
    assembling a matrix?
    Sheehan Olver
    @dlfivefifty
    No
    Evaluating the solution on the grid
    Christopher Rackauckas
    @ChrisRackauckas
    oh I see
    Sheehan Olver
    @dlfivefifty
    Nope
    Clenshaws algorithm
    Simon
    @SimonDanisch
    could you turn it into a broadcast, as in f.(matrix), where f is a non allocating pure function?