Skip to content

Instantly share code, notes, and snippets.

@ClarkMyWords
ClarkMyWords / tets.py
Created May 8, 2025 14:33
Coordinates for Tetrahedral Divisions of a Cube
# Take a cube/hexahedral mesh element
# Divice that into convex tetrahedra
# Using the Polyscope vertex numbering here: https://polyscope.run/py/structures/volume_mesh/basics/#registering-a-volume-mesh
# And using Polyscope to visualize
import numpy as np
import polyscope as ps
def main():
vertices = np.array([
@ClarkMyWords
ClarkMyWords / patch_meson.py
Created July 8, 2024 03:41
Patcher to let Meson work with simple Fixed-Format Fortran/F77 Programs until a more robust solution is implemented
import mesonbuild
import pathlib
import sys
from typing import TextIO
# Warns the user that this will change their meson intstallation and asks them to confirm
def patch_meson_with_warnings() -> None:
meson_root_path: pathlib.Path = pathlib.Path(mesonbuild.__file__).parent
meson_compilers_dir_path: pathlib.Path = meson_root_path / "compilers"