Skip to content

Instantly share code, notes, and snippets.

@mrkwjc
mrkwjc / gmsh_time_example.msh
Created April 15, 2021 10:38
Example of Gmsh .msh file with time data (MSH 2.2)
This file has been truncated, but you can view the full file.
$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
3789
1 -0.15 -0.05 0.0
2 0.15 -0.05 0.0
3 0.15 0.05 0.0
4 -0.15 0.05 0.0
@mrkwjc
mrkwjc / cuspsolve32.py
Last active December 6, 2019 15:41
CUDA vs. CPU sparse solver in Python - single precision
# ### Interface cuSOLVER PyCUDA
from __future__ import print_function
import pycuda.gpuarray as gpuarray
import pycuda.driver as cuda
import pycuda.autoinit
import numpy as np
import scipy.sparse as sp
import ctypes
@mrkwjc
mrkwjc / npbench.py
Last active January 19, 2019 00:55
Numpy performance tests...
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Roughly based on: http://stackoverflow.com/questions/11443302/compiling-numpy-with-openblas-integration
from __future__ import print_function
import numpy as np
from time import time
@mrkwjc
mrkwjc / cuspsolve.py
Last active November 28, 2022 09:49
CUDA vs. CPU sparse solver in Python
# ### Interface cuSOLVER PyCUDA
from __future__ import print_function
import pycuda.gpuarray as gpuarray
import pycuda.driver as cuda
import pycuda.autoinit
import numpy as np
import scipy.sparse as sp
import ctypes