text:
test_msh = (
    msh_version = "4.1",
    raw_PhysicalNames = [
        "27",
        "0 1 Point1",
        "0 2 Point2",
        "0 3 Point3",
        "0 4 Point4",
        "0 5 Point5",
        "0 6 Point6",
        "0 7 Point7",
        "0 8 Point8",
        "1 9 Curve1",
        "1 10 Curve2",
        "1 11 Curve3",
        "1 12 Curve4",
        "1 13 Curve5",
        "1 14 Curve6",
        "1 15 Curve7",
        "1 16 Curve8",
        "1 17 Curve9",
        "1 18 Curve10",
        "1 19 Curve11",
        "1 20 Curve12",
        "2 21 Surface1",
        "2 22 Surface2",
        "2 23 Surface3",
        "2 24 Surface4",
        "2 25 Surface5",
        "2 26 Surface6",
        "3 27 Volume1"
    ],
    raw_Entities = SubString{String}[
        "8 12 6 1",
        "1 0 0 0 1 1 ",
        "2 1 0 0 1 2 ",
        "3 1 1 0 1 3 ",
        "4 0 1 0 1 4 ",
        "5 0 0 1 1 5 ",
        "6 1 0 1 1 6 ",
        "7 1 1 1 1 7 ",
        "8 0 1 1 1 8 ",
        "1 0 0 0 1 0 0 1 9 2 1 -2 ",
        "2 1 0 0 1 1 0 1 10 2 2 -3 ",
        "3 0 1 0 1 1 0 1 11 2 3 -4 ",
        "4 0 0 0 0 1 0 1 12 2 4 -1 ",
        "5 0 0 1 1 0 1 1 13 2 5 -6 ",
        "6 1 0 1 1 1 1 1 14 2 6 -7 ",
        "7 0 1 1 1 1 1 1 15 2 7 -8 ",
        "8 0 0 1 0 1 1 1 16 2 8 -5 ",
        "9 0 0 0 0 0 1 1 17 2 1 -5 ",
        "10 1 0 0 1 0 1 1 18 2 2 -6 ",
        "11 1 1 0 1 1 1 1 19 2 3 -7 ",
        "12 0 1 0 0 1 1 1 20 2 4 -8 ",
        "1 0 0 0 1 1 0 1 21 4 1 2 3 4 ",
        "2 0 0 1 1 1 1 1 22 4 5 6 7 8 ",
        "3 0 0 0 1 0 1 1 23 4 1 10 -5 -9 ",
        "4 1 0 0 1 1 1 1 24 4 2 11 -6 -10 ",
        "5 0 1 0 1 1 1 1 25 4 3 12 -7 -11 ",
        "6 0 0 0 0 1 1 1 26 4 4 9 -8 -12 ",
        "1 0 0 0 1 1 1 1 27 6 5 1 3 4 2 6 "
    ],
    raw_Nodes = SubString{String}[
        "27 141 1 141",
        "0 1 0 1",
        "1",
        "0 0 0",
        "0 2 0 1",
        "2",
        "1 0 0",
        "0 3 0 1",
        "3",
        "1 1 0",
        "0 4 0 1",
        "4",
        "0 1 0",
        "0 5 0 1",
        "5",
        "0 0 1",
        "0 6 0 1",
        "6",
        "1 0 1",
        "0 7 0 1",
        "7",
        "1 1 1",
        "0 8 0 1",
        "8",
        "0 1 1",
        "1 1 0 3",
        "9",
        "10",
        "11",
        "0.2499999999994121 0 0",
        "0.499999999998694 0 0",
        "0.7499999999993416 0 0",
        "1 2 0 3",
        "12",
        "13",
        "14",
        "1 0.2499999999994121 0",
        "1 0.499999999998694 0",
        "1 0.7499999999993416 0",
        "1 3 0 3",
        "15",
        "16",
        "17",
        "0.7500000000003465 1 0",
        "0.5000000000020591 1 0",
        "0.2500000000010404 1 0",
        "1 4 0 3",
        "18",
        "19",
        "20",
        "0 0.7500000000003465 0",
        "0 0.5000000000020591 0",
        "0 0.2500000000010404 0",
        "1 5 0 3",
        "21",
        "22",
        "23",
        "0.2499999999994121 0 1",
        "0.499999999998694 0 1",
        "0.7499999999993416 0 1",
        "1 6 0 3",
        "24",
        "25",
        "26",
        "1 0.2499999999994121 1",
        "1 0.499999999998694 1",
        "1 0.7499999999993416 1",
        "1 7 0 3",
        "27",
        "28",
        "29",
        "0.7500000000003465 1 1",
        "0.5000000000020591 1 1",
        "0.2500000000010404 1 1",
        "1 8 0 3",
        "30",
        "31",
        "32",
        "0 0.7500000000003465 1",
        "0 0.5000000000020591 1",
        "0 0.2500000000010404 1",
        "1 9 0 3",
        "33",
        "34",
        "35",
        "0 0 0.2499999999994121",
        "0 0 0.499999999998694",
        "0 0 0.7499999999993416",
        "1 10 0 3",
        "36",
        "37",
        "38",
        "1 0 0.2499999999994121",
        "1 0 0.499999999998694",
        "1 0 0.7499999999993416",
        "1 11 0 3",
        "39",
        "40",
        "41",
        "1 1 0.2499999999994121",
        "1 1 0.499999999998694",
        "1 1 0.7499999999993416",
        "1 12 0 3",
        "42",
        "43",
        "44",
        "0 1 0.2499999999994121",
        "0 1 0.499999999998694",
        "0 1 0.7499999999993416",
        "2 1 0 14",
        "45",
        "46",
        "47",
        "48",
        "49",
        "50",
        "51",
        "52",
        "53",
        "54",
        "55",
        "56",
        "57",
        "58",
        "0.3640932128839348 0.7867687832230399 0",
        "0.2110423218192967 0.3753337416957934 0",
        "0.6146003733357942 0.2544869979106268 0",
        "0.8080509614599705 0.6243689539557383 0",
        "0.1979210047255827 0.6215671767908416 0",
        "0.4308090314147045 0.5056502726999197 0",
        "0.3712961061742487 0.2167990069479849 0",
        "0.6139924015723897 0.7478815024664035 0",
        "0.8112741566735278 0.3855439771726542 0",
        "0.6557453848912773 0.5035863408410685 0",
        "0.1830127018930926 0.816987298107279 0",
        "0.816987298107459 0.8169872981071898 0",
        "0.1830127018926974 0.1830127018931337 0",
        "0.8351749060017326 0.1780061950165386 0",
        "2 2 0 14",
        "59",
        "60",
        "61",
        "62",
        "63",
        "64",
        "65",
        "66",
        "67",
        "68",
        "69",
        "70",
        "71",
        "72",
        "0.2110423218193005 0.3753337416957936 1",
        "0.8080509614599763 0.6243689539557384 1",
        "0.3640932128839454 0.7867687832230401 1",
        "0.6146003733358086 0.2544869979106272 1",
        "0.1979210047255958 0.6215671767908419 1",
        "0.4308090314147157 0.50565027269992 1",
        "0.3712961061742522 0.216799006947985 1",
        "0.6139924015723986 0.7478815024664037 1",
        "0.8112741566735373 0.3855439771726545 1",
        "0.6557453848912873 0.5035863408410688 1",
        "0.1830127018930926 0.816987298107279 1",
        "0.816987298107459 0.8169872981071898 1",
        "0.1830127018926974 0.1830127018931337 1",
        "0.8351749060017376 0.1780061950165388 1",
        "2 3 0 15",
        "73",
        "74",
        "75",
        "76",
        "77",
        "78",
        "79",
        "80",
        "81",
        "82",
        "83",
        "84",
        "85",
        "86",
        "87",
        "0.6153312163504611 0 0.789075923896309",
        "0.6170917378877476 0 0.2257047743271724",
        "0.1976765591955711 0 0.3591901734162871",
        "0.3754720741194388 0 0.7886460481895985",
        "0.4969317362217458 0 0.5952411535454394",
        "0.7695402864867603 0 0.6057631425835083",
        "0.2235284352681881 0 0.6069708608364317",
        "0.3590233026280599 0 0.1946445340991931",
        "0.8184954931025595 0 0.3687936625992155",
        "0.6226311529274066 0 0.4319339332988594",
        "0.8169872981073606 0 0.8169872981073606",
        "0.1830127018917413 0 0.1830127018917413",
        "0.1830127018918443 0 0.8169872981078219",
        "0.8184920672745766 0 0.181507932725082",
        "0.4063588167951939 0 0.3999595549599582",
        "2 4 0 15",
        "88",
        "89",
        "90",
        "91",
        "92",
        "93",
        "94",
        "95",
        "96",
        "97",
        "98",
        "99",
        "100",
        "101",
        "102",
        "1 0.6153312163504611 0.789075923896309",
        "1 0.6170917378877475 0.2257047743271724",
        "1 0.197676559195571 0.3591901734162871",
        "1 0.3754720741194388 0.7886460481895985",
        "1 0.4969317362217457 0.5952411535454394",
        "1 0.7695402864867602 0.6057631425835083",
        "1 0.2235284352681881 0.6069708608364317",
        "1 0.3590233026280599 0.1946445340991932",
        "1 0.8184954931025594 0.3687936625992155",
        "1 0.6226311529274065 0.4319339332988594",
        "1 0.8169872981073606 0.8169872981073606",
        "1 0.1830127018917413 0.1830127018917413",
        "1 0.1830127018918443 0.8169872981078219",
        "1 0.8184920672745765 0.181507932725082",
        "1 0.4063588167951938 0.3999595549599583",
        "2 5 0 15",
        "103",
        "104",
        "105",
        "106",
        "107",
        "108",
        "109",
        "110",
        "111",
        "112",
        "113",
        "114",
        "115",
        "116",
        "117",
        "0.3846687836499613 1 0.7890759238966122",
        "0.3829082621126519 1 0.2257047743271914",
        "0.802323440804425 1 0.3591901734163293",
        "0.6245279258805492 1 0.7886460481898609",
        "0.5030682637785254 1 0.5952411535457525",
        "0.2304597135136056 1 0.6057631425835829",
        "0.7764715647317691 1 0.6069708608365612",
        "0.6409766973720423 1 0.1946445340992287",
        "0.1815045068980514 1 0.3687936625992216",
        "0.377368847072953 1 0.4319339332989706",
        "0.1830127018929219 1 0.8169872981071803",
        "0.816987298108235 1 0.1830127018917001",
        "0.8169872981081231 1 0.8169872981078539",
        "0.1815079327254195 1 0.1815079327249734",
        "0.5936411832045371 1 0.3999595549601517",
        "2 6 0 15",
        "118",
        "119",
        "120",
        "121",
        "122",
        "123",
        "124",
        "125",
        "126",
        "127",
        "128",
        "129",
        "130",
        "131",
        "132",
        "0 0.8023234408042703 0.6408098265826103",
        "0 0.3829082621128017 0.7742952256723292",
        "0 0.3846687836505868 0.210924076103197",
        "0 0.6245279258812317 0.2113539518092724",
        "0 0.5030682637792496 0.4047588464540173",
        "0 0.2304597135138703 0.3942368574155138",
        "0 0.6409766973718095 0.8053554659003451",
        "0 0.7764715647318553 0.3930291391623509",
        "0 0.1815045068973792 0.6312063373992799",
        "0 0.3773688470735882 0.5680660667006008",
        "0 0.816987298107459 0.8169872981071898",
        "0 0.1830127018931337 0.1830127018926974",
        "0 0.8169872981084934 0.1830127018914417",
        "0 0.1815079327263542 0.8184920672737503",
        "0 0.5936411832039209 0.6000404450399421",
        "3 1 0 9",
        "133",
        "134",
        "135",
        "136",
        "137",
        "138",
        "139",
        "140",
        "141",
        "0.5253184502755338 0.4743688963830132 0.4870609864531482",
        "0.7079341733417432 0.6968332349071682 0.3267518542871995",
        "0.3174944481988832 0.6856281487180094 0.327136702791096",
        "0.3088726397453448 0.684955952490893 0.6871018919618195",
        "0.2901163524224141 0.3031667650929223 0.6732481457121331",
        "0.3043794824837635 0.3132755102827266 0.3073849782060544",
        "0.6996467238749435 0.6046463782218849 0.7091968691501894",
        "0.6968332349071682 0.277814346970289 0.3267518542871994",
        "0.7322033443290515 0.2677966556715484 0.7250911505955143"
    ],
    raw_Elements = SubString{String}[
        "27 691 1 691",
        "0 1 15 1",
        "1 1 ",
        "0 2 15 1",
        "2 2 ",
        "0 3 15 1",
        "3 3 ",
        "0 4 15 1",
        "4 4 ",
        "0 5 15 1",
        "5 5 ",
        "0 6 15 1",
        "6 6 ",
        "0 7 15 1",
        "7 7 ",
        "0 8 15 1",
        "8 8 ",
        "1 1 1 4",
        "9 1 9 ",
        "10 9 10 ",
        "11 10 11 ",
        "12 11 2 ",
        "1 2 1 4",
        "13 2 12 ",
        "14 12 13 ",
        "15 13 14 ",
        "16 14 3 ",
        "1 3 1 4",
        "17 3 15 ",
        "18 15 16 ",
        "19 16 17 ",
        "20 17 4 ",
        "1 4 1 4",
        "21 4 18 ",
        "22 18 19 ",
        "23 19 20 ",
        "24 20 1 ",
        "1 5 1 4",
        "25 5 21 ",
        "26 21 22 ",
        "27 22 23 ",
        "28 23 6 ",
        "1 6 1 4",
        "29 6 24 ",
        "30 24 25 ",
        "31 25 26 ",
        "32 26 7 ",
        "1 7 1 4",
        "33 7 27 ",
        "34 27 28 ",
        "35 28 29 ",
        "36 29 8 ",
        "1 8 1 4",
        "37 8 30 ",
        "38 30 31 ",
        "39 31 32 ",
        "40 32 5 ",
        "1 9 1 4",
        "41 1 33 ",
        "42 33 34 ",
        "43 34 35 ",
        "44 35 5 ",
        "1 10 1 4",
        "45 2 36 ",
        "46 36 37 ",
        "47 37 38 ",
        "48 38 6 ",
        "1 11 1 4",
        "49 3 39 ",
        "50 39 40 ",
        "51 40 41 ",
        "52 41 7 ",
        "1 12 1 4",
        "53 4 42 ",
        "54 42 43 ",
        "55 43 44 ",
        "56 44 8 ",
        "2 1 2 42",
        "57 1 9 57 ",
        "58 20 1 57 ",
        "59 11 2 58 ",
        "60 2 12 58 ",
        "61 14 3 56 ",
        "62 3 15 56 ",
        "63 17 4 55 ",
        "64 4 18 55 ",
        "65 9 10 51 ",
        "66 9 51 57 ",
        "67 10 11 47 ",
        "68 10 47 51 ",
        "69 47 11 58 ",
        "70 12 13 53 ",
        "71 12 53 58 ",
        "72 13 14 48 ",
        "73 13 48 53 ",
        "74 48 14 56 ",
        "75 15 16 52 ",
        "76 15 52 56 ",
        "77 16 17 45 ",
        "78 16 45 52 ",
        "79 45 17 55 ",
        "80 18 19 49 ",
        "81 18 49 55 ",
        "82 19 20 46 ",
        "83 19 46 49 ",
        "84 46 20 57 ",
        "85 45 49 50 ",
        "86 49 45 55 ",
        "87 45 50 52 ",
        "88 49 46 50 ",
        "89 50 46 51 ",
        "90 51 46 57 ",
        "91 47 50 51 ",
        "92 50 47 54 ",
        "93 47 53 54 ",
        "94 53 47 58 ",
        "95 48 52 54 ",
        "96 52 48 56 ",
        "97 53 48 54 ",
        "98 52 50 54 ",
        "2 2 2 42",
        "99 5 21 71 ",
        "100 32 5 71 ",
        "101 23 6 72 ",
        "102 6 24 72 ",
        "103 26 7 70 ",
        "104 7 27 70 ",
        "105 29 8 69 ",
        "106 8 30 69 ",
        "107 21 22 65 ",
        "108 21 65 71 ",
        "109 22 23 62 ",
        "110 22 62 65 ",
        "111 62 23 72 ",
        "112 24 25 67 ",
        "113 24 67 72 ",
        "114 25 26 60 ",
        "115 25 60 67 ",
        "116 60 26 70 ",
        "117 27 28 66 ",
        "118 27 66 70 ",
        "119 28 29 61 ",
        "120 28 61 66 ",
        "121 61 29 69 ",
        "122 30 31 63 ",
        "123 30 63 69 ",
        "124 31 32 59 ",
        "125 31 59 63 ",
        "126 59 32 71 ",
        "127 63 59 64 ",
        "128 64 59 65 ",
        "129 65 59 71 ",
        "130 60 66 68 ",
        "131 66 60 70 ",
        "132 67 60 68 ",
        "133 61 63 64 ",
        "134 63 61 69 ",
        "135 61 64 66 ",
        "136 62 64 65 ",
        "137 64 62 68 ",
        "138 62 67 68 ",
        "139 67 62 72 ",
        "140 66 64 68 ",
        "2 3 2 44",
        "141 1 9 84 ",
        "142 33 1 84 ",
        "143 11 2 86 ",
        "144 2 36 86 ",
        "145 21 5 85 ",
        "146 5 35 85 ",
        "147 6 23 83 ",
        "148 38 6 83 ",
        "149 9 10 80 ",
        "150 9 80 84 ",
        "151 10 11 74 ",
        "152 10 74 80 ",
        "153 74 11 86 ",
        "154 22 21 76 ",
        "155 76 21 85 ",
        "156 23 22 73 ",
        "157 73 22 76 ",
        "158 23 73 83 ",
        "159 34 33 75 ",
        "160 75 33 84 ",
        "161 35 34 79 ",
        "162 34 75 79 ",
        "163 35 79 85 ",
        "164 36 37 81 ",
        "165 36 81 86 ",
        "166 37 38 78 ",
        "167 37 78 81 ",
        "168 78 38 83 ",
        "169 73 76 77 ",
        "170 73 77 78 ",
        "171 73 78 83 ",
        "172 80 74 87 ",
        "173 74 81 82 ",
        "174 81 74 86 ",
        "175 74 82 87 ",
        "176 79 75 87 ",
        "177 80 75 84 ",
        "178 75 80 87 ",
        "179 77 76 79 ",
        "180 79 76 85 ",
        "181 78 77 82 ",
        "182 77 79 87 ",
        "183 82 77 87 ",
        "184 81 78 82 ",
        "2 4 2 44",
        "185 2 12 99 ",
        "186 36 2 99 ",
        "187 14 3 101 ",
        "188 3 39 101 ",
        "189 24 6 100 ",
        "190 6 38 100 ",
        "191 7 26 98 ",
        "192 41 7 98 ",
        "193 12 13 95 ",
        "194 12 95 99 ",
        "195 13 14 89 ",
        "196 13 89 95 ",
        "197 89 14 101 ",
        "198 25 24 91 ",
        "199 91 24 100 ",
        "200 26 25 88 ",
        "201 88 25 91 ",
        "202 26 88 98 ",
        "203 37 36 90 ",
        "204 90 36 99 ",
        "205 38 37 94 ",
        "206 37 90 94 ",
        "207 38 94 100 ",
        "208 39 40 96 ",
        "209 39 96 101 ",
        "210 40 41 93 ",
        "211 40 93 96 ",
        "212 93 41 98 ",
        "213 88 91 92 ",
        "214 88 92 93 ",
        "215 88 93 98 ",
        "216 95 89 102 ",
        "217 89 96 97 ",
        "218 96 89 101 ",
        "219 89 97 102 ",
        "220 94 90 102 ",
        "221 95 90 99 ",
        "222 90 95 102 ",
        "223 92 91 94 ",
        "224 94 91 100 ",
        "225 93 92 97 ",
        "226 92 94 102 ",
        "227 97 92 102 ",
        "228 96 93 97 ",
        "2 5 2 44",
        "229 3 15 114 ",
        "230 39 3 114 ",
        "231 17 4 116 ",
        "232 4 42 116 ",
        "233 27 7 115 ",
        "234 7 41 115 ",
        "235 8 29 113 ",
        "236 44 8 113 ",
        "237 15 16 110 ",
        "238 15 110 114 ",
        "239 16 17 104 ",
        "240 16 104 110 ",
        "241 104 17 116 ",
        "242 28 27 106 ",
        "243 106 27 115 ",
        "244 29 28 103 ",
        "245 103 28 106 ",
        "246 29 103 113 ",
        "247 40 39 105 ",
        "248 105 39 114 ",
        "249 41 40 109 ",
        "250 40 105 109 ",
        "251 41 109 115 ",
        "252 42 43 111 ",
        "253 42 111 116 ",
        "254 43 44 108 ",
        "255 43 108 111 ",
        "256 108 44 113 ",
        "257 103 106 107 ",
        "258 103 107 108 ",
        "259 103 108 113 ",
        "260 110 104 117 ",
        "261 104 111 112 ",
        "262 111 104 116 ",
        "263 104 112 117 ",
        "264 109 105 117 ",
        "265 110 105 114 ",
        "266 105 110 117 ",
        "267 107 106 109 ",
        "268 109 106 115 ",
        "269 108 107 112 ",
        "270 107 109 117 ",
        "271 112 107 117 ",
        "272 111 108 112 ",
        "2 6 2 44",
        "273 20 1 129 ",
        "274 1 33 129 ",
        "275 4 18 130 ",
        "276 42 4 130 ",
        "277 5 32 131 ",
        "278 35 5 131 ",
        "279 30 8 128 ",
        "280 8 44 128 ",
        "281 18 19 121 ",
        "282 18 121 130 ",
        "283 19 20 120 ",
        "284 19 120 121 ",
        "285 120 20 129 ",
        "286 31 30 124 ",
        "287 124 30 128 ",
        "288 32 31 119 ",
        "289 119 31 124 ",
        "290 32 119 131 ",
        "291 33 34 123 ",
        "292 33 123 129 ",
        "293 34 35 126 ",
        "294 123 34 126 ",
        "295 126 35 131 ",
        "296 43 42 125 ",
        "297 125 42 130 ",
        "298 44 43 118 ",
        "299 118 43 125 ",
        "300 44 118 128 ",
        "301 118 124 128 ",
        "302 124 118 132 ",
        "303 118 125 132 ",
        "304 119 124 132 ",
        "305 126 119 127 ",
        "306 119 126 131 ",
        "307 127 119 132 ",
        "308 121 120 122 ",
        "309 122 120 123 ",
        "310 123 120 129 ",
        "311 121 122 125 ",
        "312 121 125 130 ",
        "313 122 123 127 ",
        "314 125 122 132 ",
        "315 122 127 132 ",
        "316 123 126 127 ",
        "3 1 4 375",
        "317 107 134 133 135 ",
        "318 97 102 92 134 ",
        "319 107 135 133 136 ",
        "320 48 54 53 134 ",
        "321 107 112 117 135 ",
        "322 107 133 134 139 ",
        "323 122 135 136 137 ",
        "324 132 127 122 137 ",
        "325 107 117 134 135 ",
        "326 122 135 137 138 ",
        "327 87 77 82 140 ",
        "328 107 136 133 139 ",
        "329 48 53 89 134 ",
        "330 53 134 54 140 ",
        "331 65 73 76 137 ",
        "332 132 122 136 137 ",
        "333 97 134 92 139 ",
        "334 137 139 64 141 ",
        "335 112 135 107 136 ",
        "336 49 121 120 138 ",
        "337 77 82 140 141 ",
        "338 133 139 137 141 ",
        "339 133 136 135 137 ",
        "340 107 134 109 139 ",
        "341 133 137 135 138 ",
        "342 54 50 133 134 ",
        "343 54 134 133 140 ",
        "344 76 73 77 137 ",
        "345 54 133 50 140 ",
        "346 107 106 136 139 ",
        "347 122 137 127 138 ",
        "348 107 117 109 134 ",
        "349 102 133 92 134 ",
        "350 106 66 103 136 ",
        "351 120 46 49 138 ",
        "352 77 133 87 137 ",
        "353 87 133 77 140 ",
        "354 64 139 68 141 ",
        "355 49 135 121 138 ",
        "356 106 103 107 136 ",
        "357 119 63 59 136 ",
        "358 122 135 132 136 ",
        "359 92 133 102 140 ",
        "360 133 140 92 141 ",
        "361 66 136 106 139 ",
        "362 92 140 102 141 ",
        "363 50 133 134 135 ",
        "364 92 134 133 139 ",
        "365 87 137 133 138 ",
        "366 62 73 137 141 ",
        "367 77 137 73 141 ",
        "368 77 140 133 141 ",
        "369 95 102 89 140 ",
        "370 110 104 52 134 ",
        "371 62 73 65 137 ",
        "372 77 133 137 141 ",
        "373 133 138 50 140 ",
        "374 133 134 102 140 ",
        "375 92 139 133 141 ",
        "376 87 138 133 140 ",
        "377 59 119 136 137 ",
        "378 124 63 119 136 ",
        "379 52 134 104 135 ",
        "380 121 122 120 138 ",
        "381 62 137 64 141 ",
        "382 102 134 89 140 ",
        "383 109 134 93 139 ",
        "384 109 106 107 139 ",
        "385 111 108 125 135 ",
        "386 80 74 51 138 ",
        "387 123 79 75 138 ",
        "388 125 108 118 136 ",
        "389 110 117 104 134 ",
        "390 96 109 105 134 ",
        "391 50 133 135 138 ",
        "392 112 108 111 135 ",
        "393 104 134 117 135 ",
        "394 61 103 66 136 ",
        "395 121 135 122 138 ",
        "396 62 64 68 141 ",
        "397 125 135 108 136 ",
        "398 93 134 97 139 ",
        "399 106 115 70 139 ",
        "400 45 52 104 135 ",
        "401 81 94 90 140 ",
        "402 47 138 74 140 ",
        "403 96 93 109 134 ",
        "404 50 134 52 135 ",
        "405 47 54 50 140 ",
        "406 108 135 112 136 ",
        "407 115 109 98 139 ",
        "408 94 102 140 141 ",
        "409 47 51 74 138 ",
        "410 47 50 138 140 ",
        "411 50 49 46 138 ",
        "412 80 87 74 138 ",
        "413 54 52 50 134 ",
        "414 81 78 94 140 ",
        "415 64 59 63 136 ",
        "416 123 137 79 138 ",
        "417 78 140 82 141 ",
        "418 106 109 115 139 ",
        "419 104 117 112 135 ",
        "420 74 138 87 140 ",
        "421 98 109 93 139 ",
        "422 123 126 79 137 ",
        "423 59 136 64 137 ",
        "424 98 70 115 139 ",
        "425 50 135 49 138 ",
        "426 94 92 102 141 ",
        "427 87 75 79 138 ",
        "428 88 91 67 139 ",
        "429 60 88 67 139 ",
        "430 125 132 135 136 ",
        "431 97 89 102 134 ",
        "432 124 119 132 136 ",
        "433 94 140 78 141 ",
        "434 125 118 132 136 ",
        "435 132 136 119 137 ",
        "436 65 64 62 137 ",
        "437 96 97 93 134 ",
        "438 123 127 137 138 ",
        "439 132 119 127 137 ",
        "440 77 78 82 141 ",
        "441 66 106 70 139 ",
        "442 87 79 137 138 ",
        "443 123 127 126 137 ",
        "444 64 136 66 139 ",
        "445 67 139 91 141 ",
        "446 74 87 82 140 ",
        "447 49 130 121 135 ",
        "448 81 82 78 140 ",
        "449 108 112 107 136 ",
        "450 109 117 105 134 ",
        "451 102 90 94 140 ",
        "452 122 125 132 135 ",
        "453 60 98 88 139 ",
        "454 53 58 95 140 ",
        "455 55 130 49 135 ",
        "456 50 52 45 135 ",
        "457 70 98 60 139 ",
        "458 130 55 116 135 ",
        "459 93 97 92 139 ",
        "460 116 111 130 135 ",
        "461 88 67 25 60 ",
        "462 48 13 89 53 ",
        "463 121 120 19 49 ",
        "464 123 122 127 138 ",
        "465 25 91 67 88 ",
        "466 56 48 101 134 ",
        "467 79 77 87 137 ",
        "468 66 64 61 136 ",
        "469 120 46 19 49 ",
        "470 28 66 103 106 ",
        "471 51 47 50 138 ",
        "472 63 31 119 59 ",
        "473 99 95 58 140 ",
        "474 111 125 130 135 ",
        "475 68 139 67 141 ",
        "476 60 67 68 139 ",
        "477 109 40 96 105 ",
        "478 37 81 94 90 ",
        "479 31 124 63 119 ",
        "480 89 101 48 134 ",
        "481 45 116 55 135 ",
        "482 95 89 13 53 ",
        "483 91 139 92 141 ",
        "484 110 104 16 52 ",
        "485 65 22 76 73 ",
        "486 59 71 131 137 ",
        "487 118 113 128 136 ",
        "488 69 128 113 136 ",
        "489 123 34 75 79 ",
        "490 108 43 125 118 ",
        "491 114 110 56 134 ",
        "492 34 123 126 79 ",
        "493 43 125 111 108 ",
        "494 129 46 120 138 ",
        "495 99 58 86 140 ",
        "496 40 93 109 96 ",
        "497 81 94 78 37 ",
        "498 114 56 101 134 ",
        "499 104 116 45 135 ",
        "500 54 47 53 140 ",
        "501 113 118 108 136 ",
        "502 10 51 80 74 ",
        "503 57 46 129 138 ",
        "504 96 105 101 134 ",
        "505 59 131 119 137 ",
        "506 69 124 128 136 ",
        "507 129 75 84 138 ",
        "508 76 85 65 137 ",
        "509 71 85 131 137 ",
        "510 69 63 124 136 ",
        "511 64 66 68 139 ",
        "512 57 129 84 138 ",
        "513 92 91 88 139 ",
        "514 103 61 113 136 ",
        "515 84 80 57 138 ",
        "516 98 93 88 139 ",
        "517 105 114 101 134 ",
        "518 103 61 66 28 ",
        "519 104 45 16 52 ",
        "520 75 129 123 138 ",
        "521 85 126 131 137 ",
        "522 71 65 85 137 ",
        "523 69 113 61 136 ",
        "524 64 65 59 137 ",
        "525 54 48 52 134 ",
        "526 125 122 121 135 ",
        "527 83 73 72 141 ",
        "528 108 107 103 136 ",
        "529 110 52 56 134 ",
        "530 104 112 111 135 ",
        "531 116 104 111 135 ",
        "532 121 130 125 135 ",
        "533 47 58 53 140 ",
        "534 126 85 79 137 ",
        "535 50 45 49 135 ",
        "536 51 10 47 74 ",
        "537 77 79 76 137 ",
        "538 22 65 62 73 ",
        "539 86 11 74 58 ",
        "540 51 57 80 138 ",
        "541 77 73 78 141 ",
        "542 45 55 49 135 ",
        "543 123 120 122 138 ",
        "544 100 72 67 141 ",
        "545 83 73 23 72 ",
        "546 67 91 100 141 ",
        "547 66 70 60 139 ",
        "548 94 91 92 141 ",
        "549 88 93 92 139 ",
        "550 103 113 108 136 ",
        "551 52 48 56 134 ",
        "552 62 72 73 141 ",
        "553 94 83 100 141 ",
        "554 128 124 118 136 ",
        "555 64 63 61 136 ",
        "556 75 80 84 138 ",
        "557 51 50 46 138 ",
        "558 62 68 67 141 ",
        "559 100 94 38 83 ",
        "560 98 115 41 109 ",
        "561 105 110 114 134 ",
        "562 100 72 24 67 ",
        "563 78 83 94 141 ",
        "564 59 65 71 137 ",
        "565 67 24 100 91 ",
        "566 20 120 129 46 ",
        "567 90 95 99 140 ",
        "568 129 120 123 138 ",
        "569 79 85 76 137 ",
        "570 87 80 75 138 ",
        "571 94 78 38 83 ",
        "572 93 98 41 109 ",
        "573 96 89 97 134 ",
        "574 62 23 73 72 ",
        "575 11 47 74 58 ",
        "576 129 57 20 46 ",
        "577 69 61 63 136 ",
        "578 96 101 89 134 ",
        "579 95 90 102 140 ",
        "580 118 124 132 136 ",
        "581 26 88 60 98 ",
        "582 126 127 119 137 ",
        "583 110 105 117 134 ",
        "584 71 32 59 131 ",
        "585 18 121 49 130 ",
        "586 119 131 126 137 ",
        "587 119 59 32 131 ",
        "588 70 26 60 98 ",
        "589 55 18 49 130 ",
        "590 106 27 70 115 ",
        "591 57 51 46 138 ",
        "592 14 101 56 48 ",
        "593 83 72 100 141 ",
        "594 74 82 81 140 ",
        "595 101 14 89 48 ",
        "596 103 29 113 61 ",
        "597 60 68 66 139 ",
        "598 53 12 95 58 ",
        "599 81 86 74 140 ",
        "600 66 106 27 70 ",
        "601 81 90 36 99 ",
        "602 29 69 113 61 ",
        "603 86 81 36 99 ",
        "604 44 118 108 113 ",
        "605 123 33 129 75 ",
        "606 55 45 17 116 ",
        "607 45 104 17 116 ",
        "608 124 63 69 30 ",
        "609 124 69 128 30 ",
        "610 9 57 84 80 ",
        "611 99 95 12 58 ",
        "612 111 116 130 42 ",
        "613 85 131 126 35 ",
        "614 46 20 120 19 ",
        "615 113 44 118 128 ",
        "616 33 84 129 75 ",
        "617 35 126 85 79 ",
        "618 130 111 42 125 ",
        "619 38 78 94 37 ",
        "620 41 93 109 40 ",
        "621 67 72 62 141 ",
        "622 31 119 59 32 ",
        "623 91 67 24 25 ",
        "624 25 26 88 60 ",
        "625 106 28 66 27 ",
        "626 57 9 51 80 ",
        "627 78 73 83 141 ",
        "628 118 108 43 44 ",
        "629 33 123 34 75 ",
        "630 19 18 121 49 ",
        "631 15 56 110 52 ",
        "632 89 14 13 48 ",
        "633 47 10 11 74 ",
        "634 128 113 8 69 ",
        "635 98 70 7 115 ",
        "636 129 1 57 84 ",
        "637 94 100 91 141 ",
        "638 85 5 71 131 ",
        "639 101 114 3 56 ",
        "640 130 55 4 116 ",
        "641 22 62 23 73 ",
        "642 6 100 83 72 ",
        "643 56 114 15 110 ",
        "644 2 86 99 58 ",
        "645 21 22 76 65 ",
        "646 61 103 29 28 ",
        "647 110 16 15 52 ",
        "648 16 45 104 17 ",
        "649 34 126 35 79 ",
        "650 111 42 125 43 ",
        "651 95 13 12 53 ",
        "652 90 37 81 36 ",
        "653 39 96 40 105 ",
        "654 30 124 63 31 ",
        "655 8 128 69 30 ",
        "656 85 71 5 21 ",
        "657 1 9 57 84 ",
        "658 55 4 18 130 ",
        "659 69 113 8 29 ",
        "660 129 57 1 20 ",
        "661 70 7 26 98 ",
        "662 86 36 2 99 ",
        "663 3 39 114 101 ",
        "664 5 32 71 131 ",
        "665 101 3 14 56 ",
        "666 55 17 4 116 ",
        "667 51 9 10 80 ",
        "668 131 85 5 35 ",
        "669 4 130 116 42 ",
        "670 99 12 2 58 ",
        "671 72 6 100 24 ",
        "672 8 44 113 128 ",
        "673 100 38 6 83 ",
        "674 7 98 115 41 ",
        "675 84 129 1 33 ",
        "676 70 27 7 115 ",
        "677 15 3 114 56 ",
        "678 83 23 6 72 ",
        "679 86 2 11 58 ",
        "680 89 140 53 95 ",
        "681 53 140 89 134 ",
        "682 137 139 136 64 ",
        "683 136 139 137 133 ",
        "684 74 58 140 86 ",
        "685 140 58 74 47 ",
        "686 85 65 21 76 ",
        "687 21 65 85 71 ",
        "688 81 99 140 90 ",
        "689 140 99 81 86 ",
        "690 105 101 39 96 ",
        "691 39 101 105 114 "
    ]
)

test_physicals = (
    physicalTag0DtoName = Dict(
        7 => "Point7",
        4 => "Point4",
        2 => "Point2",
        3 => "Point3",
        5 => "Point5",
        8 => "Point8",
        6 => "Point6",
        1 => "Point1"
    ),
    physicalTag1DtoName = Dict(
        16 => "Curve8",
        11 => "Curve3",
        9 => "Curve1",
        10 => "Curve2",
        19 => "Curve11",
        17 => "Curve9",
        20 => "Curve12",
        13 => "Curve5",
        14 => "Curve6",
        15 => "Curve7",
        12 => "Curve4",
        18 => "Curve10"
    ),
    physicalTag2DtoName = Dict(
        23 => "Surface3",
        26 => "Surface6",
        25 => "Surface5",
        21 => "Surface1",
        22 => "Surface2",
        24 => "Surface4"
    ),
    physicalTag3DtoName = Dict(
        27 => "Volume1"
    )
)

test_entities = (
    pointTagtoPhysicalTag = Dict(
        7 => 7,
        4 => 4,
        2 => 2,
        3 => 3,
        5 => 5,
        8 => 8,
        6 => 6,
        1 => 1
    ),
    curveTagtoPhysicalTag = Dict(
        2 => 10,
        11 => 19,
        7 => 15,
        9 => 17,
        10 => 18,
        8 => 16,
        6 => 14,
        4 => 12,
        3 => 11,
        5 => 13,
        12 => 20,
        1 => 9
    ),
    surfaceTagtoPhysicalTag = Dict(
        4 => 24,
        2 => 22,
        3 => 23,
        5 => 25,
        6 => 26,
        1 => 21
    ),
    volumeTagtoPhysicalTag = Dict(
        1 => 27
    )
)

test_nodes = (
    nodeTag = [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19,
        20,
        21,
        22,
        23,
        24,
        25,
        26,
        27,
        28,
        29,
        30,
        31,
        32,
        33,
        34,
        35,
        36,
        37,
        38,
        39,
        40,
        41,
        42,
        43,
        44,
        45,
        46,
        47,
        48,
        49,
        50,
        51,
        52,
        53,
        54,
        55,
        56,
        57,
        58,
        59,
        60,
        61,
        62,
        63,
        64,
        65,
        66,
        67,
        68,
        69,
        70,
        71,
        72,
        73,
        74,
        75,
        76,
        77,
        78,
        79,
        80,
        81,
        82,
        83,
        84,
        85,
        86,
        87,
        88,
        89,
        90,
        91,
        92,
        93,
        94,
        95,
        96,
        97,
        98,
        99,
        100,
        101,
        102,
        103,
        104,
        105,
        106,
        107,
        108,
        109,
        110,
        111,
        112,
        113,
        114,
        115,
        116,
        117,
        118,
        119,
        120,
        121,
        122,
        123,
        124,
        125,
        126,
        127,
        128,
        129,
        130,
        131,
        132,
        133,
        134,
        135,
        136,
        137,
        138,
        139,
        140,
        141
    ],
    vx = [
        0.0,
        1.0,
        1.0,
        0.0,
        0.0,
        1.0,
        1.0,
        0.0,
        0.2499999999994121,
        0.499999999998694,
        0.7499999999993416,
        1.0,
        1.0,
        1.0,
        0.7500000000003465,
        0.5000000000020591,
        0.2500000000010404,
        0.0,
        0.0,
        0.0,
        0.2499999999994121,
        0.499999999998694,
        0.7499999999993416,
        1.0,
        1.0,
        1.0,
        0.7500000000003465,
        0.5000000000020591,
        0.2500000000010404,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        0.0,
        0.0,
        0.0,
        0.3640932128839348,
        0.2110423218192967,
        0.6146003733357942,
        0.8080509614599705,
        0.1979210047255827,
        0.4308090314147045,
        0.3712961061742487,
        0.6139924015723897,
        0.8112741566735278,
        0.6557453848912773,
        0.1830127018930926,
        0.816987298107459,
        0.1830127018926974,
        0.8351749060017326,
        0.2110423218193005,
        0.8080509614599763,
        0.3640932128839454,
        0.6146003733358086,
        0.1979210047255958,
        0.4308090314147157,
        0.3712961061742522,
        0.6139924015723986,
        0.8112741566735373,
        0.6557453848912873,
        0.1830127018930926,
        0.816987298107459,
        0.1830127018926974,
        0.8351749060017376,
        0.6153312163504611,
        0.6170917378877476,
        0.1976765591955711,
        0.3754720741194388,
        0.4969317362217458,
        0.7695402864867603,
        0.2235284352681881,
        0.3590233026280599,
        0.8184954931025595,
        0.6226311529274066,
        0.8169872981073606,
        0.1830127018917413,
        0.1830127018918443,
        0.8184920672745766,
        0.4063588167951939,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        0.3846687836499613,
        0.3829082621126519,
        0.802323440804425,
        0.6245279258805492,
        0.5030682637785254,
        0.2304597135136056,
        0.7764715647317691,
        0.6409766973720423,
        0.1815045068980514,
        0.377368847072953,
        0.1830127018929219,
        0.816987298108235,
        0.8169872981081231,
        0.1815079327254195,
        0.5936411832045371,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.5253184502755338,
        0.7079341733417432,
        0.3174944481988832,
        0.3088726397453448,
        0.2901163524224141,
        0.3043794824837635,
        0.6996467238749435,
        0.6968332349071682,
        0.7322033443290515
    ],
    vy = [
        0.0,
        0.0,
        1.0,
        1.0,
        0.0,
        0.0,
        1.0,
        1.0,
        0.0,
        0.0,
        0.0,
        0.2499999999994121,
        0.499999999998694,
        0.7499999999993416,
        1.0,
        1.0,
        1.0,
        0.7500000000003465,
        0.5000000000020591,
        0.2500000000010404,
        0.0,
        0.0,
        0.0,
        0.2499999999994121,
        0.499999999998694,
        0.7499999999993416,
        1.0,
        1.0,
        1.0,
        0.7500000000003465,
        0.5000000000020591,
        0.2500000000010404,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        0.7867687832230399,
        0.3753337416957934,
        0.2544869979106268,
        0.6243689539557383,
        0.6215671767908416,
        0.5056502726999197,
        0.2167990069479849,
        0.7478815024664035,
        0.3855439771726542,
        0.5035863408410685,
        0.816987298107279,
        0.8169872981071898,
        0.1830127018931337,
        0.1780061950165386,
        0.3753337416957936,
        0.6243689539557384,
        0.7867687832230401,
        0.2544869979106272,
        0.621567176790842,
        0.50565027269992,
        0.216799006947985,
        0.7478815024664037,
        0.3855439771726545,
        0.5035863408410688,
        0.816987298107279,
        0.8169872981071898,
        0.1830127018931337,
        0.1780061950165388,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.6153312163504611,
        0.6170917378877475,
        0.197676559195571,
        0.3754720741194388,
        0.4969317362217457,
        0.7695402864867602,
        0.2235284352681881,
        0.3590233026280599,
        0.8184954931025594,
        0.6226311529274065,
        0.8169872981073606,
        0.1830127018917413,
        0.1830127018918443,
        0.8184920672745765,
        0.4063588167951938,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        0.8023234408042703,
        0.3829082621128017,
        0.3846687836505868,
        0.6245279258812317,
        0.5030682637792496,
        0.2304597135138703,
        0.6409766973718095,
        0.7764715647318553,
        0.1815045068973792,
        0.3773688470735882,
        0.816987298107459,
        0.1830127018931337,
        0.8169872981084934,
        0.1815079327263542,
        0.5936411832039209,
        0.4743688963830132,
        0.6968332349071682,
        0.6856281487180094,
        0.684955952490893,
        0.3031667650929223,
        0.3132755102827266,
        0.6046463782218849,
        0.277814346970289,
        0.2677966556715484
    ],
    vz = [
        0.0,
        0.0,
        0.0,
        0.0,
        1.0,
        1.0,
        1.0,
        1.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        0.2499999999994121,
        0.499999999998694,
        0.7499999999993416,
        0.2499999999994121,
        0.499999999998694,
        0.7499999999993416,
        0.2499999999994121,
        0.499999999998694,
        0.7499999999993416,
        0.2499999999994121,
        0.499999999998694,
        0.7499999999993416,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        0.789075923896309,
        0.2257047743271724,
        0.3591901734162871,
        0.7886460481895985,
        0.5952411535454394,
        0.6057631425835083,
        0.6069708608364317,
        0.1946445340991931,
        0.3687936625992155,
        0.4319339332988594,
        0.8169872981073606,
        0.1830127018917413,
        0.8169872981078219,
        0.181507932725082,
        0.3999595549599582,
        0.789075923896309,
        0.2257047743271724,
        0.3591901734162871,
        0.7886460481895985,
        0.5952411535454394,
        0.6057631425835083,
        0.6069708608364317,
        0.1946445340991932,
        0.3687936625992155,
        0.4319339332988594,
        0.8169872981073606,
        0.1830127018917413,
        0.8169872981078219,
        0.181507932725082,
        0.3999595549599583,
        0.7890759238966122,
        0.2257047743271914,
        0.3591901734163293,
        0.788646048189861,
        0.5952411535457525,
        0.6057631425835829,
        0.6069708608365612,
        0.1946445340992287,
        0.3687936625992216,
        0.4319339332989706,
        0.8169872981071803,
        0.1830127018917001,
        0.8169872981078539,
        0.1815079327249734,
        0.3999595549601517,
        0.6408098265826103,
        0.7742952256723292,
        0.210924076103197,
        0.2113539518092724,
        0.4047588464540173,
        0.3942368574155138,
        0.8053554659003451,
        0.3930291391623509,
        0.6312063373992799,
        0.5680660667006008,
        0.8169872981071898,
        0.1830127018926974,
        0.1830127018914417,
        0.8184920672737503,
        0.6000404450399421,
        0.4870609864531482,
        0.3267518542871995,
        0.327136702791096,
        0.6871018919618195,
        0.6732481457121331,
        0.3073849782060544,
        0.7091968691501894,
        0.3267518542871994,
        0.7250911505955143
    ]
)

test_elements = (
    entityTag1D = [
        1,
        1,
        1,
        1,
        2,
        2,
        2,
        2,
        3,
        3,
        3,
        3,
        4,
        4,
        4,
        4,
        5,
        5,
        5,
        5,
        6,
        6,
        6,
        6,
        7,
        7,
        7,
        7,
        8,
        8,
        8,
        8,
        9,
        9,
        9,
        9,
        10,
        10,
        10,
        10,
        11,
        11,
        11,
        11,
        12,
        12,
        12,
        12
    ],
    entityTag2D = [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        3,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        5,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6,
        6
    ],
    entityTag3D = [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1
    ],
    elementType1D = [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1
    ],
    elementType2D = [
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2
    ],
    elementType3D = [
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4,
        4
    ],
    elementTag1D = [
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19,
        20,
        21,
        22,
        23,
        24,
        25,
        26,
        27,
        28,
        29,
        30,
        31,
        32,
        33,
        34,
        35,
        36,
        37,
        38,
        39,
        40,
        41,
        42,
        43,
        44,
        45,
        46,
        47,
        48,
        49,
        50,
        51,
        52,
        53,
        54,
        55,
        56
    ],
    elementTag2D = [
        57,
        58,
        59,
        60,
        61,
        62,
        63,
        64,
        65,
        66,
        67,
        68,
        69,
        70,
        71,
        72,
        73,
        74,
        75,
        76,
        77,
        78,
        79,
        80,
        81,
        82,
        83,
        84,
        85,
        86,
        87,
        88,
        89,
        90,
        91,
        92,
        93,
        94,
        95,
        96,
        97,
        98,
        99,
        100,
        101,
        102,
        103,
        104,
        105,
        106,
        107,
        108,
        109,
        110,
        111,
        112,
        113,
        114,
        115,
        116,
        117,
        118,
        119,
        120,
        121,
        122,
        123,
        124,
        125,
        126,
        127,
        128,
        129,
        130,
        131,
        132,
        133,
        134,
        135,
        136,
        137,
        138,
        139,
        140,
        141,
        142,
        143,
        144,
        145,
        146,
        147,
        148,
        149,
        150,
        151,
        152,
        153,
        154,
        155,
        156,
        157,
        158,
        159,
        160,
        161,
        162,
        163,
        164,
        165,
        166,
        167,
        168,
        169,
        170,
        171,
        172,
        173,
        174,
        175,
        176,
        177,
        178,
        179,
        180,
        181,
        182,
        183,
        184,
        185,
        186,
        187,
        188,
        189,
        190,
        191,
        192,
        193,
        194,
        195,
        196,
        197,
        198,
        199,
        200,
        201,
        202,
        203,
        204,
        205,
        206,
        207,
        208,
        209,
        210,
        211,
        212,
        213,
        214,
        215,
        216,
        217,
        218,
        219,
        220,
        221,
        222,
        223,
        224,
        225,
        226,
        227,
        228,
        229,
        230,
        231,
        232,
        233,
        234,
        235,
        236,
        237,
        238,
        239,
        240,
        241,
        242,
        243,
        244,
        245,
        246,
        247,
        248,
        249,
        250,
        251,
        252,
        253,
        254,
        255,
        256,
        257,
        258,
        259,
        260,
        261,
        262,
        263,
        264,
        265,
        266,
        267,
        268,
        269,
        270,
        271,
        272,
        273,
        274,
        275,
        276,
        277,
        278,
        279,
        280,
        281,
        282,
        283,
        284,
        285,
        286,
        287,
        288,
        289,
        290,
        291,
        292,
        293,
        294,
        295,
        296,
        297,
        298,
        299,
        300,
        301,
        302,
        303,
        304,
        305,
        306,
        307,
        308,
        309,
        310,
        311,
        312,
        313,
        314,
        315,
        316
    ],
    elementTag3D = [
        317,
        318,
        319,
        320,
        321,
        322,
        323,
        324,
        325,
        326,
        327,
        328,
        329,
        330,
        331,
        332,
        333,
        334,
        335,
        336,
        337,
        338,
        339,
        340,
        341,
        342,
        343,
        344,
        345,
        346,
        347,
        348,
        349,
        350,
        351,
        352,
        353,
        354,
        355,
        356,
        357,
        358,
        359,
        360,
        361,
        362,
        363,
        364,
        365,
        366,
        367,
        368,
        369,
        370,
        371,
        372,
        373,
        374,
        375,
        376,
        377,
        378,
        379,
        380,
        381,
        382,
        383,
        384,
        385,
        386,
        387,
        388,
        389,
        390,
        391,
        392,
        393,
        394,
        395,
        396,
        397,
        398,
        399,
        400,
        401,
        402,
        403,
        404,
        405,
        406,
        407,
        408,
        409,
        410,
        411,
        412,
        413,
        414,
        415,
        416,
        417,
        418,
        419,
        420,
        421,
        422,
        423,
        424,
        425,
        426,
        427,
        428,
        429,
        430,
        431,
        432,
        433,
        434,
        435,
        436,
        437,
        438,
        439,
        440,
        441,
        442,
        443,
        444,
        445,
        446,
        447,
        448,
        449,
        450,
        451,
        452,
        453,
        454,
        455,
        456,
        457,
        458,
        459,
        460,
        461,
        462,
        463,
        464,
        465,
        466,
        467,
        468,
        469,
        470,
        471,
        472,
        473,
        474,
        475,
        476,
        477,
        478,
        479,
        480,
        481,
        482,
        483,
        484,
        485,
        486,
        487,
        488,
        489,
        490,
        491,
        492,
        493,
        494,
        495,
        496,
        497,
        498,
        499,
        500,
        501,
        502,
        503,
        504,
        505,
        506,
        507,
        508,
        509,
        510,
        511,
        512,
        513,
        514,
        515,
        516,
        517,
        518,
        519,
        520,
        521,
        522,
        523,
        524,
        525,
        526,
        527,
        528,
        529,
        530,
        531,
        532,
        533,
        534,
        535,
        536,
        537,
        538,
        539,
        540,
        541,
        542,
        543,
        544,
        545,
        546,
        547,
        548,
        549,
        550,
        551,
        552,
        553,
        554,
        555,
        556,
        557,
        558,
        559,
        560,
        561,
        562,
        563,
        564,
        565,
        566,
        567,
        568,
        569,
        570,
        571,
        572,
        573,
        574,
        575,
        576,
        577,
        578,
        579,
        580,
        581,
        582,
        583,
        584,
        585,
        586,
        587,
        588,
        589,
        590,
        591,
        592,
        593,
        594,
        595,
        596,
        597,
        598,
        599,
        600,
        601,
        602,
        603,
        604,
        605,
        606,
        607,
        608,
        609,
        610,
        611,
        612,
        613,
        614,
        615,
        616,
        617,
        618,
        619,
        620,
        621,
        622,
        623,
        624,
        625,
        626,
        627,
        628,
        629,
        630,
        631,
        632,
        633,
        634,
        635,
        636,
        637,
        638,
        639,
        640,
        641,
        642,
        643,
        644,
        645,
        646,
        647,
        648,
        649,
        650,
        651,
        652,
        653,
        654,
        655,
        656,
        657,
        658,
        659,
        660,
        661,
        662,
        663,
        664,
        665,
        666,
        667,
        668,
        669,
        670,
        671,
        672,
        673,
        674,
        675,
        676,
        677,
        678,
        679,
        680,
        681,
        682,
        683,
        684,
        685,
        686,
        687,
        688,
        689,
        690,
        691
    ],
    nodeTags1D = [
        [1, 9],
        [9, 10],
        [10, 11],
        [11, 2],
        [2, 12],
        [12, 13],
        [13, 14],
        [14, 3],
        [3, 15],
        [15, 16],
        [16, 17],
        [17, 4],
        [4, 18],
        [18, 19],
        [19, 20],
        [20, 1],
        [5, 21],
        [21, 22],
        [22, 23],
        [23, 6],
        [6, 24],
        [24, 25],
        [25, 26],
        [26, 7],
        [7, 27],
        [27, 28],
        [28, 29],
        [29, 8],
        [8, 30],
        [30, 31],
        [31, 32],
        [32, 5],
        [1, 33],
        [33, 34],
        [34, 35],
        [35, 5],
        [2, 36],
        [36, 37],
        [37, 38],
        [38, 6],
        [3, 39],
        [39, 40],
        [40, 41],
        [41, 7],
        [4, 42],
        [42, 43],
        [43, 44],
        [44, 8]
    ],
    nodeTags2D = [
        [1, 9, 57],
        [20, 1, 57],
        [11, 2, 58],
        [2, 12, 58],
        [14, 3, 56],
        [3, 15, 56],
        [17, 4, 55],
        [4, 18, 55],
        [9, 10, 51],
        [9, 51, 57],
        [10, 11, 47],
        [10, 47, 51],
        [47, 11, 58],
        [12, 13, 53],
        [12, 53, 58],
        [13, 14, 48],
        [13, 48, 53],
        [48, 14, 56],
        [15, 16, 52],
        [15, 52, 56],
        [16, 17, 45],
        [16, 45, 52],
        [45, 17, 55],
        [18, 19, 49],
        [18, 49, 55],
        [19, 20, 46],
        [19, 46, 49],
        [46, 20, 57],
        [45, 49, 50],
        [49, 45, 55],
        [45, 50, 52],
        [49, 46, 50],
        [50, 46, 51],
        [51, 46, 57],
        [47, 50, 51],
        [50, 47, 54],
        [47, 53, 54],
        [53, 47, 58],
        [48, 52, 54],
        [52, 48, 56],
        [53, 48, 54],
        [52, 50, 54],
        [5, 21, 71],
        [32, 5, 71],
        [23, 6, 72],
        [6, 24, 72],
        [26, 7, 70],
        [7, 27, 70],
        [29, 8, 69],
        [8, 30, 69],
        [21, 22, 65],
        [21, 65, 71],
        [22, 23, 62],
        [22, 62, 65],
        [62, 23, 72],
        [24, 25, 67],
        [24, 67, 72],
        [25, 26, 60],
        [25, 60, 67],
        [60, 26, 70],
        [27, 28, 66],
        [27, 66, 70],
        [28, 29, 61],
        [28, 61, 66],
        [61, 29, 69],
        [30, 31, 63],
        [30, 63, 69],
        [31, 32, 59],
        [31, 59, 63],
        [59, 32, 71],
        [63, 59, 64],
        [64, 59, 65],
        [65, 59, 71],
        [60, 66, 68],
        [66, 60, 70],
        [67, 60, 68],
        [61, 63, 64],
        [63, 61, 69],
        [61, 64, 66],
        [62, 64, 65],
        [64, 62, 68],
        [62, 67, 68],
        [67, 62, 72],
        [66, 64, 68],
        [1, 9, 84],
        [33, 1, 84],
        [11, 2, 86],
        [2, 36, 86],
        [21, 5, 85],
        [5, 35, 85],
        [6, 23, 83],
        [38, 6, 83],
        [9, 10, 80],
        [9, 80, 84],
        [10, 11, 74],
        [10, 74, 80],
        [74, 11, 86],
        [22, 21, 76],
        [76, 21, 85],
        [23, 22, 73],
        [73, 22, 76],
        [23, 73, 83],
        [34, 33, 75],
        [75, 33, 84],
        [35, 34, 79],
        [34, 75, 79],
        [35, 79, 85],
        [36, 37, 81],
        [36, 81, 86],
        [37, 38, 78],
        [37, 78, 81],
        [78, 38, 83],
        [73, 76, 77],
        [73, 77, 78],
        [73, 78, 83],
        [80, 74, 87],
        [74, 81, 82],
        [81, 74, 86],
        [74, 82, 87],
        [79, 75, 87],
        [80, 75, 84],
        [75, 80, 87],
        [77, 76, 79],
        [79, 76, 85],
        [78, 77, 82],
        [77, 79, 87],
        [82, 77, 87],
        [81, 78, 82],
        [2, 12, 99],
        [36, 2, 99],
        [14, 3, 101],
        [3, 39, 101],
        [24, 6, 100],
        [6, 38, 100],
        [7, 26, 98],
        [41, 7, 98],
        [12, 13, 95],
        [12, 95, 99],
        [13, 14, 89],
        [13, 89, 95],
        [89, 14, 101],
        [25, 24, 91],
        [91, 24, 100],
        [26, 25, 88],
        [88, 25, 91],
        [26, 88, 98],
        [37, 36, 90],
        [90, 36, 99],
        [38, 37, 94],
        [37, 90, 94],
        [38, 94, 100],
        [39, 40, 96],
        [39, 96, 101],
        [40, 41, 93],
        [40, 93, 96],
        [93, 41, 98],
        [88, 91, 92],
        [88, 92, 93],
        [88, 93, 98],
        [95, 89, 102],
        [89, 96, 97],
        [96, 89, 101],
        [89, 97, 102],
        [94, 90, 102],
        [95, 90, 99],
        [90, 95, 102],
        [92, 91, 94],
        [94, 91, 100],
        [93, 92, 97],
        [92, 94, 102],
        [97, 92, 102],
        [96, 93, 97],
        [3, 15, 114],
        [39, 3, 114],
        [17, 4, 116],
        [4, 42, 116],
        [27, 7, 115],
        [7, 41, 115],
        [8, 29, 113],
        [44, 8, 113],
        [15, 16, 110],
        [15, 110, 114],
        [16, 17, 104],
        [16, 104, 110],
        [104, 17, 116],
        [28, 27, 106],
        [106, 27, 115],
        [29, 28, 103],
        [103, 28, 106],
        [29, 103, 113],
        [40, 39, 105],
        [105, 39, 114],
        [41, 40, 109],
        [40, 105, 109],
        [41, 109, 115],
        [42, 43, 111],
        [42, 111, 116],
        [43, 44, 108],
        [43, 108, 111],
        [108, 44, 113],
        [103, 106, 107],
        [103, 107, 108],
        [103, 108, 113],
        [110, 104, 117],
        [104, 111, 112],
        [111, 104, 116],
        [104, 112, 117],
        [109, 105, 117],
        [110, 105, 114],
        [105, 110, 117],
        [107, 106, 109],
        [109, 106, 115],
        [108, 107, 112],
        [107, 109, 117],
        [112, 107, 117],
        [111, 108, 112],
        [20, 1, 129],
        [1, 33, 129],
        [4, 18, 130],
        [42, 4, 130],
        [5, 32, 131],
        [35, 5, 131],
        [30, 8, 128],
        [8, 44, 128],
        [18, 19, 121],
        [18, 121, 130],
        [19, 20, 120],
        [19, 120, 121],
        [120, 20, 129],
        [31, 30, 124],
        [124, 30, 128],
        [32, 31, 119],
        [119, 31, 124],
        [32, 119, 131],
        [33, 34, 123],
        [33, 123, 129],
        [34, 35, 126],
        [123, 34, 126],
        [126, 35, 131],
        [43, 42, 125],
        [125, 42, 130],
        [44, 43, 118],
        [118, 43, 125],
        [44, 118, 128],
        [118, 124, 128],
        [124, 118, 132],
        [118, 125, 132],
        [119, 124, 132],
        [126, 119, 127],
        [119, 126, 131],
        [127, 119, 132],
        [121, 120, 122],
        [122, 120, 123],
        [123, 120, 129],
        [121, 122, 125],
        [121, 125, 130],
        [122, 123, 127],
        [125, 122, 132],
        [122, 127, 132],
        [123, 126, 127]
    ],
    nodeTags3D = [
        [107, 134, 133, 135],
        [97, 102, 92, 134],
        [107, 135, 133, 136],
        [48, 54, 53, 134],
        [107, 112, 117, 135],
        [107, 133, 134, 139],
        [122, 135, 136, 137],
        [132, 127, 122, 137],
        [107, 117, 134, 135],
        [122, 135, 137, 138],
        [87, 77, 82, 140],
        [107, 136, 133, 139],
        [48, 53, 89, 134],
        [53, 134, 54, 140],
        [65, 73, 76, 137],
        [132, 122, 136, 137],
        [97, 134, 92, 139],
        [137, 139, 64, 141],
        [112, 135, 107, 136],
        [49, 121, 120, 138],
        [77, 82, 140, 141],
        [133, 139, 137, 141],
        [133, 136, 135, 137],
        [107, 134, 109, 139],
        [133, 137, 135, 138],
        [54, 50, 133, 134],
        [54, 134, 133, 140],
        [76, 73, 77, 137],
        [54, 133, 50, 140],
        [107, 106, 136, 139],
        [122, 137, 127, 138],
        [107, 117, 109, 134],
        [102, 133, 92, 134],
        [106, 66, 103, 136],
        [120, 46, 49, 138],
        [77, 133, 87, 137],
        [87, 133, 77, 140],
        [64, 139, 68, 141],
        [49, 135, 121, 138],
        [106, 103, 107, 136],
        [119, 63, 59, 136],
        [122, 135, 132, 136],
        [92, 133, 102, 140],
        [133, 140, 92, 141],
        [66, 136, 106, 139],
        [92, 140, 102, 141],
        [50, 133, 134, 135],
        [92, 134, 133, 139],
        [87, 137, 133, 138],
        [62, 73, 137, 141],
        [77, 137, 73, 141],
        [77, 140, 133, 141],
        [95, 102, 89, 140],
        [110, 104, 52, 134],
        [62, 73, 65, 137],
        [77, 133, 137, 141],
        [133, 138, 50, 140],
        [133, 134, 102, 140],
        [92, 139, 133, 141],
        [87, 138, 133, 140],
        [59, 119, 136, 137],
        [124, 63, 119, 136],
        [52, 134, 104, 135],
        [121, 122, 120, 138],
        [62, 137, 64, 141],
        [102, 134, 89, 140],
        [109, 134, 93, 139],
        [109, 106, 107, 139],
        [111, 108, 125, 135],
        [80, 74, 51, 138],
        [123, 79, 75, 138],
        [125, 108, 118, 136],
        [110, 117, 104, 134],
        [96, 109, 105, 134],
        [50, 133, 135, 138],
        [112, 108, 111, 135],
        [104, 134, 117, 135],
        [61, 103, 66, 136],
        [121, 135, 122, 138],
        [62, 64, 68, 141],
        [125, 135, 108, 136],
        [93, 134, 97, 139],
        [106, 115, 70, 139],
        [45, 52, 104, 135],
        [81, 94, 90, 140],
        [47, 138, 74, 140],
        [96, 93, 109, 134],
        [50, 134, 52, 135],
        [47, 54, 50, 140],
        [108, 135, 112, 136],
        [115, 109, 98, 139],
        [94, 102, 140, 141],
        [47, 51, 74, 138],
        [47, 50, 138, 140],
        [50, 49, 46, 138],
        [80, 87, 74, 138],
        [54, 52, 50, 134],
        [81, 78, 94, 140],
        [64, 59, 63, 136],
        [123, 137, 79, 138],
        [78, 140, 82, 141],
        [106, 109, 115, 139],
        [104, 117, 112, 135],
        [74, 138, 87, 140],
        [98, 109, 93, 139],
        [123, 126, 79, 137],
        [59, 136, 64, 137],
        [98, 70, 115, 139],
        [50, 135, 49, 138],
        [94, 92, 102, 141],
        [87, 75, 79, 138],
        [88, 91, 67, 139],
        [60, 88, 67, 139],
        [125, 132, 135, 136],
        [97, 89, 102, 134],
        [124, 119, 132, 136],
        [94, 140, 78, 141],
        [125, 118, 132, 136],
        [132, 136, 119, 137],
        [65, 64, 62, 137],
        [96, 97, 93, 134],
        [123, 127, 137, 138],
        [132, 119, 127, 137],
        [77, 78, 82, 141],
        [66, 106, 70, 139],
        [87, 79, 137, 138],
        [123, 127, 126, 137],
        [64, 136, 66, 139],
        [67, 139, 91, 141],
        [74, 87, 82, 140],
        [49, 130, 121, 135],
        [81, 82, 78, 140],
        [108, 112, 107, 136],
        [109, 117, 105, 134],
        [102, 90, 94, 140],
        [122, 125, 132, 135],
        [60, 98, 88, 139],
        [53, 58, 95, 140],
        [55, 130, 49, 135],
        [50, 52, 45, 135],
        [70, 98, 60, 139],
        [130, 55, 116, 135],
        [93, 97, 92, 139],
        [116, 111, 130, 135],
        [88, 67, 25, 60],
        [48, 13, 89, 53],
        [121, 120, 19, 49],
        [123, 122, 127, 138],
        [25, 91, 67, 88],
        [56, 48, 101, 134],
        [79, 77, 87, 137],
        [66, 64, 61, 136],
        [120, 46, 19, 49],
        [28, 66, 103, 106],
        [51, 47, 50, 138],
        [63, 31, 119, 59],
        [99, 95, 58, 140],
        [111, 125, 130, 135],
        [68, 139, 67, 141],
        [60, 67, 68, 139],
        [109, 40, 96, 105],
        [37, 81, 94, 90],
        [31, 124, 63, 119],
        [89, 101, 48, 134],
        [45, 116, 55, 135],
        [95, 89, 13, 53],
        [91, 139, 92, 141],
        [110, 104, 16, 52],
        [65, 22, 76, 73],
        [59, 71, 131, 137],
        [118, 113, 128, 136],
        [69, 128, 113, 136],
        [123, 34, 75, 79],
        [108, 43, 125, 118],
        [114, 110, 56, 134],
        [34, 123, 126, 79],
        [43, 125, 111, 108],
        [129, 46, 120, 138],
        [99, 58, 86, 140],
        [40, 93, 109, 96],
        [81, 94, 78, 37],
        [114, 56, 101, 134],
        [104, 116, 45, 135],
        [54, 47, 53, 140],
        [113, 118, 108, 136],
        [10, 51, 80, 74],
        [57, 46, 129, 138],
        [96, 105, 101, 134],
        [59, 131, 119, 137],
        [69, 124, 128, 136],
        [129, 75, 84, 138],
        [76, 85, 65, 137],
        [71, 85, 131, 137],
        [69, 63, 124, 136],
        [64, 66, 68, 139],
        [57, 129, 84, 138],
        [92, 91, 88, 139],
        [103, 61, 113, 136],
        [84, 80, 57, 138],
        [98, 93, 88, 139],
        [105, 114, 101, 134],
        [103, 61, 66, 28],
        [104, 45, 16, 52],
        [75, 129, 123, 138],
        [85, 126, 131, 137],
        [71, 65, 85, 137],
        [69, 113, 61, 136],
        [64, 65, 59, 137],
        [54, 48, 52, 134],
        [125, 122, 121, 135],
        [83, 73, 72, 141],
        [108, 107, 103, 136],
        [110, 52, 56, 134],
        [104, 112, 111, 135],
        [116, 104, 111, 135],
        [121, 130, 125, 135],
        [47, 58, 53, 140],
        [126, 85, 79, 137],
        [50, 45, 49, 135],
        [51, 10, 47, 74],
        [77, 79, 76, 137],
        [22, 65, 62, 73],
        [86, 11, 74, 58],
        [51, 57, 80, 138],
        [77, 73, 78, 141],
        [45, 55, 49, 135],
        [123, 120, 122, 138],
        [100, 72, 67, 141],
        [83, 73, 23, 72],
        [67, 91, 100, 141],
        [66, 70, 60, 139],
        [94, 91, 92, 141],
        [88, 93, 92, 139],
        [103, 113, 108, 136],
        [52, 48, 56, 134],
        [62, 72, 73, 141],
        [94, 83, 100, 141],
        [128, 124, 118, 136],
        [64, 63, 61, 136],
        [75, 80, 84, 138],
        [51, 50, 46, 138],
        [62, 68, 67, 141],
        [100, 94, 38, 83],
        [98, 115, 41, 109],
        [105, 110, 114, 134],
        [100, 72, 24, 67],
        [78, 83, 94, 141],
        [59, 65, 71, 137],
        [67, 24, 100, 91],
        [20, 120, 129, 46],
        [90, 95, 99, 140],
        [129, 120, 123, 138],
        [79, 85, 76, 137],
        [87, 80, 75, 138],
        [94, 78, 38, 83],
        [93, 98, 41, 109],
        [96, 89, 97, 134],
        [62, 23, 73, 72],
        [11, 47, 74, 58],
        [129, 57, 20, 46],
        [69, 61, 63, 136],
        [96, 101, 89, 134],
        [95, 90, 102, 140],
        [118, 124, 132, 136],
        [26, 88, 60, 98],
        [126, 127, 119, 137],
        [110, 105, 117, 134],
        [71, 32, 59, 131],
        [18, 121, 49, 130],
        [119, 131, 126, 137],
        [119, 59, 32, 131],
        [70, 26, 60, 98],
        [55, 18, 49, 130],
        [106, 27, 70, 115],
        [57, 51, 46, 138],
        [14, 101, 56, 48],
        [83, 72, 100, 141],
        [74, 82, 81, 140],
        [101, 14, 89, 48],
        [103, 29, 113, 61],
        [60, 68, 66, 139],
        [53, 12, 95, 58],
        [81, 86, 74, 140],
        [66, 106, 27, 70],
        [81, 90, 36, 99],
        [29, 69, 113, 61],
        [86, 81, 36, 99],
        [44, 118, 108, 113],
        [123, 33, 129, 75],
        [55, 45, 17, 116],
        [45, 104, 17, 116],
        [124, 63, 69, 30],
        [124, 69, 128, 30],
        [9, 57, 84, 80],
        [99, 95, 12, 58],
        [111, 116, 130, 42],
        [85, 131, 126, 35],
        [46, 20, 120, 19],
        [113, 44, 118, 128],
        [33, 84, 129, 75],
        [35, 126, 85, 79],
        [130, 111, 42, 125],
        [38, 78, 94, 37],
        [41, 93, 109, 40],
        [67, 72, 62, 141],
        [31, 119, 59, 32],
        [91, 67, 24, 25],
        [25, 26, 88, 60],
        [106, 28, 66, 27],
        [57, 9, 51, 80],
        [78, 73, 83, 141],
        [118, 108, 43, 44],
        [33, 123, 34, 75],
        [19, 18, 121, 49],
        [15, 56, 110, 52],
        [89, 14, 13, 48],
        [47, 10, 11, 74],
        [128, 113, 8, 69],
        [98, 70, 7, 115],
        [129, 1, 57, 84],
        [94, 100, 91, 141],
        [85, 5, 71, 131],
        [101, 114, 3, 56],
        [130, 55, 4, 116],
        [22, 62, 23, 73],
        [6, 100, 83, 72],
        [56, 114, 15, 110],
        [2, 86, 99, 58],
        [21, 22, 76, 65],
        [61, 103, 29, 28],
        [110, 16, 15, 52],
        [16, 45, 104, 17],
        [34, 126, 35, 79],
        [111, 42, 125, 43],
        [95, 13, 12, 53],
        [90, 37, 81, 36],
        [39, 96, 40, 105],
        [30, 124, 63, 31],
        [8, 128, 69, 30],
        [85, 71, 5, 21],
        [1, 9, 57, 84],
        [55, 4, 18, 130],
        [69, 113, 8, 29],
        [129, 57, 1, 20],
        [70, 7, 26, 98],
        [86, 36, 2, 99],
        [3, 39, 114, 101],
        [5, 32, 71, 131],
        [101, 3, 14, 56],
        [55, 17, 4, 116],
        [51, 9, 10, 80],
        [131, 85, 5, 35],
        [4, 130, 116, 42],
        [99, 12, 2, 58],
        [72, 6, 100, 24],
        [8, 44, 113, 128],
        [100, 38, 6, 83],
        [7, 98, 115, 41],
        [84, 129, 1, 33],
        [70, 27, 7, 115],
        [15, 3, 114, 56],
        [83, 23, 6, 72],
        [86, 2, 11, 58],
        [89, 140, 53, 95],
        [53, 140, 89, 134],
        [137, 139, 136, 64],
        [136, 139, 137, 133],
        [74, 58, 140, 86],
        [140, 58, 74, 47],
        [85, 65, 21, 76],
        [21, 65, 85, 71],
        [81, 99, 140, 90],
        [140, 99, 81, 86],
        [105, 101, 39, 96],
        [39, 101, 105, 114]
    ]
)

using MeshCore.Exports
using StaticArrays
test_xyz = reshape([test_nodes.vx; test_nodes.vy; test_nodes.vz], length(test_nodes.vx), 3)
test_N, test_T = size(test_xyz, 2), eltype(test_xyz)
test_locs = VecAttrib([SVector{test_N,test_T}(test_xyz[i, :]) for i in 1:size(test_xyz, 1)])
test_vertices = ShapeColl(P1, length(test_locs), "vertices")
test_vertices.attributes["geom"] = test_locs
test_shapes = ShapeColl(T4, size(test_elements.nodeTags3D, 1), "elements")
test_ir30 = IncRel(test_shapes, test_vertices, test_elements.nodeTags3D)


text:
function FiniteDifferencePropagatorConverter(arg0::PropagatorBuilder, arg1::jdouble, arg2::jint)
    return FiniteDifferencePropagatorConverter((PropagatorBuilder, jdouble, jint), arg0, arg1, arg2)
end

ext: jl


text:
const Span{U} = Interval{:closed, :open, U}

function initialize_cocycles(::Type{T}, ::Type{U}, cplx) where {T, U}
    instances = map(t -> Cochain(keys(t), spzeros(T, length(t))), cplx)
    map(instances) do inst
        typ = NamedTuple{(:cocycle, :span), Tuple{typeof(inst), Span{U}}}
        StructVector{typ}(undef, 0)
    end
end

function update_cocycles!(::Type{T}, ::Type{U}, simplices,
                          c_small, c_big, indices, weight) where {T, U}
    for index in indices
        simplex = simplices[index]
        m = map(c_small) do (coc, interval)
            weight in interval ? boundaryvalue(coc, simplex) : zero(U)
        end
        s = findall(!iszero, m)
        if !isempty(s)
            li = last(s)
            lc, ic = c_small[li]
            for ii in s[1:end-1]
                ratio = m[ii] / m[li]
                vals = values(c_small[ii].cocycle)
                vals .-= ratio .* values(lc)
            end
            t0, _ = endpoints(ic)
            c_small.span[li] = Span{U}(t0, weight)
        elseif c_big !== nothing
            cocycle = onecochain(T, simplices, index)
            span = Span{U}(weight, U(Inf))
            push!(c_big, (cocycle = cocycle, span = span))
        end
    end
end

function persistentcocycles(::Type{T}, ::Type{U}, cplx, max_dim) where {T, U}
    cocycles_extended = initialize_cocycles(T, U, cplx)
    cocycles = cocycles_extended[1:min(length(cocycles_extended), max_dim+1)]
    sv = simplexiterator(cplx)
    for (weight, (npts, indices)) in sv
        npts > length(cocycles)+1 && continue
        c_small = npts == 1 ? () : cocycles[npts-1]
        c_big = npts <= length(cocycles) ? cocycles[npts] : nothing
        update_cocycles!(T, U, keys(cplx[npts]), c_small, c_big, indices, weight)
    end
    fc = map(cocycles) do c
        filter(t -> !isempty(t.span), c)
    end
    (map(t -> t.cocycle, fc), map(t -> t.span, fc))
end

"""
`persistentcocycles(T, cplx, max_dim = 1)`

Implementation of the persistent cocycle algorithm from Persistent Cohomology and Circular Coordinates - Vin de Silva, Dmitriy Morozov, Mikael Vejdemo-Johansson (https://link.springer.com/article/10.1007/s00454-011-9344-x).

Type `T` must represent a field. Finite fields are available in Julia via the GaloisFields package. `cplx` is a filtered complex (where simplices are assumed to be sorted): see `vietorisrips` for a description of such complex and a way to build it from a sparse distance matrix.

Return two tuples: cocycles (in turn represented as a tuple from 0-cocycles to `max_dim`-cocycles) and spans (again as a tuple) representing the interval during which each cocycle lives.

## Examples

```julia
julia> using SparseArrays

julia> M = sparse(diagm(1 => fill(sqrt(2), 3), 2 => fill(2.0, 2), 3 => [sqrt(2)]))
4×4 SparseMatrixCSC{Float64,Int64} with 6 stored entries:
  [1, 2]  =  1.41421
  [1, 3]  =  2.0
  [2, 3]  =  1.41421
  [1, 4]  =  1.41421
  [2, 4]  =  2.0
  [3, 4]  =  1.41421

julia> cplx = vietorisrips(M, 2)
(Float64-valued 0-Cochain, Float64-valued 1-Cochain, Float64-valued 2-Cochain)

julia> using GaloisFields

julia> cocycles, spans = persistentcocycles(@GaloisField(3), cplx, 1);

julia> cocycles[1]
4-element Array{Cochain{StructArrays.StructArray{Tuple{Int64},1,NamedTuple{(:x1,),Tuple{Array{Int64,1}}}},SparseVector{𝔽₃,Int64}},1}:
 Sparse 𝔽₃-valued 0-Cochain. Non-zero values:
(1,) => 1
(2,) => 1
(3,) => 1
(4,) => 1

 Sparse 𝔽₃-valued 0-Cochain. Non-zero values:
(2,) => 1

 Sparse 𝔽₃-valued 0-Cochain. Non-zero values:
(3,) => 1

 Sparse 𝔽₃-valued 0-Cochain. Non-zero values:
(4,) => 1

julia> spans[1]
4-element Array{IntervalSets.Interval{:closed,:open,Float64},1}:
 0.0..Inf (closed–open)
 0.0..1.4142135623730951 (closed–open)
 0.0..1.4142135623730951 (closed–open)
 0.0..1.4142135623730951 (closed–open)

julia> cocycles[2]
1-element Array{Cochain{StructArrays.StructArray{Tuple{Int64,Int64},1,NamedTuple{(:x1, :x2),Tuple{Array{Int64,1},Array{Int64,1}}}},SparseVector{𝔽₃,Int64}},1}:
 Sparse 𝔽₃-valued 1-Cochain. Non-zero values:
(4, 3) => 1

julia> spans[2]
1-element Array{IntervalSets.Interval{:closed,:open,Float64},1}:
 1.4142135623730951..2.0 (closed–open)
```
"""
persistentcocycles(::Type{T}, cplx, max_dim = 1) where {T} =
    persistentcocycles(T, eltype(cplx[1]), cplx, max_dim)

"""
`persistentcocycles(T, mat::AbstractSparseMatrix, max_dim = 1)`

Compute the filtered Vietoris Rips complex `cplx = vietorisrips(T, mat, max_dim+1)` from the sparse distance matrix `mat` and then compute the persistent cocycles on the result.

```julia
julia> using GaloisFields, SparseArrays

julia> M = sparse(diagm(1 => fill(sqrt(2), 3), 2 => fill(2.0, 2), 3 => [sqrt(2)]));

julia> persistentcocycles(@GaloisField(3), M, 1);
```
"""
persistentcocycles(::Type{T}, mat::AbstractSparseMatrix, max_dim = 1) where {T} =
    persistentcocycles(T, vietorisrips(mat, max_dim+1), max_dim)


text:
load_Niklas_biomass() = ldat(HumanGEM,
    "niklas_biomass", ".jls";
    verbose = false
)


text:
module Optimism

using Codex
using DataFrames

export kilo2scores

# TODO:
# - check with test

# Kilo is, basically, the same for 2018, 2019 and 2020 according to `diff`.

ans_mapping = Dict(
    "Absoluut niet
 mee eens" => 1,
    "Niet
mee eens" => 2,
    "Deels
mee eens" => 3,
    "Mee
eens" => 4,
    "Absoluut
mee eens" => 5
)

ans2num(ans)::Int = return ans_mapping[ans]
score(responses...) = sum(ans2num.(responses))

# According to Glaesmer et al. (2012). The other questions are "filler items".
optimism_questions = [1, 4, 10]
pessimism_questions = [3, 7, 9]

"""
    kilo2scores(df::DataFrame)

Add optimism and pessimism columns.
In 2021-07, returns 290 rows.
"""
function kilo2scores(df::DataFrame)
    cols = [
        :id,
        :completed_at,
        [:v1, :v4, :v10] => ByRow(score) => :optimism,
        [:v3, :v7, :v9] => ByRow(score) => :pessimism
    ]
    select!(df, cols...)
    disallowmissing!(df)
end

end # module


text:
#
# Create initial point and minimize
#

using Random
using Printf
Random.seed!(1234567)

function initial(input :: MDInput)

  # To clear out the code
  n = input.n

  # Structures to save data
  atoms = Atoms(n)
  traj = MDTraj(n,input.nsave)

  # Local names for code simplicity
  x = atoms.x # this does not not copy x, so that is fine
  if input.uf == "uf_QUAD!"
    uf! = uf_QUAD!
  else
    uf! = input.uf
  end

  # Creating random initial coordinates
  i = 0
  while i < n
    i = i + 1
    x[i,1] = -input.side/2.0 + input.side*rand()
    x[i,2] = -input.side/2.0 + input.side*rand()
  end

  xtrial = similar(x)
  forces = Forces(input)
  f = forces.f

  # Minimizing the energy of the initial point

  println(" ----------------------------------------------------------------")
  println(" ENERGY MINIMIZATION")
  println(" ----------------------------------------------------------------")
  ulast = uf!(n,x,forces,input)
  println(" Energy before minimization: ", ulast)

  dx = 1.0
  fnorm = 1.0
  istep = 0
  while fnorm > input.tol
    istep = istep + 1

    # Compute gradient

    u = uf!(n,x,forces,input)
    fnorm = 0.
    for i in 1:n
      fnorm = fnorm + f[i,1]^2 + f[i,2]^2
    end
    fnorm = fnorm / n

    # Compute trial point ( xtrial = x - (dU/dx)*dx )

    for i in 1:n
      xtrial[i,1] = x[i,1] + f[i,1]*dx
      xtrial[i,2] = x[i,2] + f[i,2]*dx
      xtrial[i,1] = image(xtrial[i,1],input)
      xtrial[i,2] = image(xtrial[i,2],input)
    end
    ustep = uf!(n,xtrial,forces,input)

    # If energy decreased, accept, if not, reject and decrease dx

    if ustep < ulast
      for i in 1:n
        x[i,1] = xtrial[i,1]
        x[i,2] = xtrial[i,2]
      end
      ulast = ustep
      dx = dx * 2.
    else
      dx = dx / 2.
    end

    if istep%input.iprint == 0
      println(@sprintf(" MINIM: U = %12.5e G_norm = %12.5e", ustep, fnorm))
    end

  end

  println(" Energy after minimization: ", ulast)

  # Contamining some individuals
  ncont = max(n*input.Si,1)
  nc = 0
  while nc < ncont
    i = trunc(Int64,n*rand())+1
    if atoms.status[i] == 0
      atoms.status[i] = 1
      nc = nc + 1
    end
  end

  return atoms, traj

end


text:
include("eggify.jl")
using Metatheory.Library
using Metatheory.EGraphs.Schedulers

or_alg = @theory begin
  ((p ∨ q) ∨ r) == (p ∨ (q ∨ r))
  (p ∨ q) == (q ∨ p)
  (p ∨ p)     => p
  (p ∨ true)  => true
  (p ∨ false) => p
end

and_alg = @theory begin
  ((p ∧ q) ∧ r) == (p ∧ (q ∧ r))
  (p ∧ q) == (q ∧ p)
  (p ∧ p)     => p
  (p ∧ true)  => p
  (p ∧ false) => false
end

comb = @theory begin
  # DeMorgan
  ¬(p ∨ q) == (¬p ∧ ¬q)
  ¬(p ∧ q) == (¬p ∨ ¬q)
  # distrib
  (p ∧ (q ∨ r)) == ((p ∧ q) ∨ (p ∧ r))
  (p ∨ (q ∧ r)) == ((p ∨ q) ∧ (p ∨ r))
  # absorb
  (p ∧ (p ∨ q)) => p
  (p ∨ (p ∧ q)) => p
  # complement
  (p ∧ (¬p ∨ q)) => p ∧ q
  (p ∨ (¬p ∧ q)) => p ∨ q
end

negt = @theory begin
  (p ∧ ¬p)   => false
  (p ∨ ¬(p)) => true
  ¬(¬p) == p
end

impl = @theory begin
  (p == ¬p) => false
  (p == p)  => true
  (p == q)  => (¬p ∨ q) ∧ (¬q ∨ p)
  (p => q)  => (¬p ∨ q)
end

fold = @theory begin
  (true == false)  => false
  (false == true)  => false
  (true == true)   => true
  (false == false) => true
  (true ∨ false)   => true
  (false ∨ true)   => true
  (true ∨ true)    => true
  (false ∨ false)  => false
  (true ∧ true)    => true
  (false ∧ true)   => false
  (true ∧ false)   => false
  (false ∧ false)  => false
  ¬(true)          => false
  ¬(false)         => true
end

theory = or_alg ∪ and_alg ∪ comb ∪ negt ∪ impl ∪ fold

query = :(¬(((¬p ∨ q) ∧ (¬r ∨ s)) ∧ (p ∨ r)) ∨ (q ∨ s))

###########################################

params = SaturationParams(timeout = 22, eclasslimit = 3051, scheduler = ScoredScheduler)#, schedulerparams=(1000,5, Schedulers.exprsize))

for i in 1:2
  G = EGraph(query)
  report = saturate!(G, theory, params)
  ex = extract!(G, astsize)
  println("Best found: $ex")
  println(report)
end

open("src/main.rs", "w") do f
  write(f, rust_code(theory, query, params))
end


text:
using DataFrames
using Glob
using BeNGS

function read_files(fasta_file, copynumber_file="")
    templates = BeNGS.read_fasta_records(fasta_file)

    template_df = DataFrame()
    template_df[:timepoint] = [Symbol(split(s.name, "_")[1]) for s in templates]
    template_df[:name] = [s.name for s in templates]
    template_df[:sequence] = [String(s.seq) for s in templates]

    fulldf = if copynumber_file == "name"
        template_df[:copynumber] = [parse(Int, split(s.name, "_")[end]) for s in templates]
        template_df
    elseif length(copynumber_file) > 0
        copynumber_df = readtable(copynumber_file, header=false,
                                  names=[:name, :copynumber])
        join(template_df, copynumber_df, on=:name, kind=:outer)
    else
        template_df[:copynumber] = [1 for s in templates]
        template_df
    end

    incomplete = ~completecases(fulldf)
    if any(incomplete)
        missing_seqnames = fulldf[incomplete, :name]
        error("different sequences in fasta and copynumber files: $(missing_seqnames)")
    end

    nrows, _ = size(fulldf)
    if length(unique(fulldf[:name])) < nrows
        error("non-unique sequence names")
    end
    return fulldf
end

function run_metric(true_seqs, true_abn, inf_seqs, inf_abn)
    # run for inferred sequences
    distmat = BeNGS.default_dist_matrix(true_seqs, inf_seqs)
    emd1, _ = BeNGS.smd_mf(distmat; freq1=true_abn, freq2=inf_abn)
    emd2, _ = BeNGS.smd_mf(distmat; freq1=true_abn, freq2=inf_abn,
                           unbounded_first=true)
    emd3, _ = BeNGS.smd_mf(distmat; freq1=true_abn, freq2=inf_abn,
                           unbounded_second=true)
    return distmat, emd1, emd2, emd3
end

function run_all(true_fasta_file, true_abn_file, inf_fasta_file, inf_abn_file)
    true_df = read_files(true_fasta_file, true_abn_file)
    inf_df = read_files(inf_fasta_file, inf_abn_file)
    results = []
    for timepoint in unique(true_df[:timepoint])
        true_df_sub = true_df[true_df[:timepoint] .== timepoint, :]
        true_seqs = true_df_sub[:sequence]
        true_abn = convert(Array{Float64}, true_df_sub[:copynumber])

        inf_df_sub = inf_df[inf_df[:timepoint] .== timepoint, :]
        inf_seqs = inf_df_sub[:sequence]
        inf_abn = convert(Array{Float64}, inf_df_sub[:copynumber])

        distmatrix, smd1, smd2, smd3 = run_metric(true_seqs, true_abn, inf_seqs, inf_abn)
        push!(results, [timepoint, smd1, smd2, smd3])
    end
    return results
end

function main()
    true_fasta_file = ARGS[1]
    true_abn_file = ARGS[2]
    inf_fasta_file = ARGS[3]
    inf_abn_file = ARGS[4]
    outfile = ARGS[5]

    results = run_all(true_fasta_file, true_abn_file,
                      inf_fasta_file, inf_abn_file)
    final_df = DataFrame()
    final_df[:timepoint] = [r[1] for r in results]
    final_df[:smd] = [r[2] for r in results]
    final_df[:false_positive] = [r[3] for r in results]
    final_df[:false_negative] = [r[4] for r in results]

    writetable(outfile, final_df)
end

main()

max_stars_repo_name: veg/flea-pipeline

max_issues_repo_name: veg/flea-pipeline

max_forks_repo_name: veg/flea-pipeline