This program is for mesh generation needed for multi-domain simulations of solutions of partial differential equations. It can edit both 2D and 3D domain configurations, as seen in the screenshots above. This program requires a two-button mouse.
Mesh Generator was created for X Windows using C++ and OpenGL, and has been tested on Ubuntu Linux and Mac OS X. The code can be freely modified and distributed as long as the copyright notice in the file downloaded from this site is included in its entirety at the top of the modified or distributed code.
- On startup, it will automatically try to open Domain_Definition.dat, and will save to Domain_Definition.dat when the "Save" button is pressed.
- To create a new domain, double-click with the left mouse button. Double-clicking on a domain duplicates that domain on the face that you double-clicked.
- To re-center the view, double-click with the right mouse button. Double-clicking on a domain centers the view on that domain. Double-clicking on black centers the view on all domains and zooms out so all are visible
- To select a domain, click on it with the left mouse button.
- To edit a property of a selected domain choose the property with the arrow keys, press enter, type in the new value, and press enter again.
- To move a domain, drag with the left mouse button the center of a face of a domain in the plane that you want to move it in. Note: There should be a yellow shape with four arrows under the cursor.
- To resize a domain, drag with the left mouse button the corner of a face of a domain in the plane that you want to resize it in. Note: There should be a yellow shape with two arrows under the cursor.
- To subdivide a domain, select a domain and click the "Subdivide selection" button, set the number of subdivisions in x, y, and z, and select "Subdivide". To set the number of subdivisions select a subdivision number with the arrow keys, press enter, type in the new value, and press enter again.
- To delete a domain, press the "Delete" or "Backspace" key.
- To rotate the view, drag with the right mouse button.
- To zoom in and out, use the scroll wheel or the +/- keys.
Compiling for Linux
Required packages: g++, libx11-dev, libgl1-mesa-dev, libglu1-mesa-dev
Command: g++ MeshGen.cpp -o MeshGen.out -lX11 -lGL -lGLU
Compiling for Mac OS X
Required libraries: libX11.dylib, libGL.dylib, libGLU.dylib (found in the Xcode disk image under Packages/
Instructions: Open Xcode and follow the steps below. Note: The binary only works if called from xterm.
- File → New Project... → Command Line Utility → C++ Tool → MeshGen
- Select main.cpp → Press Delete
- Control-click MeshGen → Add → Existing Files... → MeshGen.cpp
- Control-click MeshGen → Add → Existing Files... → Press Command-Shift-G → Enter /usr/
X11/ lib → Command-click all the required libraries → Add
- Control-click MeshGen → Get Info → Build
- Linking → Other Linker Flags → Enter -dylib_file/
System/ Library/ Frameworks/ OpenGL.framework/ Versions/ A/ Libraries/ libGL.dylib: /System/ Library/ Frameworks/ OpenGL.framework/ Versions/ A/ Libraries/ libGL.dylib
- Search Paths → Header Search Paths → Add /usr/
- Build → Build