Converter from GMSH to XDMF (with physical groups)

See: Gmsh 4.4.1 in FEniCS? Meshio

1 Like

I was able to make the pytest work downgrading my h5py==2.10.0.
However when converting my mesh, the return is not exactly as expected.
±----------------------------------------+
| GMSH label | MeshFunction value |
±-------------------±-------------------+
±----------------------------------------+
My .geo file has the following Physical Groups:
Physical Line(“Inlet”) = {l1855};
Physical Line(“Outlet”) = {l2123};
Physical Line(“TopWall”) = {l1856, l1857, l1858, l1859, l1860, l1861, l1862, l1863, l1864, l1865, l1866, l1867, l1868, l1869, l1870, l1871, l1872, l1873, l1874, l1875, l1876, l1877, l1878, l1879, l1880, l1881, l1882, l1883, l1884, l1885, l1886, l1887, l1888, l1889, l1890, l1891, l1892, l1893, l1894, l1895, l1896, l1897, l1898, l1899, l1900, l1901, l1902, l1903, l1904, l1905, l1906, l1907, l1908, l1909, l1910, l1911, l1912, l1913, l1914, l1915, l1916, l1917, l1918, l1919, l1920, l1921, l1922, l1923, l1924, l1925, l1926, l1927, l1928, l1929, l1930, l1931, l1932, l1933, l1934, l1935, l1936, l1937, l1938, l1939, l1940, l1941, l1942, l1943, l1944, l1945, l1946, l1947, l1948, l1949, l1950, l1951, l1952, l1953, l1954, l1955, l1956, l1957, l1958, l1959, l1960, l1961, l1962, l1963, l1964, l1965, l1966, l1967, l1968, l1969, l1970, l1971, l1972, l1973, l1974, l1975, l1976, l1977, l1978, l1979, l1980, l1981, l1982, l1983, l1984, l1985, l1986, l1987, l1988, l1989, l1990, l1991, l1992, l1993, l1994, l1995, l1996, l1997, l1998, l1999, l2000, l2001, l2002, l2003, l2004, l2005, l2006, l2007, l2008, l2009, l2010, l2011, l2012, l2013, l2014, l2015, l2016, l2017, l2018, l2019, l2020, l2021, l2022, l2023, l2024, l2025, l2026, l2027, l2028, l2029, l2030, l2031, l2032, l2033, l2034, l2035, l2036, l2037, l2038, l2039, l2040, l2041, l2042, l2043, l2044, l2045, l2046, l2047, l2048, l2049, l2050, l2051, l2052, l2053, l2054, l2055, l2056, l2057, l2058, l2059, l2060, l2061, l2062, l2063, l2064, l2065, l2066, l2067, l2068, l2069, l2070, l2071, l2072, l2073, l2074, l2075, l2076, l2077, l2078, l2079, l2080, l2081, l2082, l2083, l2084, l2085, l2086, l2087, l2088, l2089, l2090, l2091, l2092, l2093, l2094, l2095, l2096, l2097, l2098, l2099, l2100, l2101, l2102, l2103, l2104, l2105, l2106, l2107, l2108, l2109, l2110, l2111, l2112, l2113, l2114, l2115, l2116, l2117, l2118, l2119, l2120, l2121, l2122};
Physical Line(“BottomWall”) = {l2124, l2125, l2126, l2127, l2128, l2129, l2130, l2131, l2132, l2133, l2134, l2135, l2136, l2137, l2138, l2139, l2140, l2141, l2142, l2143, l2144, l2145, l2146, l2147, l2148, l2149, l2150, l2151, l2152, l2153, l2154, l2155, l2156, l2157, l2158, l2159, l2160, l2161, l2162, l2163, l2164, l2165, l2166, l2167, l2168, l2169, l2170, l2171, l2172, l2173, l2174, l2175, l2176, l2177, l2178, l2179, l2180, l2181, l2182, l2183, l2184, l2185, l2186, l2187, l2188, l2189, l2190, l2191, l2192, l2193, l2194, l2195, l2196, l2197, l2198, l2199, l2200, l2201, l2202, l2203, l2204, l2205, l2206, l2207, l2208, l2209, l2210, l2211, l2212, l2213, l2214, l2215, l2216, l2217, l2218, l2219, l2220, l2221, l2222, l2223, l2224, l2225, l2226, l2227, l2228, l2229, l2230, l2231, l2232, l2233, l2234, l2235, l2236, l2237, l2238, l2239, l2240, l2241, l2242, l2243, l2244, l2245, l2246, l2247, l2248, l2249, l2250, l2251, l2252, l2253, l2254, l2255, l2256, l2257, l2258, l2259, l2260, l2261, l2262, l2263, l2264, l2265, l2266, l2267, l2268, l2269, l2270, l2271, l2272, l2273, l2274, l2275, l2276, l2277, l2278, l2279, l2280};
s0 = news;
Plane Surface(s0) = {ll42,ll0,ll1,ll2,ll3,ll4,ll5,ll6,ll7,ll8,ll9,ll10,ll11,ll12,ll13,ll14,ll15,ll16,ll17,ll18,ll19,ll20,ll21,ll22,ll23,ll24,ll25,ll26,ll27,ll28,ll29,ll30,ll31,ll32,ll33,ll34,ll35,ll36,ll37,ll38,ll39,ll40,ll41};
Physical Surface(“Fluid”) = s0;

Is there a problem with my .geo code?

Please follow the community guidelines and submit a minimal working code example: Read before posting: How do I get my question answered?
There are plenty of tutorials on how to convert an msh file to an xdmf file, see for instance:
Mesh generation and conversion with GMSH and PYGMSH | JĂžrgen S. Dokken