<commit_before>#!/usr/bin/env bash

if [ "$#" -gt 2 ] || [ "$#" -eq 0 ]; then
    echo "Illegal number of parameters"
fi

problem=$1

if [ "$#" -eq 2 ]; then
    mesh=$2
else
    mesh=$problem
fi

dos2unix $problem/$mesh.msh

if [ $? -ne 0 ]; then
    echo "Dos2unix not performed."
fi

dolfin-convert $problem/$mesh.msh $problem/$mesh.xml

if [ $? -ne 0 ]; then
    echo "Fatal error occured - GOAT meshes not produced."
    exit -1
fi

python get_material_names.py $problem -m $mesh

if [ $? -ne 0 ]; then
    echo "Fatal error occured - GOAT meshes not produced."
    exit -1
fi<commit_msg>Make gmsh_to_goat.sh oblivious to where it is being called from.<commit_after>#!/usr/bin/env bash

if [ "$#" -gt 2 ] || [ "$#" -eq 0 ]; then
    echo "Illegal number of parameters"
fi

mydir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
problem=$1
problem_dir=$mydir/$problem

if [ "$#" -eq 2 ]; then
    mesh=$2
else
    mesh=$problem
fi

dos2unix $problem_dir/$mesh.msh

if [ $? -ne 0 ]; then
    echo "Dos2unix not performed."
fi

dolfin-convert $problem_dir/$mesh.msh $problem_dir/$mesh.xml

if [ $? -ne 0 ]; then
    echo "Fatal error occured - GOAT meshes not produced."
    exit -1
fi

python $mydir/get_material_names.py $problem -m $mesh

if [ $? -ne 0 ]; then
    echo "Fatal error occured - GOAT meshes not produced."
    exit -1
fi
{'fraction_non_alphanumeric': 0.15223880597014924, 'fraction_numerical': 0.018656716417910446, 'mean_word_length': 2.9441176470588237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2064908', 'n_tokens_mistral': 544, 'n_tokens_neox': 504, 'n_words': 158}