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
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
export HOST_COLOR='\e[35m' #magenta | |
prompt () { | |
last_code="$?" | |
# glyph indicating rootness/previous command exit code |
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
class ForgotInitError(Exception): | |
pass | |
class CallWatcher: | |
"""Wrapper for some callable, which makes a note of when the callable has been called once.""" | |
def __init__(self, watched): | |
self.was_called = False | |
self.watched = watched |
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
from __future__ import print_function | |
import json | |
import matplotlib | |
import itertools | |
import matplotlib.pyplot as plt | |
from math import log | |
from collections import defaultdict | |
from matplotlib import rcParams |
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
from block import block_mat, block_vec, block_bc | |
from dolfin import * | |
from xii import * | |
import mshr | |
N = 10 | |
_mesh = RectangleMesh(Point(0, -1), Point(1, 1), N, 2 * N) |
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
from dolfin import * | |
from xii import * | |
N = 20 | |
EPS = 1E-3 | |
_mesh = RectangleMesh(Point(0, -1), Point(1, 1), N, 2 * N) | |
stokes_subdomain = dolfin.CompiledSubDomain( | |
"x[1] > 0", eps=EPS | |
) |
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
from block import block_mat, block_vec, block_bc | |
from dolfin import * | |
from xii import * | |
import mshr | |
N = 10 | |
EPS = 1E-3 | |
R = 0.25 | |
box_domain = mshr.Box(dolfin.Point(0, 0, 0), dolfin.Point(1, 1, 1)) |
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
from block import block_mat, block_vec, block_bc | |
from dolfin import * | |
from xii import * | |
import mshr | |
dt, alpha, alpha_BJS, s0, mu_f, mu_p, lbd_f, lbd_p, K, Cp = [1] * 10 | |
N = 10 |
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
import os | |
from setuptools import setup, find_packages | |
setup( | |
name = "my_package", | |
version = "0.0.11", | |
packages=find_packages(), | |
) |
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
import numpy as np | |
def translate_single_block(entry, name_to_arr_dict, N_rows, N_columns): | |
try: # block may just be a bare number | |
entry = float(entry) | |
return np.ones((N_rows, N_columns)) * entry | |
except TypeError: | |
string_repr = str(entry) | |
arr = eval(string_repr, name_to_arr_dict) |
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
### source this to make your prompt very aesthetically pleasing. Probably change bayaz to your computer's name. | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
INVERTED='\e[7m' | |
NC='\033[0m' # No Color | |
if [ $HOSTNAME = 'bayaz' ] |
NewerOlder