Skip to content

Instantly share code, notes, and snippets.

@c-f-h
c-f-h / disk-convergence.ipynb
Created October 28, 2021 14:57
IgA convergence on a disk
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@c-f-h
c-f-h / mantle-convection.ipynb
Created September 11, 2020 11:49
Rayleigh-Bénard convection using pyiga
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
from pyiga import bspline, geometry, assemble, approx
def L2ErrEstimator_vf(dim):
from pyiga.vform import VForm, div, grad, dx, tree_print
vf = VForm(dim, arity=1)
u = vf.input('u')
v = vf.basisfuns()
Lu = div(grad(u, parametric=True), parametric=True)
vf.add(Lu**2 * v * dx)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@c-f-h
c-f-h / remez.py
Created April 18, 2019 11:11
Discrete best uniform approximation with Remez algorithm
import numpy as np
import scipy.signal
def discrete_remez(f, V, tol=1e-12, maxiter=1000, startnodes=None):
"""Best uniform approximation of the vector f by a linear combination of the columns of V.
Uses a discrete Remez algorithm with single point exchange.
If it converges, this function returns a vector c such that V.dot(c) is the best uniform
approximation to f.
"""
@c-f-h
c-f-h / divdiv-lowrank.ipynb
Created May 16, 2017 12:24
Low-rank approximation for div*div matrix in IgA
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@c-f-h
c-f-h / least-squares.ipynb
Created May 2, 2015 14:18
Least Squares with gradient descent
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5bc241c More optimizations to bumper rendering, uses index and vertex buffers throughout now.
2b6a7df Light rendering optimized more.
ebb564c Forgot to remove some TODOs which are done.
ae83fa3 Many simplifications and optimizations to gate rendering.
73d63ad Disabled Graphics Memory display during F11 for now.
ade903a Implemented vertex buffer caching.
f99ba56 Forgot to mention screen shake.
f426c5c Removed some more old renderer stuff.
e894901 Removed SetColorKeyEnabled() completely (was no longer used anyway).
c2b43a4 Bugfix: starting a table twice may cause a D3D error (reported by DHogsett). Reason: decal VB was not freed.