Instantly share code, notes, and snippets.

# Jan Weidnerjw3126

• Sort options
Created Dec 30, 2019
layered array
View layered_array.jl
 using Revise using ArgCheck struct LayeredArray{T, N, L} <: AbstractArray{T,N} layers::L function LayeredArray(layers) @argcheck !isempty(layers) @argcheck first(layers) isa AbstractArray l = first(layers) L = typeof(layers)
Created Nov 12, 2019
Makie JuAFEM Plot
View gist:e81cdf65c18610bc66066f06b9b72301
 using Makie using JuAFEM, SparseArrays using LinearAlgebra # # Poisson example from JuAFEM docs # grid = generate_grid(Triangle, (20, 20)); dim = 2
Last active Nov 8, 2019
Klein-Nishina formula
View klein_nishina.jl
 using Unitful using Unitful: MeV, NoUnits, cm using UnitfulRecipes const h = 6.626_070_040e-34*u"J*s" const h_bar = h / (2pi) const m_e = 9.10938356e-31 * u"kg" const c = 299_792_458.0 * u"m/s" const r_c = h_bar / (c*m_e) # reduced compton wavelength of electron
Created Aug 5, 2019
 # ]add AbstractPlotting # ]add Makie using Makie function step!(u_new, u, o) # u_new[i] = u[i] + dt*v*(u[i] - u[i-1])/dx # for i in reverse(eachindex(u)) s = o.v*o.dt/o.dx u_new[i] = u[i] + s * (u[i] - get(u, i-1, zero(eltype(u))))
Created Apr 28, 2019
Tag and release package to local registry.
View release.jl
 using LibGit2 using ArgCheck using Pkg: TOML import Pkg import Registrator struct Release package::Module registry::String check_master::Bool
Created Apr 27, 2019
LibGit2
View LibGit2.jl
 using LibGit2 repo_path = "LibGit2TestRepo" repo_url = "git@github.com:jw3126/LibGit2TestRepo.git" rm(repo_path, recursive=true, force=true) mkpath(path) # init repo = try @info "Cloning repo"
Last active Jan 23, 2019
DirichletAnnulusApproxFun.jl
View DirichletAnnulusApproxFun.jl
 using ApproxFun using LinearAlgebra using Interact using Plots a = 1.; b=5. Ω = a..b # Ω = Chebyshev(a..b) r = Fun(identity, Ω) Δ_rad = 𝒟^2 + 1.0/r * 𝒟
Created Jan 12, 2019
MakieSphericalHarmonics
View MakieSphericalHarmonics.jl
 using GSL using Makie struct Y l::Int m::Int function Y(l,m) @assert -l <= m <= l new(l,m) end
Created Nov 30, 2018
egs parallel
View egs_parallel.sh
 # install egs # make tutor2pp sudo apt install at exb tutor2pp test1 tutor_data p=42
Created Nov 12, 2018
Install EGSnrc
View install.sh
 #!/bin/bash ###### tweakable parameters EGS_SRC=\$HOME/EGSnrc CONFIG=linux.conf COMPILE_USER_CODES=1 ###### script implemention export HEN_HOUSE=\$EGS_SRC/HEN_HOUSE export EGS_CONFIG=\$HEN_HOUSE/specs/linux.conf
You can’t perform that action at this time.