Skip to content

Instantly share code, notes, and snippets.

View twmr's full-sized avatar

Thomas Wimmer twmr

  • IMS Nanofabrication GmbH
  • Vienna
View GitHub Profile
@twmr
twmr / sphere.pkl
Last active March 9, 2016 09:44
standalone maxwell bem test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@twmr
twmr / bem_sphere_integral_etheta.py
Last active August 29, 2015 14:16
integral of e_theta over surface of sphere
from __future__ import print_function
from bempp.lib import *
import numpy as np
def eval_neumann_data(point, normal, k):
x, y, z = point
r = np.sqrt(x**2 + y**2 + z**2)
rho = np.sqrt(x**2 + y**2)
# sintheta = rho/r
@twmr
twmr / herlmholtz3dbempp.py
Created November 22, 2014 00:19
bempp example which calculates the solution of the 3d helmholtz equation at certain points outside an arbitrary object
import os
import sys
import pickle
import numpy as np
import scipy
import scipy.special
legendre = scipy.special.eval_legendre
@twmr
twmr / helmholtz3dbempp.py
Created November 20, 2014 10:16
bempp helmholtz3d cube problem
import os
import sys
import numpy as np
import scipy
import scipy.special
legendre = scipy.special.eval_legendre
@twmr
twmr / axes_with_table_problem.py
Last active August 29, 2015 14:02
matplot make_axes_locatable problem
#!/usr/bin/env python
from collections import OrderedDict
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.table import table
fig = plt.figure()
@twmr
twmr / axes_with_table.py
Created June 14, 2014 12:10
matplotlib_with_table
#!/usr/bin/env python
from collections import OrderedDict
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.table import table
fig = plt.figure()
@twmr
twmr / redgreenunittest.py
Created September 30, 2013 20:10
colorized python unittest runner
"""colorized unittest output
taken from https://github.com/stevematney/redgreenunittests
"""
import sys
from pygments import highlight
from pygments.lexers import PythonTracebackLexer
from pygments.formatters import TerminalFormatter