Skip to content

Instantly share code, notes, and snippets.

View ocni-dtu's full-sized avatar

Christian Kongsgaard ocni-dtu

View GitHub Profile
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "Project",
"properties": {
"assemblies": {
"type": "array",
"items": {
"allOf": [
{
@ocni-dtu
ocni-dtu / openFoamRegex.js
Created June 18, 2020 13:36
Regex to get residuals from OpenFoam log
const getResidualVariables = log => {
if (!log) {
return null;
}
// Only look for the residual variables in the last 1000 characters
let iterable = log.slice(-1000, -1).matchAll("Solving for ([A-Za-z]+), Initial residual = ");
// Create a set to make sure we don't get duplicates
let allVars = new Set();