|
[Sponsors] |
August 27, 2016, 09:15 |
2D C++ code for reading mesh (gmsh)
|
#1 |
Member
LUQILIN
Join Date: May 2016
Location: Harbin, China
Posts: 35
Rep Power: 9 |
Hi Guys,
I want to write my own C++ code for 2D flow problems while I have difficulties for reading 2D mesh. I use the mesh generator called Gmsh. Could anyone give me some advice? If there are for some open codes for beginners, that would be very helpful. Thank You. |
|
August 27, 2016, 17:10 |
|
#2 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
The gmsh file format is easily available:
http://gmsh.info/doc/texinfo/gmsh.ht...II-file-format OpenFVM using gmsh for its mesh input format and it is written in C. OpenFOAM has a gmsh input filter that is written in C++. You could refer to those. Honestly though, the *hard* part here is sorting out how your are going to store face, cell, node, and edge data, both location and property data, but also connectivity and access structures. Those design decisions will drive the way you read the mesh file and populate the data structures. So, example code is not really going to be very helpful unless you are using the same data structures...and at that point, then why are you not just using the other code as a base. Good luck. |
|
August 27, 2016, 20:07 |
|
#3 |
Member
LUQILIN
Join Date: May 2016
Location: Harbin, China
Posts: 35
Rep Power: 9 |
Thank you very much.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface | Kryo | OpenFOAM Meshing & Mesh Conversion | 13 | February 17, 2022 07:34 |
Very small job: converting an OpenFOAM mesh to a format needed by another code | SFr | CFD Freelancers | 1 | June 24, 2016 05:45 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 06:20 |
3D Hybrid Mesh Errors | DarrenC | ANSYS Meshing & Geometry | 11 | August 5, 2013 06:42 |
[Gmsh] background mesh in gmsh | Nick_J | OpenFOAM Meshing & Mesh Conversion | 1 | March 20, 2013 04:20 |