Skip to content

Instantly share code, notes, and snippets.

View fredrikekre's full-sized avatar
🇸🇪

Fredrik Ekre fredrikekre

🇸🇪
View GitHub Profile
@fredrikekre
fredrikekre / liveserver
Created March 16, 2022 16:12
LiveServer.jl convenience script.
#!/bin/bash
#=
exec julia --startup-file=no --compile=min -O0 -e 'include(popfirst!(ARGS))' "${BASH_SOURCE[0]}" "$@"
=#
port::Int = 8000
host::String = "127.0.0.1"
verbose::Bool = false
dir::String = pwd()
#!/usr/bin/env bash
# MIT License, Copyright (c) 2021 Fredrik Ekre. See end of file for full license.
_subcommands add "franklin"
_subcommands describe "franklin" <<EOF
Usage:
nb franklin <nb selector> file

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results that indicate possible regressions or improvements - are shown below (thus, an empty table means that all benchmark results remained invariant between builds).

ID time ratio memory ratio
["dcontract","dim 1 - order 2sym 2 - Float32"] 0.94 (5%) ✅ 1.00 (1%)
["dcontract","dim 1 - order 2sym 2 - Float64"] 0.90 (5%) ✅ 1.00 (1%)
["dcontract","dim 1 - order 4 2sym - Float32"] 0.94 (5%) ✅ 1.00 (1%)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
abstract foo{T}
immutable bar{T}
x::T
end
immutable baz{T} <: foo{T <: Real}
x::bar{T}
end

Calculating g and ke at the same time

using ForwardDiff
using JuAFEM
# Test of mesh functions in JuAFEM
function test_mesh()
# Set up nodal coordinates
coords = [0.0 1.0 2.0 0.0 1.0 2.0 0.0 1.0 2.0;
0.0 0.0 0.0 1.0 1.0 1.0 2.0 2.0 2.0]
coords_tens = reinterpret(Vec{2, Float64}, coords, (div(length(coords),2),))