This file contains 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
this is a test |
This file contains 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/sh | |
# This script will setup Evm (Emacs Version Manager) and Cask on | |
# Travis to use for Emacs Lisp testing. | |
# | |
# In .travis.yml, add this: | |
# | |
# - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh | |
# | |
# Emacs 24.3 is installed in the above script because Cask requires |
This file contains 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
#! /usr/bin/env python3 | |
import sys | |
import re | |
def isplit(string, delimiter = None): | |
"""Like string.split but returns an iterator (lazy) | |
Multiple character delimters are not handled. |
This file contains 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
all: vrfy mac | |
vrfy: vrfy.o cbcmac.o aes_core.o | |
gcc -o vrfy vrfy.o cbcmac.o aes_core.o -lpthread | |
mac: mac.o cbcmac.o aes_core.o | |
gcc -o mac mac.o cbcmac.o aes_core.o -lpthread | |
clean: | |
rm -f mac.o aes_core.o cbcmac.o mac.o vrfy.o vrfy mac |
This file contains 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
\newcommand{\scalemath}[2]{\scalebox{#1}{\begin{math} {#2} \end{math}}} | |
\newcommand{\Aprime}{\scalemath{0.5}{\begin{matrix} \Amm & \Abound \\ \zm & -\Idm \end{matrix}}} | |
\newcommand{\Gprime}{\scalemath{0.5}{\begin{matrix} \zm & \zm \\ \zm & \bm \end{matrix}}} | |
\newcommand{\Qprime}{\scalemath{0.5}{\begin{matrix} \Qm \\ \zm \end{matrix}}} | |
Combining the above with the Jacobian matrix as derived in \cref{sec:llg-magn-coupl}, the complete Jacobian is | |
\begin{equation} | |
\Jm = | |
\scalemath{2}{ |
This file contains 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
(defun dwim-entire-line (function) | |
(if (region-active-p) | |
(funcall function (region-beginning) (region-end)) | |
;; else | |
(funcall function (point-at-bol) (point-at-beginning-of-next-line)))) | |
(global-set-key (kbd "M-;") (lambda () (interactive) | |
(dwim-entire-line 'comment-or-uncomment-region))) |
This file contains 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
(defun true1 () t) | |
(setq function-list (list #'true1)) | |
(cons 'or function-list) | |
(eval (cons 'or function-list)) |
This file contains 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
double Problem:: | |
adaptive_unsteady_newton_solve(const double &dt_desired, | |
const double &epsilon, | |
const bool &shift_values) | |
{ | |
//First, we need to backup the existing dofs, in case the timestep is | |
//rejected | |
//Find total number of dofs on current processor | |
unsigned n_dof_local = dof_distribution_pt()->nrow_local(); |
This file contains 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
def emr_step(dt_n, y_n, dy_n, dt_nm1, y_nm1): | |
"""Take a single step of the explicit midpoint rule. | |
From G&S pg. 715 and Prinja's thesis pg.45. | |
""" | |
dtr = dt_n / dt_nm1 | |
y_np1 = (1 - dtr**2)*y_n + (1 + dtr)*dt_n*dy_n + (dtr**2)*(y_nm1) | |
return y_np1 | |
def bdf2_dydt(ts, ys): | |
"""Get dy/dt at time ts[-1] (allowing for varying dt). |
This file contains 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
/// \short Indexed output function to print a matrix to the stream outfile | |
/// as i,j,a(i,j) for a(i,j)!=0 only with a specified precision. | |
void sparse_indexed_output(std::ostream &outfile, | |
const unsigned &precision, | |
const bool& output_bottom_right_entry_regardless=false) const | |
{ | |
// Note: we might have to specify "output_bottom_right_entry_regardless" | |
// as well (can't be a default). C++ can silently convert between | |
// unsigned and bool, so having a default set for | |
// output_bottom_right_entry_regardless would give the same function |
NewerOlder