 We cannot, we cannot hold the max for whatever reason. It's my yellow period. You have all the painters have different periods. You have the blue one, this is the yellow one. And so you'll get a yellow talk. Okay, so thanks for inviting me. So I'm Christophe Gozane. So I'm a professor at the University of Liège. Liège is like an hour from here. I lead a team of about 15, 20 people over there and we do applied math, scientific computing and engineering physics. And basically we write codes to solve PDEs and we also do the stuff that goes around that which is about mesh generation. So we use finite elements and so we need finite element meshes for various applications. And we like open source. So we release quite a few open source software tools. And so the one I'm going to talk to you about today is Gmesh. So what is Gmesh? Have you used Gmesh before? Some of you? Oh yeah, not as nice as OpenCascade, but okay. Still pretty good. All right, so Gmesh is an open source 3D mesh generator. So there are quite a few commercial offerings in that space. Gmesh is open source. It's probably nowadays the most commonly used open source mesh generator for finite elements just because it includes let's say the whole pipeline. So you can build geometry, you can mesh, you can export, you can visualize some results and you can also interface some solvers directly. So what is it? If we look at the size of it, so it's not a small project, it's not a large project. It's a bit in the middle. So it's half a million of C++, lines of code. It's still developed a kernel by two people only. So Jean-François Remacle from the University of L'Ovala-Neuve and myself. And then we have quite a few contributions and external modules that we call contributors or contributions. And so over there we have like a hundred, let's say significant contributors that have pushed something of reasonable size in the repo. There are people mailing lists. It's about, to give you an idea, 10,000 downloads per month. Academically it's a quite successful project so it's got quite a lot of citations. And so it has become, as I said before, one of the go-to, let's say open source solutions when you need to do a finite element mesh. There are 20 years of development. If you want to have a look at what this looks like, this is a gorse animation. With the yellow tint in the screen it's not super nice but what you will see, and it's quite short, so I sped it up over 20 years to last for just about a minute. And so what you will see and what I want to show you is that you have like three main bits of the repo that will appear. You have like the kernel that gets worked on a lot, mostly by two people. And then you have two external things. So you have the contributions and then you have the benchmarks or the validation cases. And you will see that those are actually pretty cold so we try to keep them, let's say, steady over the years so that we can manage to generate, let's say, correct meshes over even very old data sets. And this is what you see there on the screen. I don't know if my mouse works. So this is the kernel here. This is the contributions. You see that contributions are actually larger than the kernel and then you have these, let's say, test cases there that should stay, let's say, valid over the long run. And so these are the three main bits in the repo that you will see. So this is a bit of history. So it's an old project. It was started more than 20 years ago. And you see there are several, let's say, major milestones. At the beginning it wasn't open source. It was just a toy project that I did with Jean-François. And then what we went through is typical stages of development. So open sourced in 2006, 2003, sorry, under GNU-GPL. And then you see all the major features that were added over the years. And you also see an acceleration, actually of major releases. You see that version three came, well, more than 10 years after version two, but version four came just one year after version three. And so development has been accelerating because we've been investing a lot more time, actually, in development Gmesh recently. Choices that we made, so it's simple C++. It's still actually C++98 compatible. Version five will drop that. Why do we do that? Because we have quite a few embedders that actually use the Gmesh library inside codes that run on all computers, all supercomputers that are in commercial products. And so we still maintain backward compatibility quite a bit. It has a GUI, it's OpenGL for graphics, highly portable. And for those of you who used it, you know that to install a binary is quite easy. Even if you don't go through a distribution, you just get the binary and it works. We use quite a few third party libraries. We use CMake. And then in the beginning was a hobby. My own research was about PDE solvers. And so mesh generation was a hobby. And nowadays it's become half of my, let's say, the time I spent in research. What about community? Actually we are not on GitHub or GitLab. We use our own GitLab. And why do we do that? Because we have public and private parts. And so we want to be able to manage the whole thing. So it's hosted on GitLab, done one lab info. And you have all the usual Shebang features with mailing list and stuff. Licensing is GPL v2 all later. And we have exceptions so that actually people who want to combine Gmes with non-GPL software can do this easily. What are the concepts? I'll go very briefly on that. So I have like two slides for each of the modules in Gmesh, four main modules. Geometry, mesh, solver and post-processing. And you can use Gmesh at three levels. Either graphically through a GUI. It's a simple GUI but it's extremely useful for the academic part of Gmesh. So I use this for teaching and quite a few groups use this for teaching all over the world. You can use a dedicated geo-language. This is the language that was created before Python was there. And so we needed to have our own little language. And then you can use it. The bottom way to use Gmesh is through the API. And so this API is either C++, C, Python and or Julia. There is one main characteristic that undergoes, let's say that underpins everything that's done in Gmesh is that it is CAD agnostic. Meaning that all the algorithms are written in a generic way so that you can attack natively geometrical representations that are very different. One of the geometrical representation that we attack is open cascade. But we never translate. So basically we use the kernel for each geometrical representation directly to do all the operations. Either geometrical operations or meshing. And so that means that basically you can mesh without losing any accuracy in the original model. Models that are like this or this is a typical CAD model. This is landing gear for a NERBUS. You can mesh stuff in our own, let's say native, let's say geometrical description format. So these are multi-scale geophysics models. Or you can mesh discrete data. So data that would come from imaging processes. For example, in medical image processors. What do we do then, as I said, we basically use the native kernel for each representation to do all the operations. Then you have a mesh module, of course. So that's the second module. And what does the mesh model do? Well, it produces meshes. This is the core of gmesh. And we have a whole bunch of algorithms. From 1D to 3D. Many things you can imagine. Interfaces also to external mesh generators. And then the data structures are designed in such a way that we generate efficiently and we modify efficiently conformal finite element meshes for those of you who know what this is. Typically what you need to know is that if you want to mesh something like the simple piece on the left, actually what, this is an open cascade geometry. This is what open cascade actually has internally for the parametric representation of the surface. And so you see that it's mathematically speaking, horrible. You have a singularity over here. This edge there degenerates to a point. And so this is periodic. And so to generate a mesh for this, a mesh that looks like this, you actually need to generate this. Okay, and so this is how it works internally. So everything is basically an isotropic, highly stretched with various constraints. There is a solver module that doesn't contain any solver. So basically it's just an interface to solvers. And then you have a post-processing module that we still use compared to Paraview because we can do high order visualization that Paraview will introduce. They have some things, but it's not there yet. What about recent stuff? So I'll show you four, let's say, recent things that we've been doing. First one is a nice interface to CSG, so to construct a solid geometry. It's again, cat kernel agnostic. So you can change the cat kernel, you do the operations and you get the result whatever the cat kernel that you have underneath. An API, I'll show you some numbers about parallel meshing. And then something quite neat that we introduced recently is the meshing of STLs. So CSG, you've seen the open cascade talk, so you know how it works. Basically in the geo format, it looks like that. So you have basic commands and you have your Boolean operators over there. The main thing in Gmesh is that line over there. So set factory open cascade. This will allow you to have a fully open source solution because you use the open source open cascade cat kernel. But you can change that to set factory competitor of open cascade so that you do the same thing. And this gives you let's say an idea of the Gmesh GUI. What is the API? It's actually our third attempt at doing an API. What are the constraints? We wanted to do everything that we could do in the simple script files. And of course much more. We wanted to be robust. We didn't want bad input to crash. So we didn't want to have any access to pointers. We wanted to be efficient but still to do simple things simply. You should remember I'm a professor so I teach with this. I still want a sphere or a cube to be described quite easily and straightforwardly. And we want to be able to maintain this over the long run and when they say we, it's two persons. And so we want to be on top of this. What did we do? Pretty much we did Fortran. So it's super simple. The idea is that the API is purely functional and it only uses basic types from the target language. So integers, double strings and arrays, those things. And it's fully documented and it's documented and it is generated automatically. And so it would look like that. So if you use Python, this is how I use gmesh nowadays. And so basically you have a single gmesh module. We can distribute this. There is an SDK actually on the web because we basically attack directly the C symbols. So there is no recompilation, no swig, no nonsense. It's pure, let's say simple things. You can do of course the same in C++. You would do the same in Julia, et cetera, et cetera. And in addition to that, once you have an API, well you can start building your codes using gmesh. And this is what we do now. So our PDE solvers basically embed the gmesh library so that we get efficiently meshes, topologies, interpolation, integration, basis functions, all the stuff that you need basically to write PDEs. Have a look at the website. You have examples for all of this. Let me give you some numbers. So there's been a huge push for the last two years to get gmesh parallel. And so nowadays, if you download the gmesh binary, it's still sequential because we have trouble distributing the binary linked with OpenMP because the parallelism in gmesh is based on OpenMP. But if you recompile gmesh or if you use gmesh through Fedora, for example, you will get the parallel version. These are some numbers. These are the kind of stuff you can do now with gmesh. So basically look at these two columns here for a non-trivial tire geometry. You generate pretty much 100 million tets in how much is that? 360 seconds on one thread. And so this is done on a laptop. You can go to very large models. So basically gmesh now is able to generate several hundred million tetrahedra in reasonable amount of times. The scaling you will see is not perfect, but it allows you to basically generate extremely large meshes. Last thing, what time is it? We can remesh meshes. And so this is how it works. So if you have an STL, actually, we compute all the mathematics and the reprotonatization to use the algorithms that we had before on these discrete geometries. And so typically you get an image from medical imaging devices. Well, you can basically remesh them directly. Same thing for this. You see that you can apply the same algorithms before. And these are extremely large cases. You can do this kind of, let's say, x-ray tomography images. You can remesh them right away. All right. So I've shown you an overview, some recent developments. And actually there are many interesting things. You can just read them over there. High order stuff. And then must have boundary layers. All right, thanks a lot. You said you were going to get a picture of what you were moving up to. So G-mesh 5 will move to C++ 11. Sorry, yeah. You heard it, yeah. Okay, yeah. Oh, sorry. You have to repeat from the microphone. Yeah, yeah, okay. We'll do it next time. We'll do it next time. Yes, so the, yeah, sorry. Comparison of speed, right? With net gain, ted gain. So equality, yes, indeed. So there are several aspects to that. It's a very long answer. So ted gain, for example, only does 3D. So G-mesh does 1D, 2D, 3D. The speed of the new version of the G-mesh algorithm is actually in, well, it's parallel. Yeah. Suffice it to say. Same thing for net gain. Quality wise, it all depends on the optimizer. Because once you generate a mesh, it's not enough. You need to optimize the mesh. And so the optimizer, actually, we have our own. There is a second one now. And we also interface the one from net gain just to cover all bases. Yes? OK, so will it be possible to provide sizing functions directly in the native language of the API? Not currently. So basically, you are constrained by, let's say, the size fields that we provide. And so you cannot directly give a function in the native language. It's my last item over there. So how is the work going on for boundary layers? So basically, the 2D case is not too bad, but is in the process of being rewritten. In the 3D stuff, there is a PhD thesis, actually, in the works. And so in about a year, we should see the first mergers in G-mesh for that. It's a tough problem because we don't want to do it the same way that other people do it. Yeah, so it's sorry, boundary layers, does it include other physics? Yeah, the boundary layer is independent of physics. So the idea is that you want to generate a mesh with specific constraints and, let's say, a structured, let's say, topology close to a boundary. But it's parametrization. Oh yeah, so what about the parametrization of the layers? Yeah, that's trivial. So the complicated part is actually to getting this to be robust on complex geometries with re-entrant corners, small features, and so on. But the sizing, once you know how to do this, the sizing is just the detail. So do I collide with my university patent office? If I was in the US, I would take the fifth. So I'm here in Belgium. Actually, no. So it was a struggle at the beginning to actually make them accept that this was an open source project. Now, G-mesh is actually a special project because since it was done in our free time, and then both Jean-François and myself, we moved away from our universities. Actually, we manage actually the copyright to stay with Jean-François and myself. And so that's the reason why you have the kernel and then all the contributions. So all the code that is contributed in the framework, for example, of EU projects or whatever projects, this goes into contrib and not into the kernel. Thank you so much.