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 scipy.spatial import cKDTree | |
def show_actual_predicted(actual, predicted, target_unit=""): | |
assert len(actual.shape)==1 | |
assert len(predicted.shape)==1 | |
fig = plt.figure(constrained_layout=True, figsize=(15, 10)) | |
gs = fig.add_gridspec(3, 5) # vert the horiz | |
ax1 = fig.add_subplot(gs[0:2, 0:2]) # scatter dim | |
ax2 = fig.add_subplot(gs[0:2, 2:4]) # scatter percent |
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 file is the same as borehole.py but has an non-uniform cartesian mesh | |
Coupled thermal flow model for brine temperature and wall | |
temperature. Rock is an axisymmetric 2D mesh | |
A two-dimensional axi-symmetric domain represents the heat in the rock | |
surrounding the borehole. The rock is initially at the geo-thermal | |
gradient and is heated as hot brine is injected. The rock is heated as | |
the brine cools. |
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 | |
import scipy.spatial | |
import networkx as nx | |
import itasca as it | |
from itasca import ballarray as ba | |
from collections import defaultdict | |
import itertools | |
def draw_fragment(points,faces,i): | |
gname = "tmp{}.geom".format(i) |
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 itasca as it | |
it.command("python-reset-state false") | |
import numpy as np | |
from itasca import zonearray as za | |
zid = za.ids() | |
zz_faces = set() | |
for i, neighbors in enumerate(za.neighbors()): | |
this_zone_id = zid[i] |
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 file was written by Jason Furtney and Wei Fu | |
# This file is an example of how to generate a surface mesh from lines | |
# in a DXF file. A vtk file is created of the mesh. | |
# you may have to install some Python packages to get this to work | |
import numpy as np | |
import ezdxf | |
import time |
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 itasca as it | |
from itasca import gpa | |
import numpy as np | |
from scipy.constants import foot | |
from collections import defaultdict | |
import os | |
from scipy.spatial import cKDTree | |
import scipy | |
if os.path.exists("data.npy"): |
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 | |
import pandas as pd | |
import matplotlib; matplotlib.rcParams["savefig.directory"] = "." | |
from matplotlib import pyplot as plt | |
from scipy.spatial import cKDTree | |
from numpy.linalg import lstsq | |
data0 = np.loadtxt("S1-1_0m.log") | |
data1 = np.loadtxt("S1-1_3000m.log") | |
assert (data0[:,0] == data1[:,0]).all() |
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 | |
import pylab as plt | |
from sys import float_info | |
from math import sqrt | |
from skfmm import distance | |
N=11 | |
phi = np.ones((N,N)) | |
phi[5,5] = -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
import numpy as np | |
import pylab as plt | |
from skfmm import travel_time, distance | |
from scipy.interpolate import RectBivariateSpline | |
from scipy.optimize import fminbound | |
from math import sin | |
# Brachistochrone curve | |
# see: http://mathworld.wolfram.com/BrachistochroneProblem.html | |
b=1/np.pi |
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
; call trello2org interactively | |
; or pragmatically like this: (trello2org "c:/Users/jfurtney/blo-up-2-7.json") | |
(require 'json) | |
(defun convert-trello-json-file-to-org (trello-json-file) | |
(let* ((board (json-read-file trello-json-file)) | |
(board-name (cdr (assoc 'name (cdr board)))) | |
(lists (cdr (assoc 'lists (cdr board)))) |
NewerOlder