This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install egs | |
# make tutor2pp | |
sudo apt install at | |
exb tutor2pp test1 tutor_data p=42 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GSL | |
using Makie | |
struct Y | |
l::Int | |
m::Int | |
function Y(l,m) | |
@assert -l <= m <= l | |
new(l,m) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 * 𝒟 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LibGit2 | |
repo_path = "LibGit2TestRepo" | |
repo_url = "[email protected]:jw3126/LibGit2TestRepo.git" | |
rm(repo_path, recursive=true, force=true) | |
mkpath(path) | |
# init | |
repo = try | |
@info "Cloning repo" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LibGit2 | |
using ArgCheck | |
using Pkg: TOML | |
import Pkg | |
import Registrator | |
struct Release | |
package::Module | |
registry::String | |
check_master::Bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ]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)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Makie | |
using JuAFEM, SparseArrays | |
using LinearAlgebra | |
# | |
# Poisson example from JuAFEM docs | |
# | |
grid = generate_grid(Triangle, (20, 20)); | |
dim = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CUDAnative, CuArrays | |
macro cushow(ex) | |
val = gensym("val") | |
s = string(ex) | |
quote | |
$val = $(esc(ex)) | |
CUDAnative.@cuprintln($(Expr(:string, s, " = ", val))) | |
$val | |
end |