Skip to content

Instantly share code, notes, and snippets.

View abhijit-c's full-sized avatar
🐲

Abhijit Chowdhary abhijit-c

🐲
View GitHub Profile
@abhijit-c
abhijit-c / README.md
Last active January 5, 2017 10:33
Simple vector implementation in C

See Acutal Git Repo here:

#C Vector

My personal implementation of the c++ vector in C. I do not guarentee speed, stability or even usability. Sorry.

Please adhere to all license restrictions listed in the main directory.

#Build instructions

@abhijit-c
abhijit-c / parallel_julia.c
Last active January 25, 2020 18:34
Code for animating the Julia set (f(z) = z^2 + c) for many different choices of c. Needs to be run in a shell (for the system command) with the convert utility.
#include <complex.h>
#include <math.h>
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
// Adapted from https://batchloaf.wordpress.com/2013/02/10/another-julia-set-animation/
#define BOX_SIZE 2.0
#define NUM_FRAMES 240
import matplotlib.pyplot as plt
# Population data from https://data.worldbank.org/indicator/SP.POP.TOTL
# Ped. death data estimated from Figure 1 in:
# https://international.fhwa.dot.gov/programs/mrp/docs/FHWAPL2-020_GBP_Ped_Safety%20_Desk_Review_final102822.pdf
dates = [2000, 2010, 2019]
dates = [str(date) for date in dates]
AU = [
(19.15, 282.3104149030503),
(22.03, 169.25140607847925),
(25.37, 155.36721318887794)

Installing FEniCS-2019 on your Apple Silicon Machine w/ Anaconda

FEniCS is a nice numerical toolbox for solving PDEs through finite element type methods. However, ever since they've begun moving to the new syntax breaking version FEniCSx the installation of the older legacy 2019 FEniCS version has gotten more and more arcane, as dependencies are left frozen. Although it's best to eventually learn the newer version, or to transition to another package (e.g. firedrake), chances are if you're inheriting some code you'll need to be able to run