Skip to content

Instantly share code, notes, and snippets.

Jan Weidner jw3126

  • Freiburg, Germany
Block or report user

Report or block jw3126

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:e81cdf65c18610bc66066f06b9b72301
using Makie
using JuAFEM, SparseArrays
using LinearAlgebra
#
# Poisson example from JuAFEM docs
#
grid = generate_grid(Triangle, (20, 20));
dim = 2
@jw3126
jw3126 / advection.jl
Created Aug 5, 2019
advection problems
View advection.jl
# ]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))))
@jw3126
jw3126 / release.jl
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
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"
@jw3126
jw3126 / DirichletAnnulusApproxFun.jl
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 * 𝒟
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
View egs_parallel.sh
# install egs
# make tutor2pp
sudo apt install at
exb tutor2pp test1 tutor_data p=42
@jw3126
jw3126 / install.sh
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
@jw3126
jw3126 / so3.jl
Created Oct 5, 2018
Haar Measure of distance Ball SO(3)
View so3.jl
# https://math.stackexchange.com/questions/1049788/haar-measure-of-an-angle-distance-ball-in-so3
using StatsBase
using LinearAlgebra
using StatPlots
using Plots
using Rotations
function sample_angles(N)
map(1:N) do _
View gist:ca1ed1a7f62a059849b15a8b538031a0
using LinearAlgebra
function linreg(xs, ys)
# Axs + b ≈ ys
@assert size(xs,2) == size(ys,2)
nobs = size(xs, 2)
xs_ = [xs; transpose(ones(nobs))]
ys_ = [ys; transpose(ones(nobs))]
A_ = ys_ / xs_
@assert A_[end, end] ≈ 1
You can’t perform that action at this time.